From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../ajax/prototype/test/unit/fixtures/ajax.html | 2 + .../ajax/prototype/test/unit/fixtures/ajax.js | 42 +++ .../ajax/prototype/test/unit/fixtures/array.html | 1 + .../ajax/prototype/test/unit/fixtures/base.html | 6 + .../ajax/prototype/test/unit/fixtures/base.js | 106 ++++++++ .../ajax/prototype/test/unit/fixtures/content.html | 1 + .../ajax/prototype/test/unit/fixtures/data.json | 1 + .../ajax/prototype/test/unit/fixtures/dom.css | 85 ++++++ .../ajax/prototype/test/unit/fixtures/dom.html | 285 +++++++++++++++++++++ .../ajax/prototype/test/unit/fixtures/dom.js | 17 ++ .../test/unit/fixtures/element_mixins.html | 4 + .../prototype/test/unit/fixtures/element_mixins.js | 2 + .../ajax/prototype/test/unit/fixtures/empty.html | 0 .../ajax/prototype/test/unit/fixtures/empty.js | 1 + .../prototype/test/unit/fixtures/enumerable.html | 8 + .../prototype/test/unit/fixtures/enumerable.js | 23 ++ .../ajax/prototype/test/unit/fixtures/event.html | 4 + .../ajax/prototype/test/unit/fixtures/form.html | 112 ++++++++ .../ajax/prototype/test/unit/fixtures/hash.js | 25 ++ .../ajax/prototype/test/unit/fixtures/hello.js | 1 + .../ajax/prototype/test/unit/fixtures/logo.gif | Bin 0 -> 3502 bytes .../prototype/test/unit/fixtures/position.html | 9 + .../prototype/test/unit/fixtures/selector.html | 69 +++++ .../ajax/prototype/test/unit/fixtures/string.js | 8 + .../prototype/test/unit/fixtures/unittest.html | 18 ++ 25 files changed, 830 insertions(+) create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/array.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/content.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/data.json create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.css create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/event.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/form.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hash.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hello.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/logo.gif create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/position.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/selector.html create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/string.js create mode 100644 dom/tests/mochitest/ajax/prototype/test/unit/fixtures/unittest.html (limited to 'dom/tests/mochitest/ajax/prototype/test/unit/fixtures') diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.html new file mode 100644 index 0000000000..4af5e267ac --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.html @@ -0,0 +1,2 @@ +
+
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.js new file mode 100644 index 0000000000..8487943f73 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/ajax.js @@ -0,0 +1,42 @@ +var Fixtures = { + js: { + responseBody: '$("content").update("

Hello world!

");', + 'Content-Type': ' text/javascript ' + }, + + html: { + responseBody: "Pack my box with five dozen liquor jugs! " + + "Oh, how quickly daft jumping zebras vex..." + }, + + xml: { + responseBody: 'bar', + 'Content-Type': 'application/xml' + }, + + json: { + responseBody: '{\n\r"test": 123}', + 'Content-Type': 'application/json' + }, + + jsonWithoutContentType: { + responseBody: '{"test": 123}' + }, + + invalidJson: { + responseBody: '{});window.attacked = true;({}', + 'Content-Type': 'application/json' + }, + + headerJson: { + 'X-JSON': '{"test": "hello #éà"}' + } +}; + +var responderCounter = 0; + +// lowercase comparison because of MSIE which presents HTML tags in uppercase +var sentence = ("Pack my box with five dozen liquor jugs! " + +"Oh, how quickly daft jumping zebras vex...").toLowerCase(); + +var message = 'You must be running your tests from rake to test this feature.'; \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/array.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/array.html new file mode 100644 index 0000000000..8f091878c8 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/array.html @@ -0,0 +1 @@ +
22
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.html new file mode 100644 index 0000000000..5a08fbd554 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.html @@ -0,0 +1,6 @@ +
+ \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.js new file mode 100644 index 0000000000..8e9e00bd54 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/base.js @@ -0,0 +1,106 @@ +var Person = function(name){ + this.name = name; +}; + +Person.prototype.toJSON = function() { + return '-' + this.name; +}; + +var arg1 = 1; +var arg2 = 2; +var arg3 = 3; +function TestObj() { }; +TestObj.prototype.assertingEventHandler = + function(event, assertEvent, assert1, assert2, assert3, a1, a2, a3) { + assertEvent(event); + assert1(a1); + assert2(a2); + assert3(a3); + }; + +var globalBindTest = null; + + +// base class +var Animal = Class.create({ + initialize: function(name) { + this.name = name; + }, + name: "", + eat: function() { + return this.say("Yum!"); + }, + say: function(message) { + return this.name + ": " + message; + } +}); + +// subclass that augments a method +var Cat = Class.create(Animal, { + eat: function($super, food) { + if (food instanceof Mouse) return $super(); + else return this.say("Yuk! I only eat mice."); + } +}); + +// empty subclass +var Mouse = Class.create(Animal, {}); + +//mixins +var Sellable = { + getValue: function(pricePerKilo) { + return this.weight * pricePerKilo; + }, + + inspect: function() { + return '#'.interpolate(this); + } +}; + +var Reproduceable = { + reproduce: function(partner) { + if (partner.constructor != this.constructor || partner.sex == this.sex) + return null; + var weight = this.weight / 10, sex = Math.random(1).round() ? 'male' : 'female'; + return new this.constructor('baby', weight, sex); + } +}; + +// base class with mixin +var Plant = Class.create(Sellable, { + initialize: function(name, weight) { + this.name = name; + this.weight = weight; + }, + + inspect: function() { + return '#'.interpolate(this); + } +}); + +// subclass with mixin +var Dog = Class.create(Animal, Reproduceable, { + initialize: function($super, name, weight, sex) { + this.weight = weight; + this.sex = sex; + $super(name); + } +}); + +// subclass with mixins +var Ox = Class.create(Animal, Sellable, Reproduceable, { + initialize: function($super, name, weight, sex) { + this.weight = weight; + this.sex = sex; + $super(name); + }, + + eat: function(food) { + if (food instanceof Plant) + this.weight += food.weight; + }, + + inspect: function() { + return '#'.interpolate(this); + } +}); \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/content.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/content.html new file mode 100644 index 0000000000..ee3701d3c3 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/content.html @@ -0,0 +1 @@ +Pack my box with five dozen liquor jugs! Oh, how quickly daft jumping zebras vex... \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/data.json b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/data.json new file mode 100644 index 0000000000..85391eb939 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/data.json @@ -0,0 +1 @@ +{test: 123} \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.css b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.css new file mode 100644 index 0000000000..453a569c26 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.css @@ -0,0 +1,85 @@ +#style_test_1 { cursor: pointer; font-size:12px;} +div.style-test { margin-left: 1px } + +#style_test_dimensions_container { + position: absolute; + top: 0; + left: 500px; + width: 20px; + height: 30px; + margin: 10px; + padding: 10px; + border: 3px solid red; +} + +#not_floating_style { float: none } +#floating_style { float: left } +#op2 { opacity:0.5;filter:alpha(opacity=50)progid:DXImageTransform.Microsoft.Blur(strength=10);} + +#scroll_test_1 { + margin: 10px; + padding: 10px; + position: relative; +} + +#scroll_test_2 { + position: absolute; + left: 10px; + top: 10px; +} + +#dimensions-visible, +#dimensions-display-none, +#dimensions-visible-pos-rel, +#dimensions-display-none-pos-rel, +#dimensions-visible-pos-abs, +#dimensions-display-none-pos-abs { + font-size: 10px; + height: 10em; + width: 20em; +} + +#dimensions-visible-pos-abs, +#dimensions-display-none-pos-abs { + position: absolute; + top: 15px; + left: 15px; +} + +#dimensions-visible-pos-rel, +#dimensions-display-none-pos-rel { + position: relative; + top: 15px; + left: 15px; +} + +#dimensions-display-none, #dimensions-display-none-pos-rel, #dimensions-display-none-pos-abs { + display: none; +} + +#dimensions-table, #dimensions-tbody, #dimensions-tr, #dimensions-td { + font-size: 10px; + margin: 0; + padding: 0; + border: 0; + border-spacing: 0; + height: 10em; + width: 20em; +} + + +#notInlineAbsoluted { position: absolute; } + +#elementToViewportDimensions { + position: absolute; + top: 0; + left: 0; + height: 10px; + width: 10px; + background: #000; +} + +/* for scroll test on really big screens */ +body { + height: 40000px; +} \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.html new file mode 100644 index 0000000000..1273098e6d --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.html @@ -0,0 +1,285 @@ +
+

Scroll test

+
+ +
visible
+ +
visible
+ +
visible
+ +
visible
+ +
+ +
+ + + + + + + + + + + + +
Data
First Row
Second Row
+
+ +
+ + + + + + + + + + + + +
Data
First Row
Second Row
+
+ +

Test paragraph outside of container

+ +
+

Test paragraph 1 inside of container

+

Test paragraph 2 inside of container

+

Test paragraph 3 inside of container

+

Test paragraph 4 inside of container

+
+ +
to be updated
+
+
+
+
+
+
+
+
+
+
+ +

some text

some text

+ +
V
+
H
+
S
+ +
+ +
+ +
+ + +
+
+ + + + +
+

+
    +
  • +
  • +
  • +
+
+
+
+ + +
+ +
blah
+blah +blah + +
+
+
+
+ +
test_csstext_1
+
test_csstext_2
+
test_csstext_3
+
test_csstext_4
+
test_csstext_5
+ +
+
+
+
+ +
+ + + +
+ + + + + + + + + + + + +
+ + +

+ +
+ + + + + +
+ + + + + +
AB
C
DEF
+ +
+
+ +
+
+ +
NFN
+
NFI
+
NFS
+ +
FI
+
FS
+ +op2 +op2 +op3 +op3 +
+
+
+
+
+
+ + + + + + +
Data
+ +
+ +
+ + +

+

+ + +

+

content

+
+
+
+
+
+
+
+
+ +

some content.

+

some content.

+

some content.

+

some content.

+
+
+
+ + + +
+

+ + +
+
+
+
testtest
+
XYZ
+
+
+ foo + bar +
+
+
+ +
+
+
+
+
+
+
+
+ + +
\ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.js new file mode 100644 index 0000000000..18f62f354c --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/dom.js @@ -0,0 +1,17 @@ +var testVar = 'to be updated', testVar2 = '', documentViewportProperties; + +Element.addMethods({ + hashBrowns: function(element) { return 'hash browns'; } +}); + +Element.addMethods("LI", { + pancakes: function(element) { return "pancakes"; } +}); + +Element.addMethods("DIV", { + waffles: function(element) { return "waffles"; } +}); + +Element.addMethods($w("li div"), { + orangeJuice: function(element) { return "orange juice"; } +}); \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.html new file mode 100644 index 0000000000..583d0e5f30 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.html @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.js new file mode 100644 index 0000000000..22b1c3fd14 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/element_mixins.js @@ -0,0 +1,2 @@ +Form.Element.Methods.coffee = Prototype.K; +Element.addMethods(); \ No newline at end of file diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.js new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/empty.js @@ -0,0 +1 @@ + diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.html new file mode 100644 index 0000000000..5e7e8f3b3c --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.html @@ -0,0 +1,8 @@ + + + + + + + +
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.js new file mode 100644 index 0000000000..5fae7662dd --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/enumerable.js @@ -0,0 +1,23 @@ +var Fixtures = { + People: [ + {name: 'Sam Stephenson', nickname: 'sam-'}, + {name: 'Marcel Molina Jr.', nickname: 'noradio'}, + {name: 'Scott Barron', nickname: 'htonl'}, + {name: 'Nicholas Seckar', nickname: 'Ulysses'} + ], + + Nicknames: $w('sam- noradio htonl Ulysses'), + + Basic: [1, 2, 3], + + Primes: [ + 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, + 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, + 71, 73, 79, 83, 89, 97 + ], + + Z: [] +}; + +for (var i = 1; i <= 100; i++) + Fixtures.Z.push(i); diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/event.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/event.html new file mode 100644 index 0000000000..baa88a7d10 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/event.html @@ -0,0 +1,4 @@ + +
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/form.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/form.html new file mode 100644 index 0000000000..dc7f171bf2 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/form.html @@ -0,0 +1,112 @@ +
+ +
This is not a form element
+ + + + +
+ +
+
+ + + + + +
+ +
+ +
div> + + +
+ + + + + +
+ + +
+ + + + +
+ + + +
+
+ +
+ + + + + +
This is not a form element
+ + + +
+
+ + + +
+ +
+ + +
+
+

+ + +
+ +
+

+ + + +
+ +
+

+ + + +
+ +
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hash.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hash.js new file mode 100644 index 0000000000..be5ccfa7d9 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hash.js @@ -0,0 +1,25 @@ +var Fixtures = { + one: { a: 'A#' }, + + many: { + a: 'A', + b: 'B', + c: 'C', + d: 'D#' + }, + + functions: { + quad: function(n) { return n*n }, + plus: function(n) { return n+n } + }, + + multiple: { color: $w('r g b') }, + multiple_nil: { color: ['r', null, 'g', undefined, 0] }, + multiple_all_nil: { color: [null, undefined] }, + multiple_empty: { color: [] }, + multiple_special: { 'stuff[]': $w('$ a ;') }, + + value_undefined: { a:"b", c:undefined }, + value_null: { a:"b", c:null }, + value_zero: { a:"b", c:0 } +}; diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hello.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hello.js new file mode 100644 index 0000000000..63d81117bf --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/hello.js @@ -0,0 +1 @@ +$("content").update("

Hello world!

"); diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/logo.gif b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/logo.gif new file mode 100644 index 0000000000..71574abd76 Binary files /dev/null and b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/logo.gif differ diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/position.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/position.html new file mode 100644 index 0000000000..5fd7bdf4b6 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/position.html @@ -0,0 +1,9 @@ +
+ +
+
+
+
testtest
+
+
+
diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/selector.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/selector.html new file mode 100644 index 0000000000..d745c8fd55 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/selector.html @@ -0,0 +1,69 @@ + diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/string.js b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/string.js new file mode 100644 index 0000000000..e4483a5b61 --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/string.js @@ -0,0 +1,8 @@ +var attackTarget; +var evalScriptsCounter = 0, + largeTextEscaped = '<span>test</span>', + largeTextUnescaped = 'test'; +(2048).times(function(){ + largeTextEscaped += ' ABC'; + largeTextUnescaped += ' ABC'; +}); diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/unittest.html b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/unittest.html new file mode 100644 index 0000000000..15d303aa3d --- /dev/null +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/unittest.html @@ -0,0 +1,18 @@ +
+ + +
+ +
+ + + +
+
+ +
  • x1
  • x2
+
  • x1
  • x2
+ +
XXXX
+ +
testcss1
testcss1
-- cgit v1.2.3