summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 21:51:02 +0000
committerpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 21:51:02 +0000
commitee129cd136038d6cfd4ea2b31e84af7245a8b3ea (patch)
tree6abd860a25dd620c9774d2e47da88821da39345e
parent53ad85727d113b3228d8e932effbc01da6ade802 (diff)
downloadchromium_src-ee129cd136038d6cfd4ea2b31e84af7245a8b3ea.zip
chromium_src-ee129cd136038d6cfd4ea2b31e84af7245a8b3ea.tar.gz
chromium_src-ee129cd136038d6cfd4ea2b31e84af7245a8b3ea.tar.bz2
Remove tests from pending/ that have been sent upstream or had already been
added to WebKit, as well as their expected results and supporting resources. dom\html\level1\core\null-chardata-crash.html: added in WebKit r37542 webkit\data\layout_tests\pending\dom\html\level2\html\HTMLFrameElement09.js: fixed in r37549 dom\html\level2\html\HTMLIFrameElement11.js: fixed in r37549 http\tests\loading\crash-multiple-family-fontface.html: added in r37665 svg\carto.net\window.svg: fixed in r37544 css\overflow_hidden.html: added in r37665 css\border-height.html: added in r37665 fast\dom\DOMImplementation\singleton-modifications.html: added in r34574 fast\dom\NamedNodeMap-setNamedItem-crash.html: added in r33023 fast\dom\Window\orphaned-frame-access.html: added in r37665 fast\dom\Window\window-open-pending-url.html: added in r37595 fast\history\history_reload.html: fixed in r37657 fast\events\tabindex-focus-blur-all.html: fixed in r37546 fast\events\autoscroll.html: fixed in r34449 fast\text\wbr-styled.html: added in r30412 fast\text\wbr-in-pre-crash.html: added in r30454 fast\text\international\hindi-spacing.html: added in r37665 fast\text\international\ideo_punc.html: added in r30592 fast\encoding\script-in-head.html: fixed in r37547 fast\forms\input-first-letter.html: added in r30414 fast\forms\input-field-text-truncated.html: added in r37665 fast\forms\textarea-width.html: added in r37665 fast\forms\image-border.html: added in r37665 fast\forms\input-type-text-min-width.html: added in r37665 fast\forms\input-readonly-autoscroll.html: fixed in r34449 fast\forms\textarea-scrollbar-height.html: added in r37665 fast\xsl\xslt-nested-stylesheets.xml: added in r38115 fast\tokenizer\nested-multiple-scripts.html: added in r30563 fast\canvas\fillrect_gradient.html: fixed in r37554 fast\js\const.html: fixed in r37543 fast\js\function-toString-parentheses.html: fixed in r37545 fast\parser\utf8-bom-xss.html: added in r33380 fast\parser\bad-xml-entity.html: added in r37665 fast\frames\crash-remove-onload-from-src.html: added in r35088 BUG=4391 TEST= covered by layout tests git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5382 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/data/layout_tests/pending/css/README21
-rw-r--r--webkit/data/layout_tests/pending/css/border-height-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/css/border-height-expected.pngbin5785 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/css/border-height-expected.txt9
-rw-r--r--webkit/data/layout_tests/pending/css/border-height.html7
-rw-r--r--webkit/data/layout_tests/pending/css/overflow_hidden-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/css/overflow_hidden-expected.pngbin3155 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/css/overflow_hidden-expected.txt19
-rw-r--r--webkit/data/layout_tests/pending/css/overflow_hidden.html17
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash-expected.txt1
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash.html15
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09-expected.txt2
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.html16
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.js115
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11-expected.txt2
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.html13
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.js112
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/README8
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/resources/frame.html14
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/resources/iframe.html10
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/right.pngbin144 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/selfhtml.js721
-rw-r--r--webkit/data/layout_tests/pending/dom/html/level2/html/w3c_main.pngbin10292 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/canvas/README4
-rw-r--r--webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.pngbin18994 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.txt54
-rw-r--r--webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient.html105
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications-expected.txt6
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications.html25
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt2
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash.html10
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/Window/README2
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access-expected.txt2
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access.html32
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/Window/resources/destination.html2
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url-expected.txt9
-rw-r--r--webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url.html16
-rw-r--r--webkit/data/layout_tests/pending/fast/encoding/script-in-head-expected.txt5
-rw-r--r--webkit/data/layout_tests/pending/fast/encoding/script-in-head.html30
-rw-r--r--webkit/data/layout_tests/pending/fast/events/autoscroll-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/events/autoscroll-expected.pngbin4495 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/events/autoscroll-expected.txt31
-rw-r--r--webkit/data/layout_tests/pending/fast/events/autoscroll.html46
-rw-r--r--webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame1.html174
-rw-r--r--webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame2.html176
-rw-r--r--webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame3.html1
-rw-r--r--webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe1.html171
-rw-r--r--webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe2.html172
-rw-r--r--webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all.js125
-rw-r--r--webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all-expected.txt2
-rw-r--r--webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all.html9
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/image-border-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/image-border-expected.pngbin3997 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/image-border-expected.txt1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/image-border.html7
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.pngbin3654 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.txt18
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated.html8
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.pngbin4165 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.txt15
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-first-letter.html18
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.pngbin4619 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.txt29
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll.html46
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.pngbin4079 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.txt16
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width.html6
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height-expected.txt1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height.html31
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.pngbin3963 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.txt14
-rw-r--r--webkit/data/layout_tests/pending/fast/forms/textarea-width.html11
-rw-r--r--webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src-expected.txt5
-rw-r--r--webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src.html32
-rw-r--r--webkit/data/layout_tests/pending/fast/history/README2
-rw-r--r--webkit/data/layout_tests/pending/fast/history/history_reload-expected.txt5
-rw-r--r--webkit/data/layout_tests/pending/fast/history/history_reload.html26
-rw-r--r--webkit/data/layout_tests/pending/fast/history/resources/history_reload_window.html33
-rw-r--r--webkit/data/layout_tests/pending/fast/js/README16
-rw-r--r--webkit/data/layout_tests/pending/fast/js/const-expected.txt49
-rw-r--r--webkit/data/layout_tests/pending/fast/js/const.html13
-rw-r--r--webkit/data/layout_tests/pending/fast/js/function-toString-parentheses.html13
-rw-r--r--webkit/data/layout_tests/pending/fast/js/resources/const.js97
-rw-r--r--webkit/data/layout_tests/pending/fast/js/resources/function-toString-parentheses.js202
-rw-r--r--webkit/data/layout_tests/pending/fast/js/resources/js-test-post.js2
-rw-r--r--webkit/data/layout_tests/pending/fast/js/resources/js-test-pre.js135
-rw-r--r--webkit/data/layout_tests/pending/fast/js/resources/js-test-style.css12
-rw-r--r--webkit/data/layout_tests/pending/fast/parser/README1
-rw-r--r--webkit/data/layout_tests/pending/fast/parser/bad-xml-entity-expected.txt3
-rw-r--r--webkit/data/layout_tests/pending/fast/parser/bad-xml-entity.html11
-rw-r--r--webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss-expected.txt4
-rw-r--r--webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss.html23
-rw-r--r--webkit/data/layout_tests/pending/fast/text/README3
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/README10
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.pngbin3999 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.txt22
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/hindi-spacing.html5
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.pngbin7014 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.txt36
-rw-r--r--webkit/data/layout_tests/pending/fast/text/international/ideo_punc.html21
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.pngbin6134 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.txt27
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash.html8
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.pngbin4907 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.txt35
-rw-r--r--webkit/data/layout_tests/pending/fast/text/wbr-styled.html9
-rw-r--r--webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts-expected.txt2
-rw-r--r--webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts.html6
-rw-r--r--webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-1.js6
-rw-r--r--webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-2.js2
-rw-r--r--webkit/data/layout_tests/pending/fast/xsl/README1
-rw-r--r--webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets0.xsl5
-rw-r--r--webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets1.xsl14
-rw-r--r--webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets-expected.txt1
-rw-r--r--webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets.xml4
-rw-r--r--webkit/data/layout_tests/pending/http/tests/loading/README.txt5
-rw-r--r--webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface-expected.txt8
-rw-r--r--webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface.html23
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/README9
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/button.js554
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/colourPicker.js630
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/comboBox.js1178
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/helper_functions.js483
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/initComboBox.js71
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/initSelectionList.js91
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/mapApp.js559
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/scrollbar.js577
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/selectionList.js1065
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/slider.js295
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/tabgroup.js492
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/textbox.js909
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/timer.js74
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/resources/window.js832
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/window-expected.checksum1
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/window-expected.pngbin15016 -> 0 bytes
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/window-expected.txt278
-rw-r--r--webkit/data/layout_tests/pending/svg/carto.net/window.svg208
147 files changed, 0 insertions, 11791 deletions
diff --git a/webkit/data/layout_tests/pending/css/README b/webkit/data/layout_tests/pending/css/README
deleted file mode 100644
index 23adbc0..0000000
--- a/webkit/data/layout_tests/pending/css/README
+++ /dev/null
@@ -1,21 +0,0 @@
-If you add a test to this directory, please edit or add a README file in the
-same directory as your test explaining why it was forked (or that it's new)
-and mentioning any applicable internal or WebKit bugs.
-
-The original versions of tests that have been forked into this directory
-should be added to tests_fixable.txt so we keep track of the need to send
-them upstream and then remove these copies. Mark them as DEFER if possible,
-or SKIP if running them causes problems with other tests.
-
------------------------------------
-
-New test: css/border-height.html
-Corresponding bug#: 1059184
-Bug Description: border-right should be honored irrespective of the elements height.
-Test type: pixel test
------------------------------------
-
-New test: css/overflow_hidden.html
-Corresponding bug#: 655542
-Bug Description: Should not fail to scroll when frame's overflow is hidden.
-Test type: pixel test \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/css/border-height-expected.checksum b/webkit/data/layout_tests/pending/css/border-height-expected.checksum
deleted file mode 100644
index 455f6aa..0000000
--- a/webkit/data/layout_tests/pending/css/border-height-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-a0f5275d053588acedba48dd31e7aca5 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/css/border-height-expected.png b/webkit/data/layout_tests/pending/css/border-height-expected.png
deleted file mode 100644
index 9cb7648..0000000
--- a/webkit/data/layout_tests/pending/css/border-height-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/css/border-height-expected.txt b/webkit/data/layout_tests/pending/css/border-height-expected.txt
deleted file mode 100644
index 389fbfb..0000000
--- a/webkit/data/layout_tests/pending/css/border-height-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-layer at (0,0) size 785x4156
- RenderView at (0,0) size 785x600
-layer at (0,0) size 785x4156
- RenderBlock {HTML} at (0,0) size 785x4156
- RenderBody {BODY} at (8,16) size 769x4132
- RenderBlock {P} at (0,0) size 769x20
- RenderText {#text} at (0,0) size 516x19
- text run at (0,0) width 516: "border-right should be honored irrespective of the elements height. See bug#1059184"
- RenderBlock {DIV} at (0,36) size 505x4096 [border: (1px dotted #000000) (4px solid #8394B2)]
diff --git a/webkit/data/layout_tests/pending/css/border-height.html b/webkit/data/layout_tests/pending/css/border-height.html
deleted file mode 100644
index cbc3c33..0000000
--- a/webkit/data/layout_tests/pending/css/border-height.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<p> border-right should be honored irrespective of the elements height. See bug#1059184 </p>
- <div style="width:500px; height:4095px; border-left: 4px solid #8394B2; border-right: 1px dotted #000; border-bottom: 1px dotted #000;"></div>
-</body>
-</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/css/overflow_hidden-expected.checksum b/webkit/data/layout_tests/pending/css/overflow_hidden-expected.checksum
deleted file mode 100644
index 7b29188..0000000
--- a/webkit/data/layout_tests/pending/css/overflow_hidden-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-911489d3258767f221ca6cfefc5b51e5 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/css/overflow_hidden-expected.png b/webkit/data/layout_tests/pending/css/overflow_hidden-expected.png
deleted file mode 100644
index 2987416..0000000
--- a/webkit/data/layout_tests/pending/css/overflow_hidden-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/css/overflow_hidden-expected.txt b/webkit/data/layout_tests/pending/css/overflow_hidden-expected.txt
deleted file mode 100644
index 9d30698..0000000
--- a/webkit/data/layout_tests/pending/css/overflow_hidden-expected.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-layer at (0,0) size 800x2116
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x2116
- RenderBlock {HTML} at (0,0) size 800x2116
- RenderBody {BODY} at (8,16) size 784x2081
- RenderBlock {P} at (0,0) size 784x18
- RenderInline {B} at (0,0) size 500x18
- RenderText {#text} at (0,0) size 500x18
- text run at (0,0) width 500: "Should not fail to scroll when frame's overflow is hidden . See bug 655542."
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {DIV} at (0,34) size 784x2000
- RenderInline {A} at (0,0) size 65x18 [color=#0000EE]
- RenderText {#text} at (0,0) size 65x18
- text run at (0,0) width 65: "Click here"
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {H2} at (0,2053) size 784x28
- RenderText {#text} at (0,0) size 119x28
- text run at (0,0) width 119: "Test Passed"
-scrolled to 0,1516
diff --git a/webkit/data/layout_tests/pending/css/overflow_hidden.html b/webkit/data/layout_tests/pending/css/overflow_hidden.html
deleted file mode 100644
index 901ee26..0000000
--- a/webkit/data/layout_tests/pending/css/overflow_hidden.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML>
-<html style="overflow: hidden">
-<script>
-function check () {
- var mylink = document.getElementsByTagName('a');
- location = mylink[0];
-}
-</script>
-
-<body onload="check()">
-<p> <b> Should not fail to scroll when frame's overflow is hidden . See bug 655542. </b> </p>
-<div style="height: 2000px">
-<a href="#top">Click here</a> </div>
-<h2 id="top">Test Passed</h2>
-</body>
-
-</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash-expected.txt b/webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash-expected.txt
deleted file mode 100644
index ae84a0e..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-To pass, this test should not crash
diff --git a/webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash.html b/webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash.html
deleted file mode 100644
index b08857f..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level1/core/null-chardata-crash.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>
-<body>
- <p>To pass, this test should not crash</p>
- <script>
- if (window.layoutTestController)
- window.layoutTestController.dumpAsText();
-
- var o = document.createTextNode();
- try {
- o.data = null;
- o.splitText(1);
- } catch (e) {}
- </script>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09-expected.txt b/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09-expected.txt
deleted file mode 100644
index ad5e635..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLFrameElement09
-Status: Success
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.html b/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.html
deleted file mode 100644
index 0f63d45..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
-"http://www.w3.org/TR/html4/frameset.dtd">
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
-<TITLE>NIST DOM HTML Test - FRAME2</TITLE>
-<!-- required by frame contents -->
-<SCRIPT type="text/javascript">function loadComplete() { }</SCRIPT>
-<script type='text/javascript' src='selfhtml.js'></script><script charset='UTF-8' type='text/javascript' src='HTMLFrameElement09.js'></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></HEAD>
-<FRAMESET COLS="20, 80" onload="loadComplete()">
-<FRAMESET ROWS="100, 200">
-<FRAME ID="Frame1" NAME="Frame1" SRC="resources/frame.html">
-</FRAMESET>
-<FRAME ID="Frame2" NAME="Frame2" SRC="resources/iframe.html">
-</FRAMESET>
-</HTML>
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.js b/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.js
deleted file mode 100644
index cb7a057..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLFrameElement09.js
+++ /dev/null
@@ -1,115 +0,0 @@
-
-/*
-Copyright © 2001-2004 World Wide Web Consortium,
-(Massachusetts Institute of Technology, European Research Consortium
-for Informatics and Mathematics, Keio University). All
-Rights Reserved. This work is distributed under the W3C® Software License [1] in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-*/
-
-
-
- /**
- * Gets URI that identifies the test.
- * @return uri identifier of test
- */
-function getTargetURI() {
- return "http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLFrameElement09";
- }
-
-var docsLoaded = -1000000;
-var builder = null;
-
-//
-// This function is called by the testing framework before
-// running the test suite.
-//
-// If there are no configuration exceptions, asynchronous
-// document loading is started. Otherwise, the status
-// is set to complete and the exception is immediately
-// raised when entering the body of the test.
-//
-function setUpPage() {
- setUpPageStatus = 'running';
- try {
- //
- // creates test document builder, may throw exception
- //
- builder = createConfiguredBuilder();
-
- docsLoaded = 0;
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- docsLoaded += preload(docRef, "doc", "frame2");
-
- if (docsLoaded == 1) {
- setUpPageStatus = 'complete';
- }
- } catch(ex) {
- catchInitializationError(builder, ex);
- setUpPageStatus = 'complete';
- }
-}
-
-
-
-//
-// This method is called on the completion of
-// each asychronous load started in setUpTests.
-//
-// When every synchronous loaded document has completed,
-// the page status is changed which allows the
-// body of the test to be executed.
-function loadComplete() {
- if (++docsLoaded == 1) {
- setUpPageStatus = 'complete';
- }
-}
-
-
-/**
-*
- The contentDocument attribute specifies the document this frame contains,
- if there is any and it is available, or null otherwise.
-
- Retrieve the contentDocument attribute of the first FRAME element
- and examine its TITLE value.
-
-* @author NIST
-* @author Rick Rivello
-* @see http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-78799536
-*/
-function HTMLFrameElement09() {
- var success;
- if(checkInitialization(builder, "HTMLFrameElement09") != null) return;
- var testNode;
- var cd;
- var vtitle;
- var doc;
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- doc = load(docRef, "doc", "frame2");
- testNode = doc.getElementById("Frame1");
- cd = testNode.contentDocument;
-
- vtitle = cd.title;
-
- assertEquals("titleLink","NIST DOM HTML Test - FRAMESET",vtitle);
-
-}
-
-
-
-
-function runTest() {
- HTMLFrameElement09();
-}
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11-expected.txt b/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11-expected.txt
deleted file mode 100644
index af5a81c..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIFrameElement11
-Status: Success
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.html b/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.html
deleted file mode 100644
index d401e52..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
-<TITLE>NIST DOM HTML Test - IFRAME2</TITLE>
-<!-- required by frame contents -->
-<SCRIPT type="text/javascript">function loadComplete() { }</SCRIPT>
-<script type='text/javascript' src='selfhtml.js'></script><script charset='UTF-8' type='text/javascript' src='HTMLIFrameElement11.js'></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></HEAD>
-<BODY onload="loadComplete()">
-<IFRAME ID="Iframe1" NAME="Iframe1" SRC="resources/iframe.html">IFRAME1</IFRAME>
-<IFRAME ID="Iframe2" SRC="resources/frame.html" NAME="Iframe2">IFRAME2</IFRAME>
-</BODY>
-</HTML>
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.js b/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.js
deleted file mode 100644
index d7587f8..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/HTMLIFrameElement11.js
+++ /dev/null
@@ -1,112 +0,0 @@
-
-/*
-Copyright © 2001-2004 World Wide Web Consortium,
-(Massachusetts Institute of Technology, European Research Consortium
-for Informatics and Mathematics, Keio University). All
-Rights Reserved. This work is distributed under the W3C® Software License [1] in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-*/
-
-
-
- /**
- * Gets URI that identifies the test.
- * @return uri identifier of test
- */
-function getTargetURI() {
- return "http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLIFrameElement11";
- }
-
-var docsLoaded = -1000000;
-var builder = null;
-
-//
-// This function is called by the testing framework before
-// running the test suite.
-//
-// If there are no configuration exceptions, asynchronous
-// document loading is started. Otherwise, the status
-// is set to complete and the exception is immediately
-// raised when entering the body of the test.
-//
-function setUpPage() {
- setUpPageStatus = 'running';
- try {
- //
- // creates test document builder, may throw exception
- //
- builder = createConfiguredBuilder();
-
- docsLoaded = 0;
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- docsLoaded += preload(docRef, "doc", "iframe2");
-
- if (docsLoaded == 1) {
- setUpPageStatus = 'complete';
- }
- } catch(ex) {
- catchInitializationError(builder, ex);
- setUpPageStatus = 'complete';
- }
-}
-
-
-
-//
-// This method is called on the completion of
-// each asychronous load started in setUpTests.
-//
-// When every synchronous loaded document has completed,
-// the page status is changed which allows the
-// body of the test to be executed.
-function loadComplete() {
- if (++docsLoaded == 1) {
- setUpPageStatus = 'complete';
- }
-}
-
-
-/**
-*
- Retrieve the contentDocument attribute of the second IFRAME element
- and examine its title.
-
-* @author NIST
-* @author Rick Rivello
-* @see http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-67133006
-*/
-function HTMLIFrameElement11() {
- var success;
- if(checkInitialization(builder, "HTMLIFrameElement11") != null) return;
- var testNode;
- var cd;
- var vtitle;
- var doc;
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- doc = load(docRef, "doc", "iframe2");
- testNode = doc.getElementById("Iframe2");
- cd = testNode.contentDocument;
-
- vtitle = cd.title;
-
- assertEquals("titleLink","NIST DOM HTML Test - FRAMESET",vtitle);
-
-}
-
-
-
-
-function runTest() {
- HTMLIFrameElement11();
-}
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/README b/webkit/data/layout_tests/pending/dom/html/level2/html/README
deleted file mode 100644
index cffe0e0..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/README
+++ /dev/null
@@ -1,8 +0,0 @@
-HTMLFrameElement09.html
-HTMLIFrameElement11.html
---------------------------------
-Both tests assign a string to a function name 'setUpPage' and it should
-be assigned to 'setUpPageStatus'. Copy these two tests and related files here.
-HTMLFrameElement09.js and HTMLIFrameElement11.js and both expected output
-files are modified.
-See http://bugs.webkit.org/show_bug.cgi?id=16494 .
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/resources/frame.html b/webkit/data/layout_tests/pending/dom/html/level2/html/resources/frame.html
deleted file mode 100644
index 3cafa09..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/resources/frame.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
-"http://www.w3.org/TR/html4/frameset.dtd">
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
-<TITLE>NIST DOM HTML Test - FRAMESET</TITLE>
-</HEAD>
-<FRAMESET COLS="20, 80" onload="parent.loadComplete()">
-<FRAMESET ROWS="100, 200">
-<FRAME LONGDESC="about:blank" MARGINHEIGHT="10" MARGINWIDTH="5" NORESIZE="NORESIZE" NAME="Frame1" FRAMEBORDER="1" SCROLLING="yes" SRC="../right.png">
-</FRAMESET>
-<FRAME SRC="../w3c_main.png">
-</FRAMESET>
-</HTML>
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/resources/iframe.html b/webkit/data/layout_tests/pending/dom/html/level2/html/resources/iframe.html
deleted file mode 100644
index 914d0bc..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/resources/iframe.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
-<TITLE>NIST DOM HTML Test - IFRAME</TITLE>
-</HEAD>
-<BODY onload="parent.loadComplete()">
-<IFRAME LONGDESC="about:blank" MARGINHEIGHT="10" MARGINWIDTH="5" WIDTH="60" HEIGHT="50" NAME="Iframe1" FRAMEBORDER="1" SCROLLING="yes" SRC="../right.png" ALIGN="top">IFRAME1</IFRAME>
-</BODY>
-</HTML>
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/right.png b/webkit/data/layout_tests/pending/dom/html/level2/html/right.png
deleted file mode 100644
index 1442685..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/right.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/selfhtml.js b/webkit/data/layout_tests/pending/dom/html/level2/html/selfhtml.js
deleted file mode 100644
index 06b0cc1..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/selfhtml.js
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
-Copyright (c) 2001-2005 World Wide Web Consortium,
-(Massachusetts Institute of Technology, European Research Consortium
-for Informatics and Mathematics, Keio University). All
-Rights Reserved. This work is distributed under the W3C(r) Software License [1] in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-*/
-
-
- function assertSize(descr, expected, actual) {
- var actualSize;
- assertNotNull(descr, actual);
- actualSize = actual.length;
- assertEquals(descr, expected, actualSize);
- }
-
- function assertEqualsAutoCase(context, descr, expected, actual) {
- if (builder.contentType == "text/html") {
- if(context == "attribute") {
- assertEquals(descr, expected.toLowerCase(), actual.toLowerCase());
- } else {
- assertEquals(descr, expected.toUpperCase(), actual);
- }
- } else {
- assertEquals(descr, expected, actual);
- }
- }
-
-
- function assertEqualsCollectionAutoCase(context, descr, expected, actual) {
- //
- // if they aren't the same size, they aren't equal
- assertEquals(descr, expected.length, actual.length);
-
- //
- // if there length is the same, then every entry in the expected list
- // must appear once and only once in the actual list
- var expectedLen = expected.length;
- var expectedValue;
- var actualLen = actual.length;
- var i;
- var j;
- var matches;
- for(i = 0; i < expectedLen; i++) {
- matches = 0;
- expectedValue = expected[i];
- for(j = 0; j < actualLen; j++) {
- if (builder.contentType == "text/html") {
- if (context == "attribute") {
- if (expectedValue.toLowerCase() == actual[j].toLowerCase()) {
- matches++;
- }
- } else {
- if (expectedValue.toUpperCase() == actual[j]) {
- matches++;
- }
- }
- } else {
- if(expectedValue == actual[j]) {
- matches++;
- }
- }
- }
- if(matches == 0) {
- assert(descr + ": No match found for " + expectedValue,false);
- }
- if(matches > 1) {
- assert(descr + ": Multiple matches found for " + expectedValue, false);
- }
- }
- }
-
- function assertEqualsCollection(descr, expected, actual) {
- //
- // if they aren't the same size, they aren't equal
- assertEquals(descr, expected.length, actual.length);
- //
- // if there length is the same, then every entry in the expected list
- // must appear once and only once in the actual list
- var expectedLen = expected.length;
- var expectedValue;
- var actualLen = actual.length;
- var i;
- var j;
- var matches;
- for(i = 0; i < expectedLen; i++) {
- matches = 0;
- expectedValue = expected[i];
- for(j = 0; j < actualLen; j++) {
- if(expectedValue == actual[j]) {
- matches++;
- }
- }
- if(matches == 0) {
- assert(descr + ": No match found for " + expectedValue,false);
- }
- if(matches > 1) {
- assert(descr + ": Multiple matches found for " + expectedValue, false);
- }
- }
- }
-
-
- function assertEqualsListAutoCase(context, descr, expected, actual) {
- var minLength = expected.length;
- if (actual.length < minLength) {
- minLength = actual.length;
- }
- //
- for(var i = 0; i < minLength; i++) {
- assertEqualsAutoCase(context, descr, expected[i], actual[i]);
- }
- //
- // if they aren't the same size, they aren't equal
- assertEquals(descr, expected.length, actual.length);
- }
-
-
- function assertEqualsList(descr, expected, actual) {
- var minLength = expected.length;
- if (actual.length < minLength) {
- minLength = actual.length;
- }
- //
- for(var i = 0; i < minLength; i++) {
- if(expected[i] != actual[i]) {
- assertEquals(descr, expected[i], actual[i]);
- }
- }
- //
- // if they aren't the same size, they aren't equal
- assertEquals(descr, expected.length, actual.length);
- }
-
- function assertInstanceOf(descr, type, obj) {
- if(type == "Attr") {
- assertEquals(descr,2,obj.nodeType);
- var specd = obj.specified;
- }
- }
-
- function assertSame(descr, expected, actual) {
- if(expected != actual) {
- assertEquals(descr, expected.nodeType, actual.nodeType);
- assertEquals(descr, expected.nodeValue, actual.nodeValue);
- }
- }
-
- function assertURIEquals(assertID, scheme, path, host, file, name, query, fragment, isAbsolute, actual) {
- //
- // URI must be non-null
- assertNotNull(assertID, actual);
-
- var uri = actual;
-
- var lastPound = actual.lastIndexOf("#");
- var actualFragment = "";
- if(lastPound != -1) {
- //
- // substring before pound
- //
- uri = actual.substring(0,lastPound);
- actualFragment = actual.substring(lastPound+1);
- }
- if(fragment != null) assertEquals(assertID,fragment, actualFragment);
-
- var lastQuestion = uri.lastIndexOf("?");
- var actualQuery = "";
- if(lastQuestion != -1) {
- //
- // substring before pound
- //
- uri = actual.substring(0,lastQuestion);
- actualQuery = actual.substring(lastQuestion+1);
- }
- if(query != null) assertEquals(assertID, query, actualQuery);
-
- var firstColon = uri.indexOf(":");
- var firstSlash = uri.indexOf("/");
- var actualPath = uri;
- var actualScheme = "";
- if(firstColon != -1 && firstColon < firstSlash) {
- actualScheme = uri.substring(0,firstColon);
- actualPath = uri.substring(firstColon + 1);
- }
-
- if(scheme != null) {
- assertEquals(assertID, scheme, actualScheme);
- }
-
- if(path != null) {
- assertEquals(assertID, path, actualPath);
- }
-
- if(host != null) {
- var actualHost = "";
- if(actualPath.substring(0,2) == "//") {
- var termSlash = actualPath.substring(2).indexOf("/") + 2;
- actualHost = actualPath.substring(0,termSlash);
- }
- assertEquals(assertID, host, actualHost);
- }
-
- if(file != null || name != null) {
- var actualFile = actualPath;
- var finalSlash = actualPath.lastIndexOf("/");
- if(finalSlash != -1) {
- actualFile = actualPath.substring(finalSlash+1);
- }
- if (file != null) {
- assertEquals(assertID, file, actualFile);
- }
- if (name != null) {
- var actualName = actualFile;
- var finalDot = actualFile.lastIndexOf(".");
- if (finalDot != -1) {
- actualName = actualName.substring(0, finalDot);
- }
- assertEquals(assertID, name, actualName);
- }
- }
-
- if(isAbsolute != null) {
- assertEquals(assertID, isAbsolute, actualPath.substring(0,1) == "/");
- }
- }
-
-
-// size() used by assertSize element
-function size(collection)
-{
- return collection.length;
-}
-
-function same(expected, actual)
-{
- return expected === actual;
-}
-
-function equalsAutoCase(context, expected, actual) {
- if (builder.contentType == "text/html") {
- if (context == "attribute") {
- return expected.toLowerCase() == actual;
- }
- return expected.toUpperCase() == actual;
- }
- return expected == actual;
-}
-
-function createTempURI(scheme) {
- if (scheme == "http") {
- return "http://localhost:8080/webdav/tmp" + Math.floor(Math.random() * 100000) + ".xml";
- }
- return "file:///tmp/domts" + Math.floor(Math.random() * 100000) + ".xml";
-}
-
-
-
-function EventMonitor() {
- this.atEvents = new Array();
- this.bubbledEvents = new Array();
- this.capturedEvents = new Array();
- this.allEvents = new Array();
-}
-
-EventMonitor.prototype.handleEvent = function(evt) {
- switch(evt.eventPhase) {
- case 1:
- monitor.capturedEvents[monitor.capturedEvents.length] = evt;
- break;
-
- case 2:
- monitor.atEvents[monitor.atEvents.length] = evt;
- break;
-
- case 3:
- monitor.bubbledEvents[monitor.bubbledEvents.length] = evt;
- break;
- }
- monitor.allEvents[monitor.allEvents.length] = evt;
-}
-
-function DOMErrorImpl(err) {
- this.severity = err.severity;
- this.message = err.message;
- this.type = err.type;
- this.relatedException = err.relatedException;
- this.relatedData = err.relatedData;
- this.location = err.location;
-}
-
-
-
-function DOMErrorMonitor() {
- this.allErrors = new Array();
-}
-
-DOMErrorMonitor.prototype.handleError = function(err) {
- errorMonitor.allErrors[errorMonitor.allErrors.length] = new DOMErrorImpl(err);
-}
-
-DOMErrorMonitor.prototype.assertLowerSeverity = function(id, severity) {
- var i;
- for (i = 0; i < this.allErrors.length; i++) {
- if (this.allErrors[i].severity >= severity) {
- assertEquals(id, severity - 1, this.allErrors[i].severity);
- }
- }
-}
-
-function UserDataNotification(operation, key, data, src, dst) {
- this.operation = operation;
- this.key = key;
- this.data = data;
- this.src = src;
- this.dst = dst;
-}
-
-function UserDataMonitor() {
- this.allNotifications = new Array();
-}
-
-UserDataMonitor.prototype.handle = function(operation, key, data, src, dst) {
- userDataMonitor.allNotifications[userDataMonitor.allNotifications.length] =
- new UserDataNotification(operation, key, data, src, dst);
-}
-
-
-
-function HTMLBuilder() {
- this.contentType = "text/html";
- this.supportedContentTypes = [ "text/html" ];
-
- this.supportsAsyncChange = false;
- this.async = false;
- this.fixedAttributeNames = [
- "validating", "expandEntityReferences", "coalescing",
- "signed", "hasNullString", "ignoringElementContentWhitespace", "namespaceAware", "ignoringComments", "schemaValidating"];
-
- this.fixedAttributeValues = [false, true, false, true, true , false, false, false, false ];
- this.configurableAttributeNames = [ ];
- this.configurableAttributeValues = [ ];
- this.initializationError = null;
- this.initializationFatalError = null;
- this.skipIncompatibleTests = true;
- this.documentURLs = new Array();
- this.documentVarnames = new Array();
-}
-
-HTMLBuilder.prototype.hasFeature = function(feature, version) {
- return document.implementation.hasFeature(feature, version);
-}
-
-HTMLBuilder.prototype.getImplementation = function() {
- return document.implementation;
-}
-
-HTMLBuilder.prototype.preload = function(frame, varname, url) {
- var i;
- this.documentVarnames[this.documentVarnames.length] = varname;
- this.documentURLs[this.documentURLs.length] = url;
- if (this.documentURLs.length > 1) {
- //
- // if all the urls are not the same
- //
- for (i = 1; i < this.documentURLs.length; i++) {
- if (this.documentURLs[i] != this.documentURLs[0]) {
- throw "Tests with multiple loads of different documents are not currently supported";
- }
- }
- }
- return 1;
-}
-
-HTMLBuilder.prototype.cloneNode = function(srcNode, doc) {
- var clone = null;
- switch(srcNode.nodeType) {
- //
- // element
- case 1:
- clone = doc.createElement(srcNode.nodeName.toLowerCase());
- var attrs = srcNode.attributes;
- for(var i = 0; i < attrs.length; i++) {
- var srcAttr = attrs.item(i);
- clone.setAttribute(srcAttr.nodeName, srcAttr.nodeValue);
- }
- var srcChild = srcNode.firstChild;
- while(srcChild != null) {
- var cloneChild = this.cloneNode(srcChild, doc);
- if (cloneChild != null) {
- clone.appendChild(cloneChild);
- }
- srcChild = srcChild.nextSibling;
- }
- break;
-
- case 3:
- clone = doc.createTextNode(srcNode.nodeValue);
- break;
-
- case 4:
- clone = doc.createCDATASection(srcNode.nodeValue);
- break;
-
- case 7:
- clone = doc.createProcessingInstruction(srcNode.nodeValue);
- break;
-
- case 8:
- clone = doc.createComment(srcNode.nodeValue);
- break;
- }
- return clone;
-
-}
-
-
-HTMLBuilder.prototype.load = function(frame, varname, url) {
- if (this.documentVarnames[0] == varname) {
- return document;
- }
- //
- //
- // not a perfect way to do this
- // Document.cloneNode is implementation dependent but exists in L1
- // and implemented in IE. The alternative brute force copy
- // only works in L2 or higher implementations and can't copy
- // entity and notation definitions, etc.
- var clone = null;
- try {
- clone = document.cloneNode(true);
- } catch(ex) {
- }
- if (clone == null) {
- clone = document.implementation.createDocument(
- document.documentElement.namespaceURI,
- document.documentElement.nodeName,
- null);
- //
- // Work-around since
- // Safari does not create document element
- // create document.
- if (clone.documentElement == null) {
- clone.appendChild(clone.createElement(document.documentElement.nodeName));
- }
- var attrs = document.documentElement.attributes;
- for(var i = 0; i < attrs.length; i++) {
- var srcAttr = attrs.item(i);
- clone.documentElement.setAttribute(srcAttr.nodeName, srcAttr.nodeValue);
- }
-
- var srcNode = document.firstChild;
- while(srcNode != null && srcNode.nodeType != 1) {
- if (srcNode.nodeType != 10) {
- var cloneNode = this.cloneNode(srcNode, clone);
- clone.insertBefore(cloneNode, clone.documentElement);
- }
- srcNode = srcNode.nextSibling;
- }
- srcNode = document.documentElement.nextSibling;
- while(srcNode != null) {
- var cloneNode = this.cloneNode(srcNode, clone);
- clone.appendChild(cloneNode);
- srcNode = srcNode.nextSibling;
- }
- srcNode = document.documentElement.firstChild;
- while(srcNode != null) {
- var cloneNode = this.cloneNode(srcNode, clone);
- if (cloneNode != null) {
- clone.documentElement.appendChild(cloneNode);
- }
- srcNode = srcNode.nextSibling;
- }
- }
- return clone;
-}
-
-HTMLBuilder.prototype.getImplementationAttribute = function(attr) {
- for (var i = 0; i < this.fixedAttributeNames.length; i++) {
- if (this.fixedAttributeNames[i] == attr) {
- return this.fixedAttributeValues[i];
- }
- }
- throw "Unrecognized implementation attribute: " + attr;
-}
-
-
-HTMLBuilder.prototype.setImplementationAttribute = function(attribute, value) {
- var supported = this.getImplementationAttribute(attribute);
- if (supported != value) {
- this.initializationError = "HTML loader does not support " + attribute + "=" + value;
- }
-}
-
-HTMLBuilder.prototype.canSetImplementationAttribute = function(attribute, value) {
- var supported = this.getImplementationAttribute(attribute);
- return (supported == value);
-}
-
-
-
-
-function createConfiguredBuilder() {
- return new HTMLBuilder();
-}
-
-function catchInitializationError(buildr, ex) {
- buildr.initializationError = ex;
- buildr.initializationFatalError = ex;
-}
-
-function toLowerArray(src) {
- var newArray = new Array();
- var i;
- for (i = 0; i < src.length; i++) {
- newArray[i] = src[i].toLowerCase();
- }
- return newArray;
-}
-
-
-function checkFeature(feature, version)
-{
- if (!builder.hasFeature(feature, version))
- {
- //
- // don't throw exception so that users can select to ignore the precondition
- //
- builder.initializationError = "builder does not support feature " + feature + " version " + version;
- }
-}
-
-function setResult(resultType, message) {
- var testName = getTargetURI();
- document.open();
- document.writeln("<html><head>");
- document.writeln("<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; CHARSET=utf-8'>");
- document.write("<title>");
- document.write(testName + ":" + resultType);
- document.write("</title></head><body><table width='100%' border='1' style='color:");
- if (resultType == null) {
- document.writeln("green'><tr><td>Test:</td><td>" + testName + "</td></tr><tr><td>Status:</td><td>Success</td></tr>");
- } else {
- if (resultType == "skip") {
- document.writeln("blue'><tr><td>Test:</td><td>" + testName + "</td></tr><tr><td>Status:</td><td>Skipped</td></tr>");
- } else {
- document.writeln("red'><tr><td>Test:</td><td>" + testName + "</td><td></tr><tr><td>Status:</td><td>" + resultType + "</td></tr>");
- }
- }
- if (message != null) {
- document.writeln("<tr><td>Detail:</td><td>" + message + "</td></tr>");
- }
- document.write("</table></body></html>");
- document.close();
- if (parent != window) {
- parent.setResult(testName, resultType, message);
- }
-}
-
-function checkInitialization(buildr, testname) {
- return buildr.initializationError;
-}
-
-function preload(docRef, varname, href) {
- return builder.preload(docRef, varname, href);
-}
-
-
-function load(docRef, varname, href) {
- return builder.load(docRef, varname, href);
-}
-
-
-function getImplementationAttribute(attr) {
- return builder.getImplementationAttribute(attr);
-}
-
-
-function setImplementationAttribute(attribute, value) {
- builder.setImplementationAttribute(attribute, value);
-}
-
-function createXPathEvaluator(doc) {
- try {
- return doc.getFeature("XPath", null);
- }
- catch(ex) {
- }
- return doc;
-}
-
-
-function getImplementation() {
- return builder.getImplementation();
-}
-
-function assertEquals(id, expected, actual) {
- var myActual;
- if (expected != actual) {
- myActual = actual;
- if (actual == null) {
- myActual = "null";
- }
- throw "failure:" + id + ": assertEquals failed, actual " + myActual + ", expected " + expected + ".";
- }
-}
-
-function assertNull(id, actual) {
- if (actual != null) {
- throw "failure:" + id + ": assertNull failed, actual " + actual;
- }
-}
-
-
-function assertTrue(id, actual) {
- if (!actual) {
- throw "failure:" + id + ": assertTrue failed";
- }
-}
-
-
-function assertFalse(id, actual) {
- if (actual) {
- throw "failure:" + id + ": assertTrue failed";
- }
-}
-
-function assertNotNull(id, actual) {
- if (actual == null) {
- throw "failure:" + id + ": assertNotNull failed";
- }
-}
-
-function fail(id) {
- throw "failure:" + id + ": fail";
-}
-
-
-
-function getSuffix(contentType) {
- switch(contentType) {
- case "text/xml":
- return ".xml";
-
- case "application/xhtml+xml":
- return ".xhtml";
-
- case "image/svg+xml":
- return ".svg";
-
- case "text/mathml":
- return ".mml";
- }
- return ".html";
-}
-
-
-function getResourceURI(name, scheme, contentType) {
- var base = document.documentURI;
- if (base == null) {
- base = "";
- } else {
- base = base.substring(0, base.lastIndexOf('/') + 1) + "files/";
- }
- return base + name + getSuffix(contentType);
-}
-
-
-
-function startTest() {
-
-//
-// WebKit modification: 18-August-2005
-//
-// Inform the test controller that this test has a text-format result and so should
-// be dumped as text, and also that the dump should not occur automatically.
-//
-if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
-}
-//
-// End WebKit modification
-//
-
- //
- // invoke test setup
- //
- setUpPage();
-
- try {
- runTest();
- if (builder.initializationError == null) {
- setResult(null, null);
- } else {
- setResult("skip", builder.initializationError);
- }
- } catch(ex) {
- if (typeof(ex.substring) != 'undefined' && ex.substring(0, 8) == "failure:") {
- setResult("failure", ex.substring(8));
- } else {
- setResult("error", ex);
- }
- }
-
-//
-// WebKit modification: 18-August-2005
-//
-// Inform the test controller that this test is complete, so it's time to dump.
-//
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
- }
-//
-// End WebKit modification
-//
-
-}
diff --git a/webkit/data/layout_tests/pending/dom/html/level2/html/w3c_main.png b/webkit/data/layout_tests/pending/dom/html/level2/html/w3c_main.png
deleted file mode 100644
index 139292ef..0000000
--- a/webkit/data/layout_tests/pending/dom/html/level2/html/w3c_main.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/canvas/README b/webkit/data/layout_tests/pending/fast/canvas/README
deleted file mode 100644
index 455bf9f..0000000
--- a/webkit/data/layout_tests/pending/fast/canvas/README
+++ /dev/null
@@ -1,4 +0,0 @@
-fillrect_gradient.html
-----------------------
-Added tests for stop positions starting after 0.0 and ending before 1.0,
-and for gradients with only one stop.
diff --git a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.checksum b/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.checksum
deleted file mode 100644
index 200046e..0000000
--- a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-f07a2050053ed4a7b23c419b808c939e \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.png b/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.png
deleted file mode 100644
index 54c3d36..0000000
--- a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.txt b/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.txt
deleted file mode 100644
index 0f67d01..0000000
--- a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient-expected.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 771x36
- text run at (0,0) width 771: "Each square canvas should contain a colored gradient bordered by a narrow white margin and a black line. The column on"
- text run at (0,18) width 457: "the left contains linear gradients, the column on the right radial gradients."
- RenderBR {BR} at (457,32) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,36) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,36) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,74) size 98x18
- text run at (104,74) width 98: " Green to white"
- RenderBR {BR} at (202,88) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,92) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,92) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,130) size 138x18
- text run at (104,130) width 138: " Green to white to red"
- RenderBR {BR} at (242,144) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,148) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,148) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,186) size 220x18
- text run at (104,186) width 220: " Larger green to white to larger red"
- RenderBR {BR} at (324,200) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,204) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,204) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,242) size 61x18
- text run at (104,242) width 61: " Solid red"
- RenderBR {BR} at (165,256) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,260) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,260) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,298) size 61x18
- text run at (104,298) width 61: " Solid red"
- RenderBR {BR} at (165,312) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,316) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,316) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,354) size 61x18
- text run at (104,354) width 61: " Solid red"
- RenderBR {BR} at (165,368) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,372) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,372) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,410) size 478x18
- text run at (104,410) width 478: " Blue to white in the top (inner) half, red to yellow in the bottom (outer) half"
- RenderBR {BR} at (582,424) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,428) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,428) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,466) size 301x18
- text run at (104,466) width 301: " Blue to white, red to yellow (same as previous)"
- RenderBR {BR} at (405,480) size 0x0
- RenderHTMLCanvas {CANVAS} at (0,484) size 52x52 [border: (1px solid #000000)]
- RenderHTMLCanvas {CANVAS} at (52,484) size 52x52 [border: (1px solid #000000)]
- RenderText {#text} at (104,522) size 301x18
- text run at (104,522) width 301: " Blue to white, red to yellow (same as previous)"
- RenderBR {BR} at (405,536) size 0x0
diff --git a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient.html b/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient.html
deleted file mode 100644
index a80c2fd..0000000
--- a/webkit/data/layout_tests/pending/fast/canvas/fillrect_gradient.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<body>
-<style type="text/css">
-canvas { border: 1px solid black; }
-</style>
-
-Each square canvas should contain a colored gradient bordered by a narrow white margin and a black line.
-The column on the left contains linear gradients, the column on the right radial gradients.<br>
-
-<script>
- var counter = 1;
- function Test(description, gradient) {
- // Create canvas elements
- var lin = document.createElement('canvas');
- lin.setAttribute('id', 'canvas' + counter + 'lin');
- lin.setAttribute('height', 50);
- lin.setAttribute('width', 50);
- var rad = document.createElement('canvas');
- rad.setAttribute('id', 'canvas' + counter + 'rad');
- rad.setAttribute('height', 50);
- rad.setAttribute('width', 50);
-
- document.body.appendChild(lin);
- document.body.appendChild(rad);
- document.body.appendChild(document.createTextNode(' ' + description));
- document.body.appendChild(document.createElement('br'));
-
- // Find canvas contexts
- var linctx = lin.getContext('2d')
- var radctx = rad.getContext('2d')
-
- // Create linear and radial gradients from array
- var lingrad = linctx.createLinearGradient(0, 0, 0, 50);
- var radgrad = linctx.createRadialGradient(25, 25, 0, 25, 25, 25);
- for (var i = 0; i < gradient.length - 1; i+=2) {
- lingrad.addColorStop(gradient[i], gradient[i + 1]);
- radgrad.addColorStop(gradient[i], gradient[i + 1]);
- }
-
- // Apply them
- linctx.fillStyle = lingrad;
- linctx.fillRect(2, 2, 46, 46);
- radctx.fillStyle = radgrad;
- radctx.fillRect(2, 2, 46, 46);
-
- counter++;
- }
-
- // Note: This test won't be as useful with many more cases added, since
- // they'll scroll below the pixel-test boundary.
-
- // Simple gradient
- Test('Green to white',
- new Array(0, '#0f0',
- 1, '#fff'));
-
- // Multiple sections
- Test('Green to white to red',
- new Array( 0, '#0f0',
- 0.5, '#fff',
- 1, '#f00'));
-
- // No stops at 0.0 or 1.0
- Test('Larger green to white to larger red',
- new Array(0.4, '#0f0',
- 0.5, '#fff',
- 0.6, '#f00'));
-
- // Only one stop, at zero
- Test('Solid red',
- new Array(0.0, '#f00'));
-
- // Only one stop, at 1.0
- Test('Solid red',
- new Array(1.0, '#f00'));
-
- // Only one stop, in the middle
- Test('Solid red',
- new Array(0.5, '#f00'));
-
- // Disjoint gradients (multiple stops at the same offset)
- Test('Blue to white in the top (inner) half, red to yellow in the bottom (outer) half',
- new Array( 0, '#00f',
- 0.5, '#fff',
- 0.5, '#f00',
- 1, '#ff0'));
-
- // Ignored stops
- Test('Blue to white, red to yellow (same as previous)',
- new Array(0, '#00f',
- 0.5, '#fff',
- 0.5, '#aaa',
- 0.5, '#abc',
- 0.5, '#f00',
- 1, '#ff0'));
-
- // Unsorted stops
- Test('Blue to white, red to yellow (same as previous)',
- new Array(0.5, '#fff',
- 0.5, '#aaa',
- 1, '#ff0',
- 0.5, '#abc',
- 0.5, '#f00',
- 0, '#00f'));
-</script>
-</body>
diff --git a/webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications-expected.txt b/webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications-expected.txt
deleted file mode 100644
index e0e49f4..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-This tests if modifications to document.implementation will be globally visible
-
---------
-Frame: 'framey'
---------
-true
diff --git a/webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications.html b/webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications.html
deleted file mode 100644
index a9138aa..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/DOMImplementation/singleton-modifications.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<html>
-<head>
-<script>
-function runTests() {
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.dumpChildFramesAsText();
- layoutTestController.waitUntilDone();
- }
-
- var framey = document.getElementById('framey');
- document.implementation.hasFeature = function() { return 'FAIL'; };
- framey.onload = function() {
- if (window.layoutTestController)
- layoutTestController.notifyDone();
- };
- framey.src = "data:text/html,<script>document.write(document.implementation.hasFeature('HTML', '1.0'));<"+"/script>";
-}
-</script>
-</head>
-<body onload="runTests();">
-This tests if modifications to document.implementation will be globally visible
-<iframe id="framey" />
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt b/webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt
deleted file mode 100644
index 81aba0a..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-CONSOLE MESSAGE: line 7: Uncaught Error: NOT_FOUND_ERR: DOM Exception 8
-This passes if it does not crash. (see https://bugs.webkit.org/show_bug.cgi?id=18958)
diff --git a/webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash.html b/webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash.html
deleted file mode 100644
index 0efda6f..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/NamedNodeMap-setNamedItem-crash.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<script>
- if (window.layoutTestController)
- layoutTestController.dumpAsText();
-
- onload = function()
- {
- document.body.attributes.setNamedItem(null);
- }
-</script>
-This passes if it does not crash. (see https://bugs.webkit.org/show_bug.cgi?id=18958)
diff --git a/webkit/data/layout_tests/pending/fast/dom/Window/README b/webkit/data/layout_tests/pending/fast/dom/Window/README
deleted file mode 100644
index 12949ad..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/Window/README
+++ /dev/null
@@ -1,2 +0,0 @@
-window-open-pending-url.html: new test
-
diff --git a/webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access-expected.txt b/webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access-expected.txt
deleted file mode 100644
index 8e9e62e..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This tests access to a window with an empty frame
-PASSPASSPASS
diff --git a/webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access.html b/webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access.html
deleted file mode 100644
index 865f358..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/Window/orphaned-frame-access.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
-<html>
-<head>
-<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
-<title>Wee!</title>
-<script>
-window.onload = function() {
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
- }
-
- var tag = document.getElementById('framey');
- var win = tag.contentWindow;
- // remove the element so the window has a null frame
- tag.parentNode.removeChild(tag);
- // schedule to run after the frame is null
- setTimeout(function() {
- document.body.appendChild(document.createTextNode(win.test || 'PASS'));
- document.body.appendChild(document.createTextNode(win[20] || 'PASS'));
- document.body.appendChild(document.createTextNode(win.Comment || 'PASS'));
- if (window.layoutTestController)
- layoutTestController.notifyDone();
- }, 0);
-};
-</script>
-</head>
-<body>
-This tests access to a window with an empty frame<br />
-<iframe id="framey" src="data:text/html,&lt;script&gt;window.test='FAIL';window[20]='FAIL';&lt;/script&gt;" />
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/dom/Window/resources/destination.html b/webkit/data/layout_tests/pending/fast/dom/Window/resources/destination.html
deleted file mode 100644
index 33d0269..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/Window/resources/destination.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<p>Hooray, you got here! That means the test succeeded!</p>
-<script>if (window.layoutTestController) layoutTestController.notifyDone();</script>
diff --git a/webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url-expected.txt b/webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url-expected.txt
deleted file mode 100644
index 2d2aa49..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-location: about:blank
-href: about:blank
-pathname: blank
-host:
-hostname:
-hash:
-port:
-protocol: about:
-search:
diff --git a/webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url.html b/webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url.html
deleted file mode 100644
index a7f1a6c..0000000
--- a/webkit/data/layout_tests/pending/fast/dom/Window/window-open-pending-url.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<script>
-if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.setCanOpenWindows();
- layoutTestController.waitUntilDone();
-}
-
-var popup = window.open('resources/destination.html');
-document.write('location: ' + popup.location + '<br/>');
-var props = ['href', 'pathname', 'host', 'hostname', 'hash', 'port',
- 'protocol', 'search'];
-for (var i = 0; i < props.length; ++i) {
- var prop = props[i];
- document.write(prop + ': ' + popup.location[prop] + '<br/>');
-}
-</script>
diff --git a/webkit/data/layout_tests/pending/fast/encoding/script-in-head-expected.txt b/webkit/data/layout_tests/pending/fast/encoding/script-in-head-expected.txt
deleted file mode 100644
index c29dde5..0000000
--- a/webkit/data/layout_tests/pending/fast/encoding/script-in-head-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Test for bug 12165: text encoding problem at jn.sapo.pt
-
-Should see a success message below.
-
-SUССЕSS
diff --git a/webkit/data/layout_tests/pending/fast/encoding/script-in-head.html b/webkit/data/layout_tests/pending/fast/encoding/script-in-head.html
deleted file mode 100644
index d6dc1ca..0000000
--- a/webkit/data/layout_tests/pending/fast/encoding/script-in-head.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!-- temp --><script language="JavaScript" type="text/JavaScript">
-if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
-}
-document.write ('<SCR' + 'IPT>' +
-
- 'setTimeout(function () {' +
- <!-- The letters CCE below are Cyrillic, so we do test that the encoding is correct. -->
- <!-- We also take an opportunity to test that this weirdly located script actually executes. -->
- 'document.getElementById("result").innerHTML="SUóóåSS";' +
- 'if (window.layoutTestController)' +
- 'layoutTestController.notifyDone();' +
- '}, 0);' +
-'</SCR' + 'IPT>');document.close(); </script>
-<!-- /temp --><!--HEADER-->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
-</head>
-<body>
-<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12165">bug 12165</a>:
-text encoding problem at jn.sapo.pt</p>
-<p>Should see a success message below.</p>
-<div id="result"></div>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.checksum b/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.checksum
deleted file mode 100644
index 9d44e19..0000000
--- a/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-0fb025b7a0f282242c6b6d7a672cacb7 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.png b/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.png
deleted file mode 100644
index ac23372..0000000
--- a/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.txt b/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.txt
deleted file mode 100644
index 348ac82..0000000
--- a/webkit/data/layout_tests/pending/fast/events/autoscroll-expected.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-layer at (0,0) size 785x3163
- RenderView at (0,0) size 785x600
-layer at (0,0) size 785x3163
- RenderBlock {HTML} at (0,0) size 785x3163
- RenderBody {BODY} at (8,8) size 769x3139
- RenderBlock {P} at (0,0) size 769x18
- RenderText {#text} at (0,0) size 53x18
- text run at (0,0) width 53: "Test for "
- RenderInline {A} at (0,0) size 68x18 [color=#0000EE]
- RenderText {#text} at (53,0) size 68x18
- text run at (53,0) width 68: "bug 12331"
- RenderText {#text} at (121,0) size 4x18
- text run at (121,0) width 4: "."
- RenderBlock {P} at (0,34) size 769x36
- RenderText {#text} at (0,0) size 739x36
- text run at (0,0) width 739: "To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll"
- text run at (0,18) width 117: "back up to the top."
- RenderBlock {DIV} at (0,86) size 769x3000
- RenderBlock (anonymous) at (0,3086) size 769x19
- RenderTextControl {INPUT} at (0,0) size 130x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {P} at (0,3121) size 769x18
- RenderText {#text} at (0,0) size 404x18
- text run at (0,0) width 404: "If the bug does not occur, you'll be left down here at the bottom."
-layer at (10,3097) size 126x13 scrollWidth 127
- RenderBlock {DIV} at (2,3) size 126x13
- RenderText {#text} at (1,0) size 125x13
- text run at (1,0) width 125: "select some of this text"
-selection start: position 2 of child 0 {#text} of child 0 {DIV} of child 7 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
-selection end: position 17 of child 0 {#text} of child 0 {DIV} of child 7 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
-scrolled to 0,2563
diff --git a/webkit/data/layout_tests/pending/fast/events/autoscroll.html b/webkit/data/layout_tests/pending/fast/events/autoscroll.html
deleted file mode 100644
index 3334916..0000000
--- a/webkit/data/layout_tests/pending/fast/events/autoscroll.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>
- <head>
- <script>
- function test()
- {
- if (window.layoutTestController) {
- layoutTestController.waitUntilDone();
- setTimeout(autoscrollTestPart1, 0);
- }
- }
- function autoscrollTestPart1()
- {
- var ta = document.getElementById('ta');
- if (window.eventSender) {
- ta.scrollIntoView();
- var h = ta.offsetTop - document.body.scrollTop + 10;
- eventSender.dragMode = false;
- eventSender.mouseMoveTo(20, h);
- eventSender.mouseDown();
- eventSender.mouseMoveTo(20, h);
- eventSender.mouseMoveTo(100, h);
- }
- setTimeout(autoscrollTestPart2, 100);
- }
- function autoscrollTestPart2()
- {
- if (window.eventSender)
- eventSender.mouseUp();
- if (window.layoutTestController)
- layoutTestController.notifyDone();
- }
- function log(msg)
- {
- var res = document.getElementById('res');
- res.innerHTML = res.innerHTML + msg + "<br>";
- }
- </script>
- </head>
- <body onload="test()">
- <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12331">bug 12331</a>.</p>
- <p>To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll back up to the top.</p>
- <div style="height:3000px"></div>
- <input id="ta" value="select some of this text"></input>
- <p>If the bug does not occur, you'll be left down here at the bottom.</p>
- </body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame1.html b/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame1.html
deleted file mode 100644
index 4233bd8..0000000
--- a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame1.html
+++ /dev/null
@@ -1,174 +0,0 @@
-<body id="frame1body" tabindex="0">
-
-<!--anchor types-->
-<a href="#" tabindex="-1" id="a1">anchor</a><br>
-<img src ="abe.png" width="76" height="103" alt="honest abe" usemap ="#theMapName" />
-<map name="theMapName" id="map1">
- <area shape ="rect" coords ="0,0,76,50" href="#" target ="_blank" alt="rectArea1" tabindex="1" id="area1a"/>
- <area shape ="rect" coords ="0,50,76,103" href="#" target ="_blank" alt="rectArea2" tabindex="0" id="area1b"/>
-</map><br>
-
-<!--media elements-->
-<div id="div1a" tabindex="-1">
-<audio controls src="../../../media/content/test.wav" id="audio1"></audio><br>
-<video controls tabindex="2" id="video1">
- <source src="../../../media/content/test.mp4" type="video/mpeg" id="source1">
-</video><br>
-</div>
-
-<!--embedded elements-->
-applet:<br>
-<applet width="100" height="100" code="" tabindex="-1" id="applet1"></applet><br>
-object:<br>
-<object type="application/x-webkit-test-netscape" width="100" height="100" id="object1"></object><br>
-embed:<br>
-<embed type="application/x-webkit-test-netscape" width="100" height="100" tabindex="3" id="embed1"></embed><br>
-
-<!--presentation-related elements-->
-<div id="div1b" tabindex="0">
-<abbr title="the tooltip" tabindex="-1" id="abbr1">abbr makes a tooltip</abbr><br>
-<acronym title="the tooltip" id="acronym1">acronym makes a tooltip</acronym><br>
-<bdo dir="rtl" tabindex="3" id="bdo1">text going right-to-left</bdo><br>
-a blockquote:<blockquote tabindex="0" id="blockquote1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis eu nisi. Fusce aliquet massa non felis. Sed consectetuer. In hac habitasse platea dictumst. Nunc vitae nulla. Quisque tristique sollicitudin libero.</blockquote>
-a short quote:<q tabindex="-1" id="q1">Veni, Vidi, Vici</q>
-<p id="p1">paragraph</p>
-line break:<br tabindex="2" id="br1">
-horizontal rule:<hr tabindex="0" id="hr1">
-<marquee tabindex="-1" id="marquee1">marquee text</marquee>
-<center id="center1">centered text</center>
-</div>
-
-<!--font style tags-->
-<b tabindex="1" id="b1">Bold text</b><br>
-<big tabindex="0" id="big1">Big text</big><br>
-<i tabindex="-1" id="i1">Italic text</i><br>
-<small id="small1">Small text</small><br>
-<tt tabindex="1" id="tt1">Teletype text</tt><br>
-
-<!--canvas element-->
-<div id="div1c" tabindex="0">
-canvas:<br>
-<canvas width='200' height='100' tabindex="-1" id="canvas1"></canvas><br>
-</div>
-
-<!--Phrase elements-->
-<em id="em1">em</em><br>
-<strong tabindex="2" id="strong1">strong</strong><br>
-<dfn tabindex="0" id="dfn1">dfn</dfn><br>
-<code tabindex="-1" id="code1">code</code><br>
-<samp id="samp1">samp</samp><br>
-<kbd tabindex="3" id="kbd1">kbd</kbd><br>
-<var tabindex="0" id="var1">var</var><br>
-<cite tabindex="-1" id="cite1">cite</cite><br>
-
-<!--heading tags-->
-<div id="div1d">
-<h1 tabindex="3" id="h1_1">Heading 1</h1>
-<h2 tabindex="0" id="h2_1">Heading 2</h2>
-<h3 tabindex="-1" id="h3_1">Heading 3</h3>
-<h4 id="h4_1">Heading 4</h4>
-<h5 tabindex="2" id="h5_1">Heading 5</h5>
-<h6 tabindex="0" id="h6_1">Heading 6</h6>
-</div>
-
-<!--other style-related tags-->
-<s tabindex="-1" id="s1">strikethrough (sTag)</s><br>
-<strike id="strike1">strikethrough (strikeTag)</strike><br>
-<sub tabindex="1" id="sub1">subscript</sub><br>
-<sup tabindex="0" id="sup1">superscript</sup><br>
-<u tabindex="-1" id="u1">underlined</u><br>
-<del id="del1">delete</del><br>
-<ins tabindex="1" id="ins1">insert</ins><br>
-<pre tabindex="0" id="pre1">preformatted</pre>
-basic usage of <font tabindex="-1" id="font1">font</font> tag<br>
-basic usage of <span id="span1">span</span> tag<br>
-
-<!--tables-->
-<div id="div1e" tabindex="2">
-<table border="1" tabindex="0" id="table1">
-<caption tabindex="-1" id="caption1">table caption</caption>
-<colgroup span="2" id="colgroup1">
-<col width="100" tabindex="3" id="col1a"></col>
-<col width="250" tabindex="0" id="col1b"></col>
-</colgroup>
-<thead tabindex="-1" id="thead1"><tr><th id="th1">
-table header
-</th></tr></thead><tbody tabindex="3" id="tbody1">
-<tr tabindex="0" id="tr1">
-<td tabindex="-1" id="td1a">table cell 1</td>
-<td id="td1b">table cell 2</td>
-<td tabindex="2" id="td1c">table cell 3</td>
-</tr></tbody>
-<tfoot tabindex="0" id="tfoot1"><tr><td>
-table footer
-</td></tr></tfoot>
-</table>
-</div>
-
-<!--definition list-->
-<dl tabindex="-1" id="dl1">definition list
-<dt id="dt1a">term1</dt>
-<dd tabindex="1" id="dd1a">definition1</dd>
-<dt tabindex="0" id="dt1b">term2</dt>
-<dd tabindex="-1" id="dd1b">definition2</dd>
-</dl>
-
-<!--lists -->
-<div id="div1f">
-<ul tabindex="1" id="ul1">unordered list
-<li tabindex="0" id="li1a"> ul li
-</ul>
-<ol tabindex="-1" id="ol1">ordered list
-<li id="li1b"> ol li
-</ol>
-<menu tabindex="2" id="menu1">menu list
-<li tabindex="0" id="li1c"> menu li
-</menu>
-<dir tabindex="-1" id="dir1">directory list
-<li id="li1d"> dir li
-</dir>
-</div>
-
-<!--images-->
-<image src="abe.png" tabindex="3" id="image1"><br>
-<img src="abe.png" tabindex="0" id="img1"><br>
-
-<!--forms-->
-<div id="div1g" tabindex="-1">
-<form id="form1">
-<fieldset tabindex="3" id="fieldset1">
- <legend id="legend1" tabindex="0">legend1</legend>
-</fieldset>
-<select id="select1">
- <optgroup label="group1" tabindex="2" id="optgroup1">
- <option tabindex="0" id="option1a">option1</option>
- <option>option2</option>
- </optgroup>
- <optgroup label="group2">
- <option>option3</option>
- <option tabindex="-1" id="option1b">option4</option>
- </optgroup>
-</select><br>
-<textarea id="textarea1">textarea1</textarea><br>
-<input type="text" id="text1" value="text1" tabindex="1"><br>
-<isindex id="isindex1" prompt="isindex1" tabindex="0"/><br>
-<input type="checkbox" id="checkbox1"><br>
-<input type="radio" id="radioChoice1a" name="radio1" tabindex="0"><br>
-<label id="label1" tabindex="-1"><input type="radio" name="radio1">label for radioChoice B</label><br>
-<input type="file" id="file1" tabindex="2"><br>
-input type="hidden"<input type="hidden" id="hidden1" tabindex="-1"><br>
-input type="image"<input type="image" id="inputImage1" src="abe.png" tabindex="3"><br>
-<button id="button1" tabindex="0">button1</button><br>
-<input type="button" id="inputButton1" value="inputButton1" tabindex="-1"><br>
-<input type="search" id="search1" placeholder="search1"><br>
-<input type="password" id="password1" tabindex="-1"><br>
-<input type="range" id="range1" tabindex="3"><br>
-<input type="submit" id="submit1" tabindex="0">
-<input type="reset" id="reset1" tabindex="-1"><br>
-</form>
-</div>
-
-<iframe width="100%" height="75%" src="tabindex-focus-blur-all-iframe1.html" id="iframe1a" tabindex="-1"></iframe>
-<iframe src="tabindex-focus-blur-all-frame3.html" id="iframe1b"></iframe>
-
-</body>
diff --git a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame2.html b/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame2.html
deleted file mode 100644
index 4f71f25..0000000
--- a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame2.html
+++ /dev/null
@@ -1,176 +0,0 @@
-<body id="frame2body">
-
-<!--anchor types-->
-<a href="#" tabindex="1" id="a3">anchor</a><br>
-<img src ="abe.png" width="76" height="103" alt="honest abe" usemap ="#theMapName" />
-<map name="theMapName" tabindex="0" id="map3">
- <area shape ="rect" coords ="0,0,76,50" href="#" target ="_blank" alt="rectArea1" tabindex="-1" id="area3a"/>
- <area shape ="rect" coords ="0,50,76,103" href="#" target ="_blank" alt="rectArea3" id="area3b"/>
-</map><br>
-
-<!--media elements-->
-<div id="div3a" tabindex="1">
-<audio controls src="../../../media/content/test.wav" tabindex="0" id="audio3"></audio><br>
-<video controls tabindex="-1" id="video3">
- <source src="../../../media/content/test.mp4" type="video/mpeg" id="source3">
-</video><br>
-</div>
-
-<!--embedded elements-->
-applet:<br>
-<applet width="100" height="100" code="" tabindex="2" id="applet3"></applet><br>
-object:<br>
-<object type="application/x-webkit-test-netscape" width="100" height="100" tabindex="0" id="object3"></object><br>
-embed:<br>
-<embed type="application/x-webkit-test-netscape" width="100" height="100" tabindex="-1" id="embed3"></embed><br>
-
-<!--presentation-related elements-->
-<div id="div3b">
-<abbr title="the tooltip" tabindex="3" id="abbr3">abbr makes a tooltip</abbr><br>
-<acronym title="the tooltip" tabindex="0" id="acronym3">acronym makes a tooltip</acronym><br>
-<bdo dir="rtl" tabindex="-1" id="bdo3">text going right-to-left</bdo><br>
-a blockquote:<blockquote id="blockquote3">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis eu nisi. Fusce aliquet massa non felis. Sed consectetuer. In hac habitasse platea dictumst. Nunc vitae nulla. Quisque tristique sollicitudin libero.</blockquote>
-a short quote:<q tabindex="3" id="q3">Veni, Vidi, Vici</q>
-<p tabindex="0" id="p3">paragraph</p>
-line break:<br tabindex="-1" id="br3">
-horizontal rule:<hr id="hr3">
-<marquee tabindex="2" id="marquee3">marquee text</marquee>
-<center tabindex="0" id="center3">centered text</center>
-</div>
-
-<!--font style tags-->
-<b tabindex="-1" id="b3">Bold text</b><br>
-<big id="big3">Big text</big><br>
-<i tabindex="2" id="i3">Italic text</i><br>
-<small tabindex="0" id="small3">Small text</small><br>
-<tt tabindex="-1" id="tt3">Teletype text</tt><br>
-
-<!--canvas element-->
-<div id="div3c">
-canvas:<br>
-<canvas width='200' height='100' tabindex="3" id="canvas3"></canvas><br>
-</div>
-
-<!--Phrase elements-->
-<em tabindex="0" id="em3">em</em><br>
-<strong tabindex="-1" id="strong3">strong</strong><br>
-<dfn id="dfn3">dfn</dfn><br>
-<code tabindex="2" id="code3">code</code><br>
-<samp tabindex="0" id="samp3">samp</samp><br>
-<kbd tabindex="-1" id="kbd3">kbd</kbd><br>
-<var id="var3">var</var><br>
-<cite tabindex="3" id="cite3">cite</cite><br>
-
-<!--heading tags-->
-<div id="div3d" tabindex="0">
-<h1 tabindex="-1" id="h1_3">Heading 1</h1>
-<h2 id="h2_3">Heading 2</h2>
-<h3 tabindex="3" id="h3_3">Heading 3</h3>
-<h4 tabindex="0" id="h4_3">Heading 4</h4>
-<h5 tabindex="-1" id="h5_3">Heading 5</h5>
-<h6 id="h6_3">Heading 6</h6>
-</div>
-
-<!--other style-related tags-->
-<s tabindex="2" id="s3">strikethrough (sTag)</s><br>
-<strike tabindex="0" id="strike3">strikethrough (strikeTag)</strike><br>
-<sub tabindex="-1" id="sub3">subscript</sub><br>
-<sup id="sup3">superscript</sup><br>
-<u tabindex="3" id="u3">underlined</u><br>
-<del tabindex="0" id="del3">delete</del><br>
-<ins tabindex="-1" id="ins3">insert</ins><br>
-<pre id="pre3">preformatted</pre>
-basic usage of <font tabindex="2" id="font3">font</font> tag<br>
-basic usage of <span tabindex="0" id="span3">span</span> tag<br>
-
-<!--tables-->
-<div id="div3e" tabindex="2">
-<table border="1" id="table3">
-<caption tabindex="3" id="caption3">table caption</caption>
-<colgroup span="3" tabindex="0" id="colgroup3">
-<col width="100" tabindex="-1" id="col3a"></col>
-<col width="250" id="col3b"></col>
-</colgroup>
-<thead tabindex="3" id="thead3"><tr><th tabindex="0" id="th3">
-table header
-</th></tr></thead><tbody tabindex="-1" id="tbody3">
-<tr id="tr3">
-<td tabindex="2" id="td3a">table cell 1</td>
-<td tabindex="0" id="td3b">table cell 2</td>
-<td tabindex="-1" id="td3c">table cell 3</td>
-</tr></tbody>
-<tfoot id="tfoot3"><tr><td>
-table footer
-</td></tr></tfoot>
-</table>
-</div>
-
-<!--definition list-->
-<dl tabindex="1" id="dl3">definition list
-<dt tabindex="0" id="dt3a">term1</dt>
-<dd tabindex="-1" id="dd3a">definition1</dd>
-<dt id="dt3b">term2</dt>
-<dd tabindex="1" id="dd3b">definition2</dd>
-</dl>
-
-<!--lists -->
-<div id="div3f" tabindex="0">
-<ul tabindex="-1" id="ul3">unordered list
-<li id="li3a"> ul li
-</ul>
-<ol tabindex="2" id="ol3">ordered list
-<li tabindex="0" id="li3b"> ol li
-</ol>
-<menu tabindex="-1" id="menu3">menu list
-<li id="li3c"> menu li
-</menu>
-<dir tabindex="3" id="dir3">directory list
-<li tabindex="0" id="li3d"> dir li
-</dir>
-</div>
-
-<!--images-->
-<image src="abe.png" tabindex="-1" id="image3"><br>
-<img src="abe.png" id="img3"><br>
-
-<!--forms-->
-<div id="div3g" tabindex="3">
-<form tabindex="0" id="form3">
-<fieldset tabindex="-1" id="fieldset3">
- <legend id="legend3">legend1</legend>
-</fieldset>
-<select id="select3" tabindex="0">
- <optgroup label="group1" tabindex="-1" id="optgroup3">
- <option id="option3a">option1</option>
- <option>option2</option>
- </optgroup>
- <optgroup label="group3">
- <option>option3</option>
- <option tabindex="1" id="option3b">option4</option>
- </optgroup>
-</select><br>
-<textarea id="textarea3" tabindex="0">textarea</textarea><br>
-<input type="text" id="text3" value="text" tabindex="-1"><br>
-<isindex id="isindex3" prompt="isindex"/><br>
-<input type="checkbox" id="checkbox3" tabindex="0"><br>
-<input type="radio" id="radioChoice3a" name="radio3"><br>
-<label id="label3" tabindex="2"><input type="radio" name="radio3" tabindex="0">label for radio button</label><br>
-<input type="file" id="file3" tabindex="-1"><br>
-input type="hidden"<input type="hidden" id="hidden3" tabindex="3"><br>
-input type="image"<input type="image" id="inputImage3" src="abe.png" tabindex="-1"><br>
-<button id="button3">button</button><br>
-<input type="button" id="inputButton3" value="inputButton" tabindex="3"><br>
-<input type="search" id="search3" placeholder="search" tabindex="0"><br>
-<input type="password" id="password3" tabindex="2"><br>
-<input type="range" id="range3" tabindex="-1"><br>
-<input type="submit" id="submit3">
-<input type="reset" id="reset3" tabindex="2"><br>
-</form>
-</div>
-
-<iframe width="100%" height="75%" src="tabindex-focus-blur-all-iframe2.html" id="iframe2a" tabindex="0"></iframe>
-<iframe src="tabindex-focus-blur-all-frame3.html" id="iframe2b" tabindex="1"></iframe>
-
-<input class="homebase">
-
-</body>
diff --git a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame3.html b/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame3.html
deleted file mode 100644
index 6e0c7e0..0000000
--- a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-frame3.html
+++ /dev/null
@@ -1 +0,0 @@
-<div id='theConsole'></div>
diff --git a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe1.html b/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe1.html
deleted file mode 100644
index 507bd88..0000000
--- a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe1.html
+++ /dev/null
@@ -1,171 +0,0 @@
-<body id="iframe1body" tabindex="-1">
-
-<!--anchor types-->
-<a href="#" id="a2">anchor</a><br>
-<img src ="abe.png" width="76" height="103" alt="honest abe" usemap ="#theMapName" />
-<map name="theMapName" tabindex="2" id="map2">
- <area shape ="rect" coords ="0,0,76,50" href="#" target ="_blank" alt="rectArea1" tabindex="0" id="area2a"/>
- <area shape ="rect" coords ="0,50,76,103" href="#" target ="_blank" alt="rectArea2" tabindex="-1" id="area2b"/>
-</map><br>
-
-<!--media elements-->
-<div id="div2a">
-<audio controls src="../../../media/content/test.wav" tabindex="3" id="audio2"></audio><br>
-<video controls tabindex="0" id="video2">
- <source src="../../../media/content/test.mp4" type="video/mpeg" id="source2">
-</video><br>
-</div>
-
-<!--embedded elements-->
-applet:<br>
-<applet width="100" height="100" code="" id="applet2"></applet><br>
-object:<br>
-<object type="application/x-webkit-test-netscape" width="100" height="100" tabindex="3" id="object2"></object><br>
-embed:<br>
-<embed type="application/x-webkit-test-netscape" width="100" height="100" tabindex="0" id="embed2"></embed><br>
-
-<!--presentation-related elements-->
-<div id="div2b" tabindex="-1">
-<abbr title="the tooltip" id="abbr2">abbr makes a tooltip</abbr><br>
-<acronym title="the tooltip" tabindex="2" id="acronym2">acronym makes a tooltip</acronym><br>
-<bdo dir="rtl" tabindex="0" id="bdo2">text going right-to-left</bdo><br>
-a blockquote:<blockquote tabindex="-1" id="blockquote2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis eu nisi. Fusce aliquet massa non felis. Sed consectetuer. In hac habitasse platea dictumst. Nunc vitae nulla. Quisque tristique sollicitudin libero.</blockquote>
-a short quote:<q id="q2">Veni, Vidi, Vici</q>
-<p tabindex="3" id="p2">paragraph</p>
-line break:<br tabindex="0" id="br2">
-horizontal rule:<hr tabindex="-1" id="hr2">
-<marquee id="marquee2">marquee text</marquee>
-<center tabindex="3" id="center2">centered text</center>
-</div>
-
-<!--font style tags-->
-<b tabindex="0" id="b2">Bold text</b><br>
-<big tabindex="-1" id="big2">Big text</big><br>
-<i id="i2">Italic text</i><br>
-<small tabindex="2" id="small2">Small text</small><br>
-<tt tabindex="0" id="tt2">Teletype text</tt><br>
-
-<!--canvas element-->
-<div id="div2c" tabindex="-1">
-canvas:<br>
-<canvas width='200' height='100' id="canvas2"></canvas><br>
-</div>
-
-<!--Phrase elements-->
-<em tabindex="2" id="em2">em</em><br>
-<strong tabindex="0" id="strong2">strong</strong><br>
-<dfn tabindex="-1" id="dfn2">dfn</dfn><br>
-<code id="code2">code</code><br>
-<samp tabindex="1" id="samp2">samp</samp><br>
-<kbd tabindex="0" id="kbd2">kbd</kbd><br>
-<var tabindex="-1" id="var2">var</var><br>
-<cite id="cite2">cite</cite><br>
-
-<!--heading tags-->
-<div id="div2d" tabindex="2">
-<h1 tabindex="0" id="h1_2">Heading 1</h1>
-<h2 tabindex="-1" id="h2_2">Heading 2</h2>
-<h3 id="h3_2">Heading 3</h3>
-<h4 tabindex="3" id="h4_2">Heading 4</h4>
-<h5 tabindex="0" id="h5_2">Heading 5</h5>
-<h6 tabindex="-1" id="h6_2">Heading 6</h6>
-</div>
-
-<!--other style-related tags-->
-<s id="s2">strikethrough (sTag)</s><br>
-<strike tabindex="3" id="strike2">strikethrough (strikeTag)</strike><br>
-<sub tabindex="0" id="sub2">subscript</sub><br>
-<sup tabindex="-1" id="sup2">superscript</sup><br>
-<u id="u2">underlined</u><br>
-<del tabindex="2" id="del2">delete</del><br>
-<ins tabindex="0" id="ins2">insert</ins><br>
-<pre tabindex="-1" id="pre2">preformatted</pre>
-basic usage of <font id="font2">font</font> tag<br>
-basic usage of <span tabindex="2" id="span2">span</span> tag<br>
-
-<!--tables-->
-<div id="div2e" tabindex="0">
-<table border="1" tabindex="-1" id="table2">
-<caption id="caption2">table caption</caption>
-<colgroup span="2" tabindex="2" id="colgroup2">
-<col width="100" tabindex="0" id="col2a"></col>
-<col width="250" tabindex="-1" id="col2b"></col>
-</colgroup>
-<thead id="thead2"><tr><th tabindex="2" id="th2">
-table header
-</th></tr></thead><tbody tabindex="0" id="tbody2">
-<tr tabindex="-1" id="tr2">
-<td id="td2a">table cell 1</td>
-<td tabindex="3" id="td2b">table cell 2</td>
-<td tabindex="0" id="td2c">table cell 3</td>
-</tr></tbody>
-<tfoot tabindex="-1" id="tfoot2"><tr><td>
-table footer
-</td></tr></tfoot>
-</table>
-</div>
-
-<!--definition list-->
-<dl id="dl2">definition list
-<dt tabindex="3" id="dt2a">term1</dt>
-<dd tabindex="0" id="dd2a">definition1</dd>
-<dt tabindex="-1" id="dt2b">term2</dt>
-<dd id="dd2b">definition2</dd>
-</dl>
-
-<!--lists -->
-<div id="div2f" tabindex="2">
-<ul tabindex="0" id="ul2">unordered list
-<li tabindex="-1" id="li2a"> ul li
-</ul>
-<ol id="ol2">ordered list
-<li tabindex="3" id="li2b"> ol li
-</ol>
-<menu tabindex="0" id="menu2">menu list
-<li tabindex="-1" id="li2c"> menu li
-</menu>
-<dir id="dir2">directory list
-<li tabindex="3" id="li2d"> dir li
-</dir>
-</div>
-
-<!--images-->
-<image src="abe.png" tabindex="0" id="image2"><br>
-<img src="abe.png" tabindex="-1" id="img2"><br>
-
-<!--forms-->
-<div id="div2g">
-<form tabindex="2" id="form2">
-<fieldset tabindex="0" id="fieldset2">
- <legend id="legend2" tabindex="-1">legend</legend>
-</fieldset>
-<select id="select2" tabindex="3">
- <optgroup label="group1" tabindex="0" id="optgroup2">
- <option tabindex="-1" id="option2a">option1</option>
- <option>option2</option>
- </optgroup>
- <optgroup label="group2">
- <option>option3</option>
- <option id="option2b">option4</option>
- </optgroup>
-</select><br>
-<textarea id="textarea2" tabindex="3">textarea</textarea><br>
-<input type="text" id="text2" value="text" tabindex="0"><br>
-<isindex id="isindex2" prompt="isindex" tabindex="-1"/><br>
-<input type="checkbox" id="checkbox2" tabindex="2"><br>
-<input type="radio" id="radioChoice2a" name="radio2" tabindex="-1"><br>
-<label id="label2"><input type="radio" name="radio2" tabindex="2">label for radio button</label><br>
-<input type="file" id="file2" tabindex="0"><br>
-input type="hidden"<input type="hidden" id="hidden2"><br>
-input type="image"<input type="image" id="inputImage2" src="abe.png" tabindex="0"><br>
-<button id="button2" tabindex="-1">button</button><br>
-<input type="button" id="inputButton2" value="inputButton"><br>
-<input type="search" id="search2" placeholder="search" tabindex="2"><br>
-<input type="password" id="password2"><br>
-<input type="range" id="range2" tabindex="0"><br>
-<input type="submit" id="submit2" tabindex="-1">
-<input type="reset" id="reset2"><br>
-</form>
-</div>
-
-</body>
diff --git a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe2.html b/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe2.html
deleted file mode 100644
index ae38e9b..0000000
--- a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all-iframe2.html
+++ /dev/null
@@ -1,172 +0,0 @@
-<body id="iframe2body" tabindex="1" onblur="parent.parent.stopTest=true;">
-
-<!--anchor types-->
-<a href="#" tabindex="0" id="a4">anchor</a><br>
-<img src ="abe.png" width="76" height="103" alt="honest abe" usemap ="#theMapName" />
-<map name="theMapName" tabindex="-1" id="map4">
- <area shape ="rect" coords ="0,0,76,50" href="#" target ="_blank" alt="rectArea1" id="area4a"/>
- <area shape ="rect" coords ="0,50,76,103" href="#" target ="_blank" alt="rectArea2" tabindex="1" id="area4b"/>
-</map><br>
-
-<!--media elements-->
-<div id="div4a" tabindex="0">
-<audio controls src="../../../media/content/test.wav" tabindex="-1" id="audio4"></audio><br>
-<video controls id="video4">
- <source src="../../../media/content/test.mp4" type="video/mpeg" id="source4">
-</video><br>
-</div>
-
-<!--embedded elements-->
-applet:<br>
-<applet width="100" height="100" code="" tabindex="0" id="applet4"></applet><br>
-object:<br>
-<object type="application/x-webkit-test-netscape" width="100" height="100" tabindex="-1" id="object4"></object><br>
-embed:<br>
-<embed type="application/x-webkit-test-netscape" width="100" height="100" id="embed4"></embed><br>
-
-<!--presentation-related elements-->
-<div id="div4b" tabindex="3">
-<abbr title="the tooltip" tabindex="0" id="abbr4">abbr makes a tooltip</abbr><br>
-<acronym title="the tooltip" tabindex="-1" id="acronym4">acronym makes a tooltip</acronym><br>
-<bdo dir="rtl" id="bdo4">text going right-to-left</bdo><br>
-a blockquote:<blockquote tabindex="3" id="blockquote4">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis eu nisi. Fusce aliquet massa non felis. Sed consectetuer. In hac habitasse platea dictumst. Nunc vitae nulla. Quisque tristique sollicitudin libero.</blockquote>
-a short quote:<q tabindex="0" id="q4">Veni, Vidi, Vici</q>
-<p tabindex="-1" id="p4">paragraph</p>
-line break:<br id="br4">
-horizontal rule:<hr tabindex="2" id="hr4">
-<marquee tabindex="0" id="marquee4">marquee text</marquee>
-<center tabindex="-1" id="center4">centered text</center>
-</div>
-
-<!--font style tags-->
-<b id="b4">Bold text</b><br>
-<big tabindex="1" id="big4">Big text</big><br>
-<i tabindex="0" id="i4">Italic text</i><br>
-<small tabindex="-1" id="small4">Small text</small><br>
-<tt id="tt4">Teletype text</tt><br>
-
-<!--canvas element-->
-<div id="div4c" tabindex="1">
-canvas:<br>
-<canvas width='200' height='100' tabindex="0" id="canvas4"></canvas><br>
-</div>
-
-<!--Phrase elements-->
-<em tabindex="-1" id="em4">em</em><br>
-<strong id="strong4">strong</strong><br>
-<dfn tabindex="2" id="dfn4">dfn</dfn><br>
-<code tabindex="0" id="code4">code</code><br>
-<samp tabindex="-1" id="samp4">samp</samp><br>
-<kbd id="kbd4">kbd</kbd><br>
-<var tabindex="3" id="var4">var</var><br>
-<cite tabindex="0" id="cite4">cite</cite><br>
-
-<!--heading tags-->
-<div id="div4d" tabindex="-1">
-<h1 id="h1_4">Heading 1</h1>
-<h2 tabindex="3" id="h2_4">Heading 2</h2>
-<h3 tabindex="0" id="h3_4">Heading 3</h3>
-<h4 tabindex="-1" id="h4_4">Heading 4</h4>
-<h5 id="h5_4">Heading 5</h5>
-<h6 tabindex="2" id="h6_4">Heading 6</h6>
-</div>
-
-<!--other style-related tags-->
-<s tabindex="0" id="s4">strikethrough (sTag)</s><br>
-<strike tabindex="-1" id="strike4">strikethrough (strikeTag)</strike><br>
-<sub id="sub4">subscript</sub><br>
-<sup tabindex="1" id="sup4">superscript</sup><br>
-<u tabindex="0" id="u4">underlined</u><br>
-<del tabindex="-1" id="del4">delete</del><br>
-<ins id="inst4">insert</ins><br>
-<pre tabindex="1" id="pre4">preformatted</pre>
-basic usage of <font tabindex="0" id="font4">font</font> tag<br>
-basic usage of <span tabindex="-1" id="span4">span</span> tag<br>
-
-<!--tables-->
-<div id="div4e">
-<table border="1" tabindex="2" id="table4">
-<caption tabindex="0" id="caption4">table caption</caption>
-<colgroup span="2" tabindex="-1" id="colgroup4">
-<col width="100" id="col4a"></col>
-<col width="250" tabindex="3" id="col4b"></col>
-</colgroup>
-<thead tabindex="0" id="thead4"><tr><th tabindex="-1" id="th4">
-table header
-</th></tr></thead><tbody id="tbody4">
-<tr tabindex="3" id="tr4a">
-<td tabindex="0" id="td4a">table cell 1</td>
-<td tabindex="-1" id="tr4b">table cell 2</td>
-<td id="td4b">table cell 3</td>
-</tr></tbody>
-<tfoot tabindex="2" id="tfoot4"><tr><td>
-table footer
-</td></tr></tfoot>
-</table>
-</div>
-
-<!--definition list-->
-<dl tabindex="0" id="dl4">definition list
-<dt tabindex="-1" id="dt4a">term1</dt>
-<dd id="dd4a">definition1</dd>
-<dt tabindex="1" id="dt4b">term2</dt>
-<dd tabindex="0" id="dd4b">definition2</dd>
-</dl>
-
-<!--lists -->
-<div id="div4f" tabindex="-1">
-<ul id="ul4">unordered list
-<li tabindex="1" id="li4a"> ul li
-</ul>
-<ol tabindex="0" id="ol4">ordered list
-<li tabindex="-1" id="li4b"> ol li
-</ol>
-<menu id="menu4">menu list
-<li tabindex="2" id="li4c"> menu li
-</menu>
-<dir tabindex="0" id="dir4">directory list
-<li tabindex="-1" id="li4d"> dir li
-</dir>
-</div>
-
-<!--images-->
-<image src="abe.png" id="image4"><br>
-<img src="abe.png" tabindex="3" id="img4"><br>
-
-<!--forms-->
-<div id="div4g" tabindex="0">
-<form tabindex="-1" id="form4">
-<fieldset id="fieldset4">
- <legend id="legend4" tabindex="3">legend4</legend>
-</fieldset>
-<select id="select4" tabindex="-1">
- <optgroup label="group1" id="optgroup4">
- <option tabindex="2" id="option4a">option1</option>
- <option>option2</option>
- </optgroup>
- <optgroup label="group2">
- <option>option3</option>
- <option tabindex="0" id="option4b">option4</option>
- </optgroup>
-</select><br>
-<textarea id="textarea4" tabindex="-1">textarea1</textarea><br>
-<input type="text" id="text4" value="text"><br>
-<isindex id="isindex4" prompt="isindex" tabindex="1"/><br>
-<input type="checkbox" id="checkbox4" tabindex="-1"><br>
-<input type="radio" id="radioChoice4a" name="radio4" tabindex="-1"><br>
-<label id="label4" tabindex="0"><input type="radio" name="radio4">label for radio button</label><br>
-
-<input type="file" id="file4" tabindex="1"><br>
-input type="hidden"<input type="hidden" id="hidden4" tabindex="0"><br>
-input type="image"<input type="image" id="inputImage4" src="abe.png" tabindex="-1"><br>
-<button id="button4" tabindex="1">button</button><br>
-<input type="button" id="inputButton4" value="inputButton" tabindex="0"><br>
-<input type="search" id="search4" placeholder="search" tabindex="-1"><br>
-<input type="password" id="password4" tabindex="0"><br>
-<input type="range" id="range4" tabindex="-1"><br>
-<input type="submit" id="submit4" tabindex="1">
-<input type="reset" id="reset4" tabindex="0"><br>
-</form>
-</div>
-
-</body>
diff --git a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all.js b/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all.js
deleted file mode 100644
index c2d1f25..0000000
--- a/webkit/data/layout_tests/pending/fast/events/resources/tabindex-focus-blur-all.js
+++ /dev/null
@@ -1,125 +0,0 @@
-if (window.layoutTestController)
- layoutTestController.waitUntilDone();
-
-var consoleOutput = null;
-var stopTest = false;
-var focusCount = 0;
-var blurCount = 0;
-var focusedElem = null;
-var failedTestCount = 0;
-
-var tagNamesAlwaysFocused = ["A",
- "BUTTON",
- "IFRAME",
- "INPUT",
- "ISINDEX",
- "SELECT",
- "TEXTAREA"];
-
-var tagNamesTransferFocused = ["LABEL"]; // lables always transfer focus to the labeled element
-
-function printToConsole(str)
-{
- if (!consoleOutput) {
- consoleOutput = window.frames[2].document.getElementById("theConsole");
- }
- consoleOutput.innerHTML += "<br>" + str;
-}
-
-function doFocus(elem)
-{
- focusCount++;
- focusedElem = elem;
-}
-
-function doBlur(elem)
-{
- blurCount++;
-}
-
-function test()
-{
- for (var i = 0; i < 2; ++i)
- focusEachChild(window.frames[i].document.body);
-
- // focus an untested element so that blur can be dispatched on the last iframe tested
- var homeBase = window.frames[1].document.getElementsByClassName('homebase');
- homeBase[0].focus();
-
- var resultSummary = focusCount+" focus / "+blurCount+" blur events disatched, and should be 335 / 335 ";
- resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED</span><br>" : "<span style='color:red'>FAILED</span><br>";
- resultSummary += "Total of "+failedTestCount+" focus test(s) failed.";
- if (failedTestCount)
- resultSummary += "<br>Details:<br>"+consoleOutput.innerHTML;
- else
- resultSummary += " <span style='color:green'>PASSED</span>";
-
- document.write(resultSummary);
- document.close();
-
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.notifyDone();
- }
-}
-
-function focusEachChild(elem) {
- var childNodes = elem.childNodes;
- for (var i = 0; i < childNodes.length; i++) {
- if (childNodes[i].nodeType == Node.ELEMENT_NODE && childNodes[i].id) {
- childNodes[i].addEventListener('focus',function () { doFocus(this) }, false);
- childNodes[i].addEventListener('blur',function () { doBlur(this) }, false);
- testProgrammaticFocus(childNodes[i]);
- }
- if (childNodes[i].childNodes.length)
- focusEachChild(childNodes[i]);
- if (childNodes[i].tagName =="IFRAME") {
- if (childNodes[i].id == "iframe1b") {
- window.frames[0].document.body.focus();
- }
- focusEachChild(childNodes[i].contentDocument.body);
- }
- }
-}
-
-Array.prototype.find = function(element) {
- for (var i = 0; i < this.length; i++) {
- if(this[i] == element) {
- return this[i];
- }
- }
- return null;
-}
-
-function testProgrammaticFocus(elem)
-{
- var elemThatShouldFocus = null;
- var OKtoFocusOtherElement = false;
- focusedElem = null;
-
- if (elem.tabIndex == elem.getAttribute("tabindex")) // this means tabindex was explicitly set
- elemThatShouldFocus = elem;
- else if (tagNamesAlwaysFocused.find(elem.tagName)) // special case form elements and other controls that are always focusable
- elemThatShouldFocus = elem;
-
- if (elem.tagName == "INPUT" && elem.type == "hidden") // obviously since <input type=hidden> isn't rendered, it can't be focused
- elemThatShouldFocus = null;
- if (tagNamesTransferFocused.find(elem.tagName)) {
- elemThatShouldFocus = null;
- OKtoFocusOtherElement = true;
- }
-
- elem.focus();
- if (elemThatShouldFocus == focusedElem || (!elemThatShouldFocus && OKtoFocusOtherElement))
- printToConsole("&lt;"+elem.tagName+"&gt; "+elem.id+" <span style='color:green'>passed</span> focus test");
- else {
- failedTestCount++;
- printToConsole(elem.id+" <span style='color:red'>failed</span> - was " + (focusedElem ? "" : " not ") + " focused but focus " + (elemThatShouldFocus ? " was " : " wasn\'t") + " expected");
- if (elemThatShouldFocus && focusedElem)
- printToConsole("elemThatShouldFocus is &lt;"+elemThatShouldFocus.tagName+"&gt; "+elemThatShouldFocus.id+", focusedElem is &lt;"+focusedElem.tagName+"&gt; "+focusedElem.id);
- if (!elemThatShouldFocus)
- printToConsole("elemThatShouldFocus is null, focusedElem is &lt;"+focusedElem.tagName+"&gt; "+focusedElem.id);
- if (!focusedElem)
- printToConsole("elemThatShouldFocus is &lt;"+elemThatShouldFocus.tagName+"&gt; "+elemThatShouldFocus.id+", focusedElem is null");
- }
-}
diff --git a/webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all-expected.txt b/webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all-expected.txt
deleted file mode 100644
index d827983..0000000
--- a/webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-335 focus / 335 blur events disatched, and should be 335 / 335 PASSED
-Total of 0 focus test(s) failed. PASSED
diff --git a/webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all.html b/webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all.html
deleted file mode 100644
index a26174b..0000000
--- a/webkit/data/layout_tests/pending/fast/events/tabindex-focus-blur-all.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-<script src="resources/tabindex-focus-blur-all.js"></script>
-
-<frameset cols="33%, 33%, *" onload="test()">
-<frame src="resources/tabindex-focus-blur-all-frame1.html"/>
-<frame src="resources/tabindex-focus-blur-all-frame2.html"/>
-<frame src="resources/tabindex-focus-blur-all-frame3.html"/>
-</frameset>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/forms/image-border-expected.checksum b/webkit/data/layout_tests/pending/fast/forms/image-border-expected.checksum
deleted file mode 100644
index d1181a5..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/image-border-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-f8a2089fb77245d2013fd200f345a15b \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/image-border-expected.png b/webkit/data/layout_tests/pending/fast/forms/image-border-expected.png
deleted file mode 100644
index b081226..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/image-border-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/forms/image-border-expected.txt b/webkit/data/layout_tests/pending/fast/forms/image-border-expected.txt
deleted file mode 100644
index b9dee66..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/image-border-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-FAIL: We need to fix this bug first and then generate the correct expected results \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/image-border.html b/webkit/data/layout_tests/pending/fast/forms/image-border.html
deleted file mode 100644
index 9b5141b..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/image-border.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<body>
-<p> border="1" should draw the border. See Bug#1064038. </p>
- border:0<img alt="" border="0" width="338" height="50px"><hr>
- border:1<img alt="" border="1" width="338" height="50px">
-</body>
-</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.checksum b/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.checksum
deleted file mode 100644
index bd371b7..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-50f3e6eac831274d4c621d30c2ab9867 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.png b/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.png
deleted file mode 100644
index 180147c..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.txt b/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.txt
deleted file mode 100644
index d2a9d14..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated-expected.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x13
- RenderText {#text} at (0,0) size 287x13
- text run at (0,0) width 220: "Text inside input field should not be truncated. "
- text run at (220,0) width 67: "Bug 1008046."
- RenderBlock (anonymous) at (0,24) size 784x21
- RenderTextControl {INPUT} at (0,0) size 300x21 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
-layer at (10,35) size 296x15
- RenderBlock {DIV} at (2,3) size 296x15
- RenderText {#text} at (1,0) size 62x15
- text run at (1,0) width 62: "something"
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated.html b/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated.html
deleted file mode 100644
index cbfe833..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-field-text-truncated.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
-</head>
-<body style="font-size:11px;">
-<p>Text inside input field should not be truncated. Bug 1008046.</p>
-<input id="a1" style="font-size:1.1em;width: 300px;" type="text" value="something" />
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.checksum b/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.checksum
deleted file mode 100644
index ecbdf82..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-2523d4f85edc5f3838358be17c7ca931 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.png b/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.png
deleted file mode 100644
index b44d225..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.txt b/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.txt
deleted file mode 100644
index 9e1887f..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-first-letter-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 585x18
- text run at (0,0) width 585: "This test passes if it doesn't crash and if the Submit button does not honor the first-letter style."
- RenderBR {BR} at (585,14) size 0x0
- RenderButton {INPUT} at (0,18) size 60x19 [border: (2px outset #C0C0C0)]
- RenderBlock (anonymous) at (8,2) size 44x15
- RenderText at (3,1) size 38x13
- text run at (3,1) width 38: "Submit"
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-first-letter.html b/webkit/data/layout_tests/pending/fast/forms/input-first-letter.html
deleted file mode 100644
index 84c19af..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-first-letter.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
- <head>
- <style>
- input {
- background-color: transparent;
- }
-
- input:first-letter {
- color: white;
- }
- </style>
- </head>
-<body>
- This test passes if it doesn't crash and if the Submit button does not honor the first-letter style.<br>
- <input type="submit"/>
-</body>
-</html>
-
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.checksum b/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.checksum
deleted file mode 100644
index 6c71503..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-08d274858927bc9f2b54c55be4d14e9b \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.png b/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.png
deleted file mode 100644
index 2f77f35..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.txt b/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.txt
deleted file mode 100644
index d7ea420..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll-expected.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x18
- RenderText {#text} at (0,0) size 53x18
- text run at (0,0) width 53: "Test for "
- RenderInline {A} at (0,0) size 68x18 [color=#0000EE]
- RenderText {#text} at (53,0) size 68x18
- text run at (53,0) width 68: "bug 11534"
- RenderText {#text} at (121,0) size 4x18
- text run at (121,0) width 4: "."
- RenderBlock {P} at (0,34) size 784x18
- RenderText {#text} at (0,0) size 351x18
- text run at (0,0) width 351: "Readonly text fields don't scroll when selecting content."
- RenderBlock (anonymous) at (0,68) size 784x19
- RenderTextControl {INPUT} at (0,0) size 130x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {DIV} at (0,87) size 784x18
- RenderText {#text} at (0,0) size 87x18
- text run at (0,0) width 87: "ScrollLeft: 33"
- RenderBR {BR} at (87,14) size 0x0
-layer at (10,79) size 126x13 scrollX 33 scrollWidth 159
- RenderBlock {DIV} at (2,3) size 126x13
- RenderText {#text} at (1,0) size 158x13
- text run at (1,0) width 158: "abcdefghijklmnopqrstuvwxyz"
-selection start: position 1 of child 0 {#text} of child 0 {DIV} of child 5 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
-selection end: position 1 of child 5 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll.html b/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll.html
deleted file mode 100644
index 5a447dc..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-readonly-autoscroll.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>
- <head>
- <script>
- function test()
- {
- if (window.layoutTestController) {
- layoutTestController.waitUntilDone();
- setTimeout(autoscrollTestPart1, 0);
- }
- }
- function autoscrollTestPart1()
- {
- var tf = document.getElementById('tf');
- if (window.eventSender) {
- tf.scrollIntoView();
- var h = tf.offsetTop - document.body.scrollTop + 10;
- eventSender.dragMode = false;
- eventSender.mouseMoveTo(20, h);
- eventSender.mouseDown();
- eventSender.mouseMoveTo(20, h);
- eventSender.mouseMoveTo(300, h);
- }
- setTimeout(autoscrollTestPart2, 100);
- }
- function autoscrollTestPart2()
- {
- if (window.eventSender)
- eventSender.mouseUp();
- log("ScrollLeft: " + document.getElementById('tf').scrollLeft);
- if (window.layoutTestController)
- layoutTestController.notifyDone();
- }
- function log(msg)
- {
- var res = document.getElementById('res');
- res.innerHTML = res.innerHTML + msg + "<br>";
- }
- </script>
- </head>
- <body onload="test()">
- <p>Test for <a href=http://bugs.webkit.org/show_bug.cgi?id=11534">bug 11534</a>.</p>
- <p>Readonly text fields don't scroll when selecting content.</p>
- <input id="tf" readonly value="abcdefghijklmnopqrstuvwxyz"></input>
- <div id="res"></div>
- </body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.checksum b/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.checksum
deleted file mode 100644
index 225f8ed..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-133bfac6956806dc3c173ab7147ef7a3 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.png b/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.png
deleted file mode 100644
index 6b2c0f2..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.txt b/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.txt
deleted file mode 100644
index f18b710..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width-expected.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x18
- RenderText {#text} at (0,0) size 539x18
- text run at (0,0) width 539: "This test checks if correct min width is applied to \"input type=text\". See Bug#718717"
- RenderBlock (anonymous) at (0,34) size 784x19
- RenderTextControl {INPUT} at (0,0) size 35x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
-layer at (10,45) size 31x13
- RenderBlock {DIV} at (2,3) size 31x13
- RenderText {#text} at (1,0) size 14x13
- text run at (1,0) width 14: "19"
diff --git a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width.html b/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width.html
deleted file mode 100644
index ada87e4..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/input-type-text-min-width.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body >
-<p> This test checks if correct min width is applied to "input type=text". See Bug#718717 </p>
- <input size="1" value="19" type="text">
-</body>
-</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height-expected.txt b/webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height-expected.txt
deleted file mode 100644
index 2d8bd22..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-FAIL: We need to fix this bug first and then generate the correct expected results. \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height.html b/webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height.html
deleted file mode 100644
index f4445f7..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/textarea-scrollbar-height.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<style type="text/css">
-body {font:13px/1.22 arial;}
-li {overflow:auto;}
-</style>
-
-<script>
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-
-function checkForVerticalScrollbar() {
- var actual_height = document.getElementById('list_item').clientHeight;
- var scroll_height = document.getElementById('list_item').scrollHeight;
- if (actual_height == scroll_height )
- document.getElementById('sourceViewDiv').innerHTML=' This test: PASSED!';
-}
-
-</script>
-</head>
-<body onLoad="javascript:checkForVerticalScrollbar()">
- <p> <b> Vertical scrollbar should not be created when there is no overflow . See bug 1055396. </b> </p>
- <ul >
- <li id="list_item" style="border:1px solid blue;">
- list item
- </li>
- </ul>
- <div id='sourceViewDiv'>This test: FAILED</div>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.checksum b/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.checksum
deleted file mode 100644
index 8534137..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-ed858950987d48bf99bbf536a55da2f9 \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.png b/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.png
deleted file mode 100644
index a7a5e67..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.txt b/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.txt
deleted file mode 100644
index a27b456..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/textarea-width-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {DIV} at (0,0) size 784x18
- RenderText {#text} at (0,0) size 539x18
- text run at (0,0) width 539: "This text area should be render with same width as other browsers. See bug#1121635"
- RenderBlock (anonymous) at (0,18) size 784x246
- RenderText {#text} at (0,0) size 0x0
- RenderText {#text} at (0,0) size 0x0
-layer at (8,27) size 459x244 clip at (9,28) size 457x242
- RenderTextControl {TEXTAREA} at (0,1) size 459x244 [color=#333333] [bgcolor=#FFFFFF] [border: (1px solid #333333)]
- RenderBlock {DIV} at (3,3) size 438x12
diff --git a/webkit/data/layout_tests/pending/fast/forms/textarea-width.html b/webkit/data/layout_tests/pending/fast/forms/textarea-width.html
deleted file mode 100644
index 3ed6a29..0000000
--- a/webkit/data/layout_tests/pending/fast/forms/textarea-width.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<style type="text/css">
-.input{font-size:10px; color:#333; font-family:Verdana,Helvetica,sans-serif;}
-</style>
-</head>
-<body>
-<div> This text area should be render with same width as other browsers. See bug#1121635 </div>
-<textarea rows="20" cols="88" wrap="soft" class="input"></textarea>
-</body>
-</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src-expected.txt b/webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src-expected.txt
deleted file mode 100644
index 465bff5..0000000
--- a/webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Attempts to destroy an iframe within its onload handler.
-
-The onload callback is invoked synchronously when setting the src property.
-
-To be successful should not crash. (Also should not write to freed memory)
diff --git a/webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src.html b/webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src.html
deleted file mode 100644
index 34ab5ba..0000000
--- a/webkit/data/layout_tests/pending/fast/frames/crash-remove-onload-from-src.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<html>
-<script>
-function triggerCrash() {
- if (window.layoutTestController)
- window.layoutTestController.dumpAsText();
-
- frame1 = document.createElement('iframe');
- document.body.appendChild(frame1);
- frame1.onload = removeFrame;
- frame1.src = "";
-}
-
-function removeFrame() {
- frame1.id = "frame1";
- frame1.parentNode.removeChild(frame1);
- frame1 = null;
- checkFrame1IsRemoved();
-}
-
-function checkFrame1IsRemoved() {
- if (document.getElementById("frame1")) {
- document.body.appendChild(
- document.createTextNode("Failed: frame1 was not removed"));
- }
-}
-</script>
-<body onload="triggerCrash()">
-<p>Attempts to destroy an iframe within its onload handler.</p>
-<p>The onload callback is invoked synchronously when setting the src property.</p>
-<p>To be successful should not crash. (Also should not write to freed memory)</p>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/history/README b/webkit/data/layout_tests/pending/fast/history/README
deleted file mode 100644
index 29b69ba..0000000
--- a/webkit/data/layout_tests/pending/fast/history/README
+++ /dev/null
@@ -1,2 +0,0 @@
-history_reload.html: The original version has a timer race that's exposed with
-our new timer code. See bug 972450.
diff --git a/webkit/data/layout_tests/pending/fast/history/history_reload-expected.txt b/webkit/data/layout_tests/pending/fast/history/history_reload-expected.txt
deleted file mode 100644
index a757df9..0000000
--- a/webkit/data/layout_tests/pending/fast/history/history_reload-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-main frame - has 1 onunload handler(s)
-main frame - has 1 onunload handler(s)
-This tests that history.go(0) will force a page reload.
-
-Test Passed
diff --git a/webkit/data/layout_tests/pending/fast/history/history_reload.html b/webkit/data/layout_tests/pending/fast/history/history_reload.html
deleted file mode 100644
index dc49694..0000000
--- a/webkit/data/layout_tests/pending/fast/history/history_reload.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html>
-<head>
- <script>
- var i = 0;
- function test() {
- if (window.layoutTestController) {
- layoutTestController.setCanOpenWindows();
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
- eventSender.mouseMoveTo(17, 30);
- eventSender.mouseDown();
- eventSender.mouseUp();
- }
- }
- function openWindow() {
- var newWindow = window.open('resources/history_reload_window.html');
- }
-
- </script>
-</head>
-<body onload="test()">
- This tests that history.go(0) will force a page reload.<br>
- <input type="button" onclick="openWindow()" value="click"></input>
- <div id="console"></div>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/history/resources/history_reload_window.html b/webkit/data/layout_tests/pending/fast/history/resources/history_reload_window.html
deleted file mode 100644
index d88e903..0000000
--- a/webkit/data/layout_tests/pending/fast/history/resources/history_reload_window.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
- <head>
- <script>
- function test() {
- var tempConsole = document.getElementById('console');
- var console = window.opener.document.getElementById('console');
- // On the first pass, we'll temporarily set the output to
- // to failure, and then go(0). On the second pass,
- // we set the output back to success and close the window.
- if (window.opener.i == 0) {
- tempConsole.innerHTML = 'Test Failed';
- console.innerHTML = tempConsole.innerHTML;
- window.opener.i = 1;
- history.go(0);
- } else {
- console.innerHTML = tempConsole.innerHTML;
- window.opener.i = 2;
- window.close();
- }
- }
-
- function closed()
- {
- if (window.opener.i == 2)
- if (window.layoutTestController)
- opener.setTimeout("layoutTestController.notifyDone()", 0);
- }
- </script>
- </head>
- <body onload="test()" onunload="closed()">
- <div id="console">Test Passed</div>
- </body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/js/README b/webkit/data/layout_tests/pending/fast/js/README
deleted file mode 100644
index a972c88e..0000000
--- a/webkit/data/layout_tests/pending/fast/js/README
+++ /dev/null
@@ -1,16 +0,0 @@
-resources/function-toString-parentheses.js
-------------------------------------------
-Expected result has the wrong parentheses for testHigherFirst case with parens
-around the first condition and removesExtraParentheses == false. Safari (and
-Firefox) has removesExtraParentheses == true, so the problem never turned
-up there. Our results may still be wrong, though: see bug 1135116.
-
-The main .html file, and the other files in resources/, are unchanged from
-the originals but here to support this forked test.
-
-resources/const.js
-------------------------------------------
-Test failed because of a const/const redeclaration error being thrown. Changed
-the second const declaration of x to z to avoid this error.
-
-A bug should be filed upstream for this test post-beta. \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/js/const-expected.txt b/webkit/data/layout_tests/pending/fast/js/const-expected.txt
deleted file mode 100644
index 6430fd1..0000000
--- a/webkit/data/layout_tests/pending/fast/js/const-expected.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-This test checks that const declarations in JavaScript work and are readonly.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS x is "RIGHT"
-PASS y is "RIGHT"
-PASS a is 1
-PASS one is 1
-PASS a is 1
-PASS one is 1
-PASS a is 2
-PASS one is 1
-PASS a is 0
-PASS one is 1
-PASS a is 3
-PASS one is 1
-PASS a is 2
-PASS one is 1
-PASS function f() { const one = 1; one++; return one; } f(); is 1
-PASS function f() { const oneString = '1'; return oneString++; } f(); is 1
-PASS function f() { const one = 1; return one++; } f(); is 1
-PASS function f() { const one = 1; one--; return one; } f(); is 1
-PASS function f() { const oneString = '1'; return oneString--; } f(); is 1
-PASS function f() { const one = 1; return one--; } f(); is 1
-PASS function f() { const one = 1; ++one; return one; } f(); is 1
-PASS function f() { const one = 1; return ++one; } f(); is 2
-PASS function f() { const one = 1; --one; return one; } f(); is 1
-PASS function f() { const one = 1; return --one; } f(); is 0
-PASS function f() { const one = 1; one += 2; return one; } f(); is 1
-PASS function f() { const one = 1; return one += 2; } f(); is 3
-PASS function f() { const one = 1; one = 2; return one; } f(); is 1
-PASS function f() { const one = 1; return one = 2; } f(); is 2
-PASS one++ is 1
-PASS one is 1
-PASS one-- is 1
-PASS one is 1
-PASS ++one is 2
-PASS one is 1
-PASS --one is 0
-PASS one is 1
-PASS one += 1 is 2
-PASS one is 1
-PASS one = 2 is 2
-PASS one is 1
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/webkit/data/layout_tests/pending/fast/js/const.html b/webkit/data/layout_tests/pending/fast/js/const.html
deleted file mode 100644
index 2ac7ed7..0000000
--- a/webkit/data/layout_tests/pending/fast/js/const.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href="resources/js-test-style.css">
-<script src="resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="resources/const.js"></script>
-<script src="resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/js/function-toString-parentheses.html b/webkit/data/layout_tests/pending/fast/js/function-toString-parentheses.html
deleted file mode 100644
index d8ea3f9..0000000
--- a/webkit/data/layout_tests/pending/fast/js/function-toString-parentheses.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href="resources/js-test-style.css">
-<script src="resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="resources/function-toString-parentheses.js"></script>
-<script src="resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/js/resources/const.js b/webkit/data/layout_tests/pending/fast/js/resources/const.js
deleted file mode 100644
index 1af3b74..0000000
--- a/webkit/data/layout_tests/pending/fast/js/resources/const.js
+++ /dev/null
@@ -1,97 +0,0 @@
-description(
-"This test checks that const declarations in JavaScript work and are readonly."
-);
-
-const x = "RIGHT";
-x = "WRONG";
-shouldBe("x", '"RIGHT"');
-
-const z = "RIGHT", y = "RIGHT";
-y = "WRONG";
-shouldBe("y", '"RIGHT"');
-
-const one = 1;
-
-var a;
-
-// PostIncResolveNode
-a = one++;
-shouldBe("a", "1");
-shouldBe("one", "1");
-
-// PostDecResolveNode
-a = one--;
-shouldBe("a", "1");
-shouldBe("one", "1");
-
-// PreIncResolveNode
-a = ++one;
-shouldBe("a", "2");
-shouldBe("one", "1");
-
-// PreDecResolveNode
-a = --one;
-shouldBe("a", "0");
-shouldBe("one", "1");
-
-// ReadModifyConstNode
-a = one += 2;
-shouldBe("a", "3");
-shouldBe("one", "1");
-
-// AssignConstNode
-a = one = 2;
-shouldBe("a", "2");
-shouldBe("one", "1");
-
-// PostIncResolveNode
-shouldBe("function f() { const one = 1; one++; return one; } f();", "1");
-shouldBe("function f() { const oneString = '1'; return oneString++; } f();", "1");
-shouldBe("function f() { const one = 1; return one++; } f();", "1");
-
-// PostDecResolveNode
-shouldBe("function f() { const one = 1; one--; return one; } f();", "1");
-shouldBe("function f() { const oneString = '1'; return oneString--; } f();", "1");
-shouldBe("function f() { const one = 1; return one--; } f();", "1");
-
-// PreIncResolveNode
-shouldBe("function f() { const one = 1; ++one; return one; } f();", "1");
-shouldBe("function f() { const one = 1; return ++one; } f();", "2");
-
-// PreDecResolveNode
-shouldBe("function f() { const one = 1; --one; return one; } f();", "1");
-shouldBe("function f() { const one = 1; return --one; } f();", "0");
-
-// ReadModifyConstNode
-shouldBe("function f() { const one = 1; one += 2; return one; } f();", "1");
-shouldBe("function f() { const one = 1; return one += 2; } f();", "3");
-
-// AssignConstNode
-shouldBe("function f() { const one = 1; one = 2; return one; } f();", "1");
-shouldBe("function f() { const one = 1; return one = 2; } f();", "2");
-
-// PostIncResolveNode
-shouldBe("one++", "1");
-shouldBe("one", "1");
-
-// PostDecResolveNode
-shouldBe("one--", "1");
-shouldBe("one", "1");
-
-// PreIncResolveNode
-shouldBe("++one", "2");
-shouldBe("one", "1");
-
-// PreDecResolveNode
-shouldBe("--one", "0");
-shouldBe("one", "1");
-
-// ReadModifyConstNode
-shouldBe("one += 1", "2");
-shouldBe("one", "1");
-
-// AssignConstNode
-shouldBe("one = 2", "2");
-shouldBe("one", "1");
-
-var successfullyParsed = true;
diff --git a/webkit/data/layout_tests/pending/fast/js/resources/function-toString-parentheses.js b/webkit/data/layout_tests/pending/fast/js/resources/function-toString-parentheses.js
deleted file mode 100644
index 66a712f..0000000
--- a/webkit/data/layout_tests/pending/fast/js/resources/function-toString-parentheses.js
+++ /dev/null
@@ -1,202 +0,0 @@
-description(
-"This test checks that parentheses are preserved when significant, and not added where inappropriate. " +
-"We need this test because the JavaScriptCore parser removes all parentheses and the serializer then adds them back."
-);
-
-function compileAndSerialize(expression)
-{
- var f = eval("(function () { return " + expression + "; })");
- var serializedString = f.toString();
- serializedString = serializedString.replace(/[ \t\r\n]+/g, " ");
- serializedString = serializedString.replace("function () { return ", "");
- serializedString = serializedString.replace("; }", "");
- return serializedString;
-}
-
-function compileAndSerializeLeftmostTest(expression)
-{
- var f = eval("(function () { " + expression + "; })");
- var serializedString = f.toString();
- serializedString = serializedString.replace(/[ \t\r\n]+/g, " ");
- serializedString = serializedString.replace("function () { ", "");
- serializedString = serializedString.replace("; }", "");
- return serializedString;
-}
-
-var removesExtraParentheses = compileAndSerialize("(a + b) + c") == "a + b + c";
-
-function testKeepParentheses(expression)
-{
- shouldBe("compileAndSerialize('" + expression + "')",
- "'" + expression + "'");
-}
-
-function testOptionalParentheses(expression)
-{
- stripped_expression = removesExtraParentheses
- ? expression.replace(/\(/g, '').replace(/\)/g, '')
- : expression;
- shouldBe("compileAndSerialize('" + expression + "')",
- "'" + stripped_expression + "'");
-}
-
-function testLeftAssociativeSame(opA, opB)
-{
- testKeepParentheses("a " + opA + " b " + opB + " c");
- testOptionalParentheses("(a " + opA + " b) " + opB + " c");
- testKeepParentheses("a " + opA + " (b " + opB + " c)");
-}
-
-function testRightAssociativeSame(opA, opB)
-{
- testKeepParentheses("a " + opA + " b " + opB + " c");
- testKeepParentheses("(a " + opA + " b) " + opB + " c");
- testOptionalParentheses("a " + opA + " (b " + opB + " c)");
-}
-
-function testHigherFirst(opHigher, opLower)
-{
- testKeepParentheses("a " + opHigher + " b " + opLower + " c");
- testOptionalParentheses("(a " + opHigher + " b) " + opLower + " c");
- testKeepParentheses("a " + opHigher + " (b " + opLower + " c)");
-}
-
-function testLowerFirst(opLower, opHigher)
-{
- testKeepParentheses("a " + opLower + " b " + opHigher + " c");
- testKeepParentheses("(a " + opLower + " b) " + opHigher + " c");
- testOptionalParentheses("a " + opLower + " (b " + opHigher + " c)");
-}
-
-var binaryOperators = [
- [ "*", "/", "%" ], [ "+", "-" ],
- [ "<<", ">>", ">>>" ],
- [ "<", ">", "<=", ">=", "instanceof", "in" ],
- [ "==", "!=", "===", "!==" ],
- [ "&" ], [ "^" ], [ "|" ],
- [ "&&" ], [ "||" ]
-];
-
-for (i = 0; i < binaryOperators.length; ++i) {
- var ops = binaryOperators[i];
- for (j = 0; j < ops.length; ++j) {
- var op = ops[j];
- testLeftAssociativeSame(op, op);
- if (j != 0)
- testLeftAssociativeSame(ops[0], op);
- if (i < binaryOperators.length - 1) {
- var nextOps = binaryOperators[i + 1];
- if (j == 0)
- for (k = 0; k < nextOps.length; ++k)
- testHigherFirst(op, nextOps[k]);
- else
- testHigherFirst(op, nextOps[0]);
- }
- }
-}
-
-var assignmentOperators = [ "=", "*=", "/=" , "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=" ];
-
-for (i = 0; i < assignmentOperators.length; ++i) {
- var op = assignmentOperators[i];
- testRightAssociativeSame(op, op);
- if (i != 0)
- testRightAssociativeSame("=", op);
- testLowerFirst(op, "+");
- shouldThrow("compileAndSerialize('a + b " + op + " c')");
- testKeepParentheses("(a + b) " + op + " c");
- testKeepParentheses("a + (b " + op + " c)");
-}
-
-var prefixOperators = [ "delete", "void", "typeof", "++", "--", "+", "-", "~", "!" ];
-var prefixOperatorSpace = [ " ", " ", " ", "", "", " ", " ", "", "" ];
-
-for (i = 0; i < prefixOperators.length; ++i) {
- var op = prefixOperators[i] + prefixOperatorSpace[i];
- testKeepParentheses("" + op + "a + b");
- testOptionalParentheses("(" + op + "a) + b");
- testKeepParentheses("" + op + "(a + b)");
- testKeepParentheses("!" + op + "a");
- testOptionalParentheses("!(" + op + "a)");
-}
-
-
-testKeepParentheses("!a++");
-testOptionalParentheses("!(a++)");
-testKeepParentheses("(!a)++");
-
-testKeepParentheses("!a--");
-testOptionalParentheses("!(a--)");
-testKeepParentheses("(!a)--");
-
-testKeepParentheses("(-1)[a]");
-testKeepParentheses("(-1)[a] = b");
-testKeepParentheses("(-1)[a] += b");
-testKeepParentheses("(-1)[a]++");
-testKeepParentheses("++(-1)[a]");
-testKeepParentheses("(-1)[a]()");
-
-testKeepParentheses("new (-1)()");
-
-testKeepParentheses("(-1).a");
-testKeepParentheses("(-1).a = b");
-testKeepParentheses("(-1).a += b");
-testKeepParentheses("(-1).a++");
-testKeepParentheses("++(-1).a");
-testKeepParentheses("(-1).a()");
-
-testKeepParentheses("(- 0)[a]");
-testKeepParentheses("(- 0)[a] = b");
-testKeepParentheses("(- 0)[a] += b");
-testKeepParentheses("(- 0)[a]++");
-testKeepParentheses("++(- 0)[a]");
-testKeepParentheses("(- 0)[a]()");
-
-testKeepParentheses("new (- 0)()");
-
-testKeepParentheses("(- 0).a");
-testKeepParentheses("(- 0).a = b");
-testKeepParentheses("(- 0).a += b");
-testKeepParentheses("(- 0).a++");
-testKeepParentheses("++(- 0).a");
-testKeepParentheses("(- 0).a()");
-
-testOptionalParentheses("(1)[a]");
-testOptionalParentheses("(1)[a] = b");
-testOptionalParentheses("(1)[a] += b");
-testOptionalParentheses("(1)[a]++");
-testOptionalParentheses("++(1)[a]");
-
-shouldBe("compileAndSerialize('(1)[a]()')",
- removesExtraParentheses ? "'1[a]()'" : "'(1)[a]()'");
-
-shouldBe("compileAndSerialize('new (1)()')",
- removesExtraParentheses ? "'new 1()'" : "'new (1)()'");
-
-testKeepParentheses("(1).a");
-testKeepParentheses("(1).a = b");
-testKeepParentheses("(1).a += b");
-testKeepParentheses("(1).a++");
-testKeepParentheses("++(1).a");
-testKeepParentheses("(1).a()");
-
-for (i = 0; i < assignmentOperators.length; ++i) {
- var op = assignmentOperators[i];
- testKeepParentheses("(-1) " + op + " a");
- testKeepParentheses("(- 0) " + op + " a");
- testKeepParentheses("1 " + op + " a");
-}
-
-shouldBe("compileAndSerializeLeftmostTest('({ }).x')", "'({ }).x'");
-shouldBe("compileAndSerializeLeftmostTest('x = { }')", "'x = { }'");
-shouldBe("compileAndSerializeLeftmostTest('(function () { })()')", "'(function () { })()'");
-shouldBe("compileAndSerializeLeftmostTest('x = function () { }')", "'x = function () { }'");
-
-shouldBe("compileAndSerializeLeftmostTest('var a')", "'var a'");
-shouldBe("compileAndSerializeLeftmostTest('var a = 1')", "'var a = 1'");
-shouldBe("compileAndSerializeLeftmostTest('var a, b')", "'var a, b'");
-shouldBe("compileAndSerializeLeftmostTest('var a = 1, b = 2')", "'var a = 1, b = 2'");
-shouldBe("compileAndSerializeLeftmostTest('var a, b, c')", "'var a, b, c'");
-shouldBe("compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3')", "'var a = 1, b = 2, c = 3'");
-
-var successfullyParsed = true;
diff --git a/webkit/data/layout_tests/pending/fast/js/resources/js-test-post.js b/webkit/data/layout_tests/pending/fast/js/resources/js-test-post.js
deleted file mode 100644
index 6d8a68f3..0000000
--- a/webkit/data/layout_tests/pending/fast/js/resources/js-test-post.js
+++ /dev/null
@@ -1,2 +0,0 @@
-shouldBeTrue("successfullyParsed");
-debug('<br /><span class="pass">TEST COMPLETE</span>');
diff --git a/webkit/data/layout_tests/pending/fast/js/resources/js-test-pre.js b/webkit/data/layout_tests/pending/fast/js/resources/js-test-pre.js
deleted file mode 100644
index 4058a14..0000000
--- a/webkit/data/layout_tests/pending/fast/js/resources/js-test-pre.js
+++ /dev/null
@@ -1,135 +0,0 @@
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-
-function description(msg)
-{
- // For MSIE 6 compatibility
- var span = document.createElement("span");
- span.innerHTML = '<p>' + msg + '</p><p>On success, you will see a series of "<span class="pass">PASS</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
- var description = document.getElementById("description");
- if (description.firstChild)
- description.replaceChild(span, description.firstChild);
- else
- description.appendChild(span);
-}
-
-function debug(msg)
-{
- var span = document.createElement("span");
- document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace
- span.innerHTML = msg + '<br />';
-}
-
-function escapeHTML(text)
-{
- return text.replace(/&/g, "&amp;").replace(/</g, "&lt;");
-}
-
-function testPassed(msg)
-{
- debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
-}
-
-function testFailed(msg)
-{
- debug('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
-}
-
-function areArraysEqual(_a, _b)
-{
- if (_a.length !== _b.length)
- return false;
- for (var i = 0; i < _a.length; i++)
- if (_a[i] !== _b[i])
- return false;
- return true;
-}
-
-function isResultCorrect(_actual, _expected)
-{
- if (_actual === _expected)
- return true;
- if (typeof(_expected) == "number" && isNaN(_expected))
- return typeof(_actual) == "number" && isNaN(_actual);
- if (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([]))
- return areArraysEqual(_actual, _expected);
- return false;
-}
-
-function shouldBe(_a, _b)
-{
- if (typeof _a != "string" || typeof _b != "string")
- debug("WARN: shouldBe() expects string arguments");
- var exception;
- var _av;
- try {
- _av = eval(_a);
- } catch (e) {
- exception = e;
- }
- var _bv = eval(_b);
-
- if (exception)
- testFailed(_a + " should be " + _bv + ". Threw exception " + exception);
- else if (isResultCorrect(_av, _bv))
- testPassed(_a + " is " + _b);
- else if (typeof(_av) == typeof(_bv))
- testFailed(_a + " should be " + _bv + ". Was " + _av + ".");
- else
- testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
-}
-
-function shouldBeTrue(_a) { shouldBe(_a, "true"); }
-function shouldBeFalse(_a) { shouldBe(_a, "false"); }
-function shouldBeNaN(_a) { shouldBe(_a, "NaN"); }
-function shouldBeNull(_a) { shouldBe(_a, "null"); }
-
-function shouldBeEqualToString(a, b)
-{
- var unevaledString = '"' + b.replace(/"/g, "\"") + '"';
- shouldBe(a, unevaledString);
-}
-
-function shouldBeUndefined(_a)
-{
- var exception;
- var _av;
- try {
- _av = eval(_a);
- } catch (e) {
- exception = e;
- }
-
- if (exception)
- testFailed(_a + " should be undefined. Threw exception " + exception);
- else if (typeof _av == "undefined")
- testPassed(_a + " is undefined.");
- else
- testFailed(_a + " should be undefined. Was " + _av);
-}
-
-
-function shouldThrow(_a, _e)
-{
- var exception;
- var _av;
- try {
- _av = eval(_a);
- } catch (e) {
- exception = e;
- }
-
- var _ev;
- if (_e)
- _ev = eval(_e);
-
- if (exception) {
- if (typeof _e == "undefined" || exception == _ev)
- testPassed(_a + " threw exception " + exception + ".");
- else
- testFailed(_a + " should throw exception " + _ev + ". Threw exception " + exception + ".");
- } else if (typeof _av == "undefined")
- testFailed(_a + " should throw exception " + _e + ". Was undefined.");
- else
- testFailed(_a + " should throw exception " + _e + ". Was " + _av + ".");
-}
diff --git a/webkit/data/layout_tests/pending/fast/js/resources/js-test-style.css b/webkit/data/layout_tests/pending/fast/js/resources/js-test-style.css
deleted file mode 100644
index f12147c..0000000
--- a/webkit/data/layout_tests/pending/fast/js/resources/js-test-style.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.pass {
- font-weight: bold;
- color: green;
-}
-.fail {
- font-weight: bold;
- color: red;
-}
-#console {
- white-space: pre-wrap;
- font-family: monospace;
-}
diff --git a/webkit/data/layout_tests/pending/fast/parser/README b/webkit/data/layout_tests/pending/fast/parser/README
deleted file mode 100644
index c363a9e..0000000
--- a/webkit/data/layout_tests/pending/fast/parser/README
+++ /dev/null
@@ -1 +0,0 @@
-bad-xml-entity.html: new test
diff --git a/webkit/data/layout_tests/pending/fast/parser/bad-xml-entity-expected.txt b/webkit/data/layout_tests/pending/fast/parser/bad-xml-entity-expected.txt
deleted file mode 100644
index b7a62a1..0000000
--- a/webkit/data/layout_tests/pending/fast/parser/bad-xml-entity-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-REPRODUCIBLE CRASH: Omitting terminal question mark in xml tag causes access violation.
-
-If you don't crash, you pass.
diff --git a/webkit/data/layout_tests/pending/fast/parser/bad-xml-entity.html b/webkit/data/layout_tests/pending/fast/parser/bad-xml-entity.html
deleted file mode 100644
index 62fe35f..0000000
--- a/webkit/data/layout_tests/pending/fast/parser/bad-xml-entity.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-2">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<body>
-<p>REPRODUCIBLE CRASH: Omitting terminal question mark in xml tag causes access violation.</p>
-<script>
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-</script>
-<p>If you don't crash, you pass.</p>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss-expected.txt b/webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss-expected.txt
deleted file mode 100644
index 06e2e9a..0000000
--- a/webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Test for unicode BOM character within a tag. Original Firefox bug:
- http://www.mozilla.org/security/announce/2006/mfsa2006-42.html
- https://bugzilla.mozilla.org/attachment.cgi?id=220127
-<script>document.write('FAILED');
diff --git a/webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss.html b/webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss.html
deleted file mode 100644
index 1357775..0000000
--- a/webkit/data/layout_tests/pending/fast/parser/utf8-bom-xss.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
-<title>MFSA 2006-42 BOM XSS Test</title>
-</head>
-<body>
-
-<pre>
-Test for unicode BOM character within a tag. Original Firefox bug:
- http://www.mozilla.org/security/announce/2006/mfsa2006-42.html
- https://bugzilla.mozilla.org/attachment.cgi?id=220127
-</pre>
-
-<script>document.write('FAILED');</script>
-
-<script>
- if (window.layoutTestController)
- layoutTestController.dumpAsText();
-</script>
-
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/text/README b/webkit/data/layout_tests/pending/fast/text/README
deleted file mode 100644
index c08128e..0000000
--- a/webkit/data/layout_tests/pending/fast/text/README
+++ /dev/null
@@ -1,3 +0,0 @@
-wbr-in-pre-crash.html:
-Adding this test from upstream, r30454. Can be removed when we unfork.
-The test should be identical to the upstream copy.
diff --git a/webkit/data/layout_tests/pending/fast/text/international/README b/webkit/data/layout_tests/pending/fast/text/international/README
deleted file mode 100644
index 59b24a1..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/README
+++ /dev/null
@@ -1,10 +0,0 @@
-ideo_punc.html: new test
-------------------------
-This test case is for
- webkit bug 15630 (http://bugs.webkit.org/show_bug.cgi?id=15630)
- and our bug 824225 (http://b/issue?id=824225 )
-
-hindi-spacing.html: new test
-------------------------
-This test case is for http://b/1212319. WebKit doesn't have this bug,
-but it's a generic rendering test for Hindi where WebKit could regress.
diff --git a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.checksum b/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.checksum
deleted file mode 100644
index f24b747..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-771715b67725dedc088fb5876505d7dd \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.png b/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.png
deleted file mode 100644
index 17e8bd7..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.txt b/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.txt
deleted file mode 100644
index b810766..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing-expected.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderButton {INPUT} at (0,0) size 113x19 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
- RenderBlock (anonymous) at (8,2) size 97x15
- RenderText at (3,1) size 91x13
- text run at (3,1) width 91: "\x{915}\x{93F}\x{938}\x{940} \x{92D}\x{940} \x{924}\x{930}\x{939} \x{906}\x{917}\x{947} \x{92C}"
- RenderBR {BR} at (113,14) size 0x0
- RenderInline {SPAN} at (0,0) size 132x18
- RenderText {#text} at (0,19) size 132x18
- text run at (0,19) width 132: "\x{915}\x{93F}\x{938}\x{940} \x{92D}\x{940} \x{924}\x{930}\x{939} \x{906}\x{917}\x{947} \x{92C}"
- RenderText {#text} at (132,19) size 25x18
- text run at (132,19) width 25: "Foo"
- RenderBR {BR} at (157,33) size 0x0
- RenderInline {SPAN} at (0,0) size 132x17
- RenderText {#text} at (0,37) size 132x17
- text run at (0,37) width 132: "\x{915}\x{93F}\x{938}\x{940} \x{92D}\x{940} \x{924}\x{930}\x{939} \x{906}\x{917}\x{947} \x{92C}"
- RenderText {#text} at (132,37) size 25x18
- text run at (132,37) width 25: "Foo"
- RenderBR {BR} at (157,51) size 0x0
diff --git a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing.html b/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing.html
deleted file mode 100644
index 51d5455..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/hindi-spacing.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<input type="button" value="किसी भी तरह आगे ब" /><br>
-<span>किसी भी तरह आगे ब</span>Foo<br>
-<span style="font-family:'Times New Roman'">किसी भी तरह आगे ब</span>Foo<br>
-</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.checksum b/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.checksum
deleted file mode 100644
index 17effd2..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-11bef43fb39ab03340ac2a616250a2ec \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.png b/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.png
deleted file mode 100644
index 6a388b5..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.txt b/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.txt
deleted file mode 100644
index 94f0140..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc-expected.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock {P} at (0,0) size 784x36
- RenderText {#text} at (0,0) size 776x36
- text run at (0,0) width 358: "The column on the right has explicit spaces after each of "
- text run at (358,0) width 418: "U+3001 (ideographic comma) and U+3002 (ideographic full stop)"
- text run at (0,18) width 39: "while "
- text run at (39,18) width 417: "the left column does not. The left and the right columns should be "
- text run at (456,18) width 128: "rendered identically."
-layer at (240,60) size 98x162
- RenderBlock (positioned) {DIV} at (240,60) size 1x162
- RenderText {#text} at (0,0) size 98x162
- text run at (0,0) width 64: "Experts\x{3001}"
- text run at (0,18) width 98: "eWatch(TM)\x{3001}"
- text run at (0,36) width 40: "123\x{3001}"
- text run at (0,54) width 62: "abc456\x{3001}"
- text run at (0,72) width 88: "123Experts\x{3002}"
- text run at (0,90) width 98: "eWatch(TM)\x{3002}"
- text run at (0,108) width 40: "123\x{3002}"
- text run at (0,126) width 62: "abc456\x{3002}"
- text run at (0,144) width 24: "123"
-layer at (480,60) size 98x162
- RenderBlock (positioned) {DIV} at (480,60) size 1x162
- RenderText {#text} at (0,0) size 98x162
- text run at (0,0) width 64: "Experts\x{3001}"
- text run at (0,18) width 98: "eWatch(TM)\x{3001}"
- text run at (0,36) width 40: "123\x{3001}"
- text run at (0,54) width 62: "abc456\x{3001}"
- text run at (0,72) width 88: "123Experts\x{3002}"
- text run at (0,90) width 98: "eWatch(TM)\x{3002}"
- text run at (0,108) width 40: "123\x{3002}"
- text run at (0,126) width 62: "abc456\x{3002}"
- text run at (0,144) width 24: "123"
diff --git a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc.html b/webkit/data/layout_tests/pending/fast/text/international/ideo_punc.html
deleted file mode 100644
index 622cd57..0000000
--- a/webkit/data/layout_tests/pending/fast/text/international/ideo_punc.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
- <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>test case for webkit bug 15630</title>
-</head>
-<body>
-
- <p>The column on the right has explicit spaces after each of
- U+3001 (ideographic comma) and U+3002 (ideographic full stop) while
- the left column does not. The left and the right columns should be
- rendered identically.</p>
-
-<div style="width:1px; position:absolute; left:30%">
-Expertsã€eWatch(TM)ã€123ã€abc456ã€123Experts。eWatch(TM)。123。abc456。123
-</div>
-
-<div style="width:1px; position:absolute; left:60%">
-Experts〠eWatch(TM)〠123〠abc456〠123Experts。 eWatch(TM)。 123。 abc456。 123
-</div>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.checksum b/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.checksum
deleted file mode 100644
index 506960e..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-08580b8f1a97313ef7ace1588a5fc51e \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.png b/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.png
deleted file mode 100644
index 3dc628c..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.txt b/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.txt
deleted file mode 100644
index 0d304a1..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash-expected.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x36
- RenderText {#text} at (0,0) size 53x18
- text run at (0,0) width 53: "Test for "
- RenderInline {I} at (0,0) size 733x36
- RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
- RenderText {#text} at (53,0) size 301x18
- text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=17464"
- RenderText {#text} at (354,0) size 733x36
- text run at (354,0) width 4: " "
- text run at (358,0) width 375: "REGRESSION: Crash in RenderBlock::findNextLineBreak"
- text run at (0,18) width 250: "reading r30444 commit email in GMail"
- RenderText {#text} at (250,18) size 4x18
- text run at (250,18) width 4: "."
- RenderBlock {P} at (0,52) size 784x18
- RenderText {#text} at (0,0) size 156x18
- text run at (0,0) width 156: "No crash means success."
- RenderBlock {DIV} at (0,86) size 100x36
- RenderText {#text} at (0,0) size 84x18
- text run at (0,0) width 84: "Lorem ipsum"
- RenderWordBreak {WBR} at (0,0) size 0x0
- RenderText {#text} at (0,18) size 85x18
- text run at (0,18) width 85: "dolor sit amet"
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash.html b/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash.html
deleted file mode 100644
index 93751f8..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-in-pre-crash.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<p>
- Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=17464">http://bugs.webkit.org/show_bug.cgi?id=17464</a>
- REGRESSION: Crash in RenderBlock::findNextLineBreak reading r30444 commit email in GMail</i>.
-</p>
-<p>
- No crash means success.
-</p>
-<div style="width: 100px; white-space: pre-wrap;">Lorem ipsum<wbr>dolor sit amet</div>
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.checksum b/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.checksum
deleted file mode 100644
index 2117955..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-545b75a163410410049a5e1b28518b0d \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.png b/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.png
deleted file mode 100644
index d6a3316..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.txt b/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.txt
deleted file mode 100644
index 1bec4fe..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-styled-expected.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock {P} at (0,0) size 784x18
- RenderText {#text} at (0,0) size 90x18
- text run at (0,0) width 90: "This tests that "
- RenderInline {TT} at (0,0) size 24x15
- RenderText {#text} at (90,2) size 24x15
- text run at (90,2) width 24: "WBR"
- RenderText {#text} at (114,0) size 300x18
- text run at (114,0) width 300: " elements cannot be styled and that setting their "
- RenderInline {TT} at (0,0) size 64x15
- RenderText {#text} at (414,2) size 64x15
- text run at (414,2) width 64: "position"
- RenderText {#text} at (478,0) size 20x18
- text run at (478,0) width 20: " to "
- RenderInline {TT} at (0,0) size 64x15
- RenderText {#text} at (498,2) size 64x15
- text run at (498,2) width 64: "absolute"
- RenderText {#text} at (562,0) size 152x18
- text run at (562,0) width 152: " does not crash WebKit."
- RenderBlock {P} at (0,34) size 784x18
- RenderText {#text} at (0,0) size 126x18
- text run at (0,0) width 126: "There should be no "
- RenderWordBreak {WBR} at (0,0) size 0x0
- RenderText {#text} at (126,0) size 97x18
- text run at (126,0) width 97: "red on this line."
- RenderBlock {P} at (0,68) size 784x18
- RenderText {#text} at (0,0) size 124x18
- text run at (0,0) width 124: "No crashing, please"
- RenderWordBreak {WBR} at (0,0) size 0x0
- RenderText {#text} at (124,0) size 4x18
- text run at (124,0) width 4: "."
diff --git a/webkit/data/layout_tests/pending/fast/text/wbr-styled.html b/webkit/data/layout_tests/pending/fast/text/wbr-styled.html
deleted file mode 100644
index dafd2c3..0000000
--- a/webkit/data/layout_tests/pending/fast/text/wbr-styled.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<p>
- This tests that <tt>WBR</tt> elements cannot be styled and that setting their <tt>position</tt> to <tt>absolute</tt> does not crash WebKit.
-</p>
-<p>
- There should be no <wbr style="border: 5px solid red;">red on this line.
-</p>
-<p>
- No crashing, please<wbr style="position: absolute;">.
-</p>
diff --git a/webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts-expected.txt b/webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts-expected.txt
deleted file mode 100644
index e7aa9c2..0000000
--- a/webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This case is for testing multiple scripts which are nested in external script.
-SUCCESS (1 of 2) SUCCESS (2 of 2)
diff --git a/webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts.html b/webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts.html
deleted file mode 100644
index d62ac96..0000000
--- a/webkit/data/layout_tests/pending/fast/tokenizer/nested-multiple-scripts.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
- <body>
- This case is for testing multiple scripts which are nested in external script.<br>
- <script type="text/javascript" src="resources/external-script-1.js"></script>
- </body>
-</html>
diff --git a/webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-1.js b/webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-1.js
deleted file mode 100644
index e97ee9b..0000000
--- a/webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-1.js
+++ /dev/null
@@ -1,6 +0,0 @@
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-document.write("<script language=\"javascript\"> function put_content(msg){document.write(msg);} </scr" + "ipt> <script language=\"javascript\" src=\"resources/external-script-2.js\"></scr" + "ipt><script language=\"javascript\">\n");
-document.write("put_content(\"SUCCESS (2 of 2)\");");
-document.write("</scr"+"ipt>");
-
diff --git a/webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-2.js b/webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-2.js
deleted file mode 100644
index c0ab414..0000000
--- a/webkit/data/layout_tests/pending/fast/tokenizer/resources/external-script-2.js
+++ /dev/null
@@ -1,2 +0,0 @@
-document.write("SUCCESS (1 of 2)\n");
-
diff --git a/webkit/data/layout_tests/pending/fast/xsl/README b/webkit/data/layout_tests/pending/fast/xsl/README
deleted file mode 100644
index f2d82ddd..0000000
--- a/webkit/data/layout_tests/pending/fast/xsl/README
+++ /dev/null
@@ -1 +0,0 @@
-xslt-nested-stylesheets.xml: new test
diff --git a/webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets0.xsl b/webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets0.xsl
deleted file mode 100644
index 575481a..0000000
--- a/webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets0.xsl
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:import href="xslt-nested-stylesheets1.xsl"/>
-</xsl:stylesheet>
diff --git a/webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets1.xsl b/webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets1.xsl
deleted file mode 100644
index dbf6e15..0000000
--- a/webkit/data/layout_tests/pending/fast/xsl/resources/xslt-nested-stylesheets1.xsl
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
- <xsl:template match="/">
- <html>
- <body>
- <script>if (window.layoutTestController) layoutTestController.dumpAsText();</script>
- <div id="mydiv"><p>SUCCESS</p></div>
- </body>
- </html>
- </xsl:template>
-
-</xsl:stylesheet> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets-expected.txt b/webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets-expected.txt
deleted file mode 100644
index ff43ca4..0000000
--- a/webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-SUCCESS
diff --git a/webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets.xml b/webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets.xml
deleted file mode 100644
index 461aeba..0000000
--- a/webkit/data/layout_tests/pending/fast/xsl/xslt-nested-stylesheets.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet type="text/xsl" href="resources/xslt-nested-stylesheets0.xsl"?>
-
-<stylesheet-test/> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/http/tests/loading/README.txt b/webkit/data/layout_tests/pending/http/tests/loading/README.txt
deleted file mode 100644
index 8d8b5c4..0000000
--- a/webkit/data/layout_tests/pending/http/tests/loading/README.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-crash-multiple-family-fontface.html
--------------------------------------------
-This test should be removed once the issue is fixed upstream (https://bugs.webkit.org/show_bug.cgi?id=18378)
-Chrome has a hack in its forked webkit to avoid crashing (http://b/1063835)
-Note: this test is must be under http/ to trigger the crash (custom font cannot be local).
diff --git a/webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface-expected.txt b/webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface-expected.txt
deleted file mode 100644
index 54f7d31..0000000
--- a/webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-main frame - didStartProvisionalLoadForFrame
-main frame - didCommitLoadForFrame
-main frame - didHandleOnloadEventsForFrame
-main frame - didFinishDocumentLoadForFrame
-main frame - didFinishLoadForFrame
-Try to reference a custom font (@font-face) which was defined with more than 1 font-family.
-
-PASS if does not crash
diff --git a/webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface.html b/webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface.html
deleted file mode 100644
index 7e53cd5d..0000000
--- a/webkit/data/layout_tests/pending/http/tests/loading/crash-multiple-family-fontface.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<html>
-<head>
-<style>
- @font-face {
- font-family:morris,xx;
- /* Important: src cannot be local to trigger the crash */
- src:url(doesNotExist.ttf);
- }
- body {
- font:12px morris;
- }
-
-</style>
-<script>
- if (window.layoutTestController)
- window.layoutTestController.dumpAsText();
-</script>
-</head>
-<body>
- <p>Try to reference a custom font (@font-face) which was defined with more than 1 font-family.</p>
- <p>PASS if does not crash</p>
-</body>
-</html>
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/README b/webkit/data/layout_tests/pending/svg/carto.net/README
deleted file mode 100644
index d90d7f8..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/README
+++ /dev/null
@@ -1,9 +0,0 @@
-window.svg
-----------
-The original version of this test is flaky. A window decoration
-is added to one of the windows when it's create function is called
-via setTimeout. Usually, the create function is not called and
-the decoration is not added. However, in debug builds enough time
-may pass and the create function is called, the decoration added,
-and the diff fails. The test has been modified to wait until all
-create functions have been called before terminating.
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/button.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/button.js
deleted file mode 100644
index d6eab35..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/button.js
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
-Scripts to create interactive buttons in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.1.3, 2006-10-30
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* Bruce Rindahl and Virgis Globis for fixing an error with vertical positioning of the button texts
-* Olaf Schnabel for suggesting a bugfix where type conversion was missing when button text was of type number
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/button/
-
-----
-
-current version: 1.1.3
-
-version history:
-1.0 (2006-02-08)
-initial version
-
-1.0.1 (2006-03-11)
-changed parameters of constructor (styling system): now an array of literals containing presentation attributes. This allows for more flexibility in Styling. Added check for number of arguments.
-
-1.0.2 (2006-07-07)
-added the option to create multiline textbuttons, changed the behaviour of the y placement of the text in the button
-
-1.1 (2006-07-12)
-added .resize(width,height) and .moveTo(x.y) methods, added new constructor parameter parentNode, fixed a bug from version 1.0.2 in the method .setTextValue()
-
-1.1.1 (2006-10-23)
-fixed an error with vertical positioning of button texts (thanks Bruce and Virgis)
-changed DOM hierarchy slightly. Every button now has its own group "this.parentGroup". This is necessary to hide and show a button. This group should not be shared by other SVG elements, unless on purpose.
-adopted .resize() and .moveTo() methods to make use of the corrected function this.createButtonTexts();
-
-1.1.2 (2006-10-26)
-corrected a bug where type conversion in buttonText was missing when buttonText was of type number
-
-1.1.3 (2006-10-30)
-corrected a bug where the .deactivate() method did not work properly when called after the method .setTextValue()
-added support for "rx" and "ry" attribute in "this.deActivateRect"
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/button/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/button/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function button(id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset) {
- var nrArguments = 15;
- if (arguments.length > 0) {
- if (arguments.length == nrArguments) {
- this.init(id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset);
- }
- else {
- alert("Error in Button ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- }
-}
-
-button.prototype.init = function(id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset) {
- this.id = id; //the id where all new content is appended to
- this.parentNode = parentNode; //the id or node reference of the parent group where the button can be appended
- this.functionToCall = functionToCall; //function to be called if button was pressed
- this.buttonType = buttonType; //button type: currently either "rect" or "ellipse"
- this.buttonText = buttonText; //default value to be filled in when button is created
- this.buttonSymbolId = buttonSymbolId; //id to a symbol to be used as a button graphics
- this.x = x; //left of button rectangle
- this.y = y; //top of button rectangle
- this.width = width; //button rectangle width
- this.height = height; //button rectangle height
- this.textStyles = textStyles; //array of literals containing text styles
- if (!this.textStyles["font-size"]) {
- this.textStyles["font-size"] = 12;
- }
- this.buttonStyles = buttonStyles; //the fill color of the button rectangle or ellipse
- this.shadeLightStyles = shadeLightStyles; //light fill color simulating 3d effect
- this.shadeDarkStyles = shadeDarkStyles; //dark fill color simulating 3d effect
- this.shadowOffset = shadowOffset; //shadow offset in viewBox units
- this.upperLeftLine = null; //later a reference to the upper left line simulating 3d effect
- this.buttonRect = null; //later a reference to the button area (rect)
- this.buttonTextElement = null; //later a reference to the button text
- this.buttonSymbolInstance = null; //later a reference to the button symbol
- this.deActivateRect = null; //later a reference to a rectangle that can be used to deactivate the button
- this.activated = true; //a property indicating if button is activated or not
- this.lowerRightLine = null; //later a reference to the lower right line simulating 3d effect
- this.createButton(); //method to initialize button
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
-}
-
-//create button
-button.prototype.createButton = function() {
- var result = this.testParent();
- if (result) {
- //create upper left button line or ellipse
- if (this.buttonType == "rect") {
- this.upperLeftShadow = document.createElementNS(svgNS,"rect");
- this.upperLeftShadow.setAttributeNS(null,"x",this.x - this.shadowOffset);
- this.upperLeftShadow.setAttributeNS(null,"y",this.y - this.shadowOffset);
- this.upperLeftShadow.setAttributeNS(null,"width",this.width);
- this.upperLeftShadow.setAttributeNS(null,"height",this.height);
- this.upperLeftShadow.setAttributeNS(null,"points",this.x+","+(this.y+this.height)+" "+this.x+","+this.y+" "+(this.x+this.width)+","+this.y);
- }
- else if (this.buttonType == "ellipse") {
- this.upperLeftShadow = document.createElementNS(svgNS,"ellipse");
- this.upperLeftShadow.setAttributeNS(null,"cx",this.x + this.width * 0.5 - this.shadowOffset);
- this.upperLeftShadow.setAttributeNS(null,"cy",this.y + this.height * 0.5 - this.shadowOffset);
- this.upperLeftShadow.setAttributeNS(null,"rx",this.width * 0.5);
- this.upperLeftShadow.setAttributeNS(null,"ry",this.height * 0.5);
- }
- else {
- alert("buttonType '"+this.buttonType+"' not supported. You need to specify 'rect' or 'ellipse'");
- }
- for (var attrib in this.shadeLightStyles) {
- this.upperLeftShadow.setAttributeNS(null,attrib,this.shadeLightStyles[attrib]);
- }
- this.parentGroup.appendChild(this.upperLeftShadow);
-
- //create lower right button line or ellipse
- if (this.buttonType == "rect") {
- this.lowerRightShadow = document.createElementNS(svgNS,"rect");
- this.lowerRightShadow.setAttributeNS(null,"x",this.x + this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"y",this.y + this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"width",this.width);
- this.lowerRightShadow.setAttributeNS(null,"height",this.height);
- this.lowerRightShadow.setAttributeNS(null,"points",this.x+","+(this.y+this.height)+" "+this.x+","+this.y+" "+(this.x+this.width)+","+this.y);
- }
- else if (this.buttonType == "ellipse") {
- this.lowerRightShadow = document.createElementNS(svgNS,"ellipse");
- this.lowerRightShadow.setAttributeNS(null,"cx",this.x + this.width * 0.5 + this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"cy",this.y + this.height * 0.5 + this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"rx",this.width * 0.5);
- this.lowerRightShadow.setAttributeNS(null,"ry",this.height * 0.5);
- }
- for (var attrib in this.shadeDarkStyles) {
- this.lowerRightShadow.setAttributeNS(null,attrib,this.shadeDarkStyles[attrib]);
- }
- this.parentGroup.appendChild(this.lowerRightShadow);
-
- //create buttonRect
- if (this.buttonType == "rect") {
- this.buttonRect = document.createElementNS(svgNS,"rect");
- this.buttonRect.setAttributeNS(null,"x",this.x);
- this.buttonRect.setAttributeNS(null,"y",this.y);
- this.buttonRect.setAttributeNS(null,"width",this.width);
- this.buttonRect.setAttributeNS(null,"height",this.height);
- }
- else if (this.buttonType == "ellipse") {
- this.buttonRect = document.createElementNS(svgNS,"ellipse");
- this.buttonRect.setAttributeNS(null,"cx",this.x + this.width * 0.5);
- this.buttonRect.setAttributeNS(null,"cy",this.y + this.height * 0.5);
- this.buttonRect.setAttributeNS(null,"rx",this.width * 0.5);
- this.buttonRect.setAttributeNS(null,"ry",this.height * 0.5);
- }
- for (var attrib in this.buttonStyles) {
- this.buttonRect.setAttributeNS(null,attrib,this.buttonStyles[attrib]);
- }
- this.buttonRect.setAttributeNS(null,"cursor","pointer");
- this.buttonRect.addEventListener("mousedown",this,false);
- this.buttonRect.addEventListener("mouseup",this,false);
- this.buttonRect.addEventListener("click",this,false);
- this.parentGroup.appendChild(this.buttonRect);
-
- //call a helper method to create the text elements
- this.createButtonTexts();
-
- if (this.buttonSymbolId != undefined) {
- this.buttonSymbolInstance = document.createElementNS(svgNS,"use");
- this.buttonSymbolInstance.setAttributeNS(null,"x",(this.x + this.width / 2));
- this.buttonSymbolInstance.setAttributeNS(null,"y",(this.y + this.height / 2));
- this.buttonSymbolInstance.setAttributeNS(xlinkNS,"href","#"+this.buttonSymbolId);
- this.buttonSymbolInstance.setAttributeNS(null,"pointer-events","none");
- this.parentGroup.appendChild(this.buttonSymbolInstance);
- }
-
- //create rectangle to deactivate the button
- if (this.buttonType == "rect") {
- this.deActivateRect = document.createElementNS(svgNS,"rect");
- this.deActivateRect.setAttributeNS(null,"x",this.x - this.shadowOffset);
- this.deActivateRect.setAttributeNS(null,"y",this.y - this.shadowOffset);
- this.deActivateRect.setAttributeNS(null,"width",this.width + this.shadowOffset * 2);
- this.deActivateRect.setAttributeNS(null,"height",this.height + this.shadowOffset * 2);
- }
- else if (this.buttonType == "ellipse") {
- this.deActivateRect = document.createElementNS(svgNS,"ellipse");
- this.deActivateRect.setAttributeNS(null,"cx",this.x + this.width * 0.5);
- this.deActivateRect.setAttributeNS(null,"cy",this.y + this.height * 0.5);
- this.deActivateRect.setAttributeNS(null,"rx",this.width * 0.5 + this.shadowOffset);
- this.deActivateRect.setAttributeNS(null,"ry",this.height * 0.5 + this.shadowOffset);
- }
-
- this.deActivateRect.setAttributeNS(null,"fill","white");
- this.deActivateRect.setAttributeNS(null,"fill-opacity","0.5");
- this.deActivateRect.setAttributeNS(null,"stroke","none");
- this.deActivateRect.setAttributeNS(null,"display","none");
- this.deActivateRect.setAttributeNS(null,"cursor","default");
- if (this.buttonStyles["rx"]) {
- this.deActivateRect.setAttributeNS(null,"rx",this.buttonStyles["rx"]);
- }
- if (this.buttonStyles["ry"]) {
- this.deActivateRect.setAttributeNS(null,"ry",this.buttonStyles["ry"]);
- }
- this.parentGroup.appendChild(this.deActivateRect);
- }
- else {
- alert("could not create or reference 'parentNode' of button with id '"+this.id+"'");
- }
-}
-
-//test if parent group exists
-button.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- this.parentGroup = document.createElementNS(svgNS,"g");
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g" || this.parentNode.nodeName == "svg:svg" || this.parentNode.nodeName == "svg:g") {
- this.parentNode.appendChild(this.parentGroup);
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if button group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- document.getElementById(this.parentNode).appendChild(this.parentGroup);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-//move button to a new position
-button.prototype.moveTo = function(moveX,moveY) {
- this.x = moveX;
- this.y = moveY;
- //case rect
- if (this.buttonType == "rect") {
- this.upperLeftShadow.setAttributeNS(null,"x",this.x - this.shadowOffset);
- this.upperLeftShadow.setAttributeNS(null,"y",this.y - this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"x",this.x + this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"y",this.y + this.shadowOffset);
- this.buttonRect.setAttributeNS(null,"x",this.x);
- this.buttonRect.setAttributeNS(null,"y",this.y);
- }
- else if (this.buttonType == "ellipse") {
- this.upperLeftShadow.setAttributeNS(null,"cx",this.x + this.width * 0.5 - this.shadowOffset);
- this.upperLeftShadow.setAttributeNS(null,"cy",this.y + this.height * 0.5 - this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"cx",this.x + this.width * 0.5 + this.shadowOffset);
- this.lowerRightShadow.setAttributeNS(null,"cy",this.y + this.height * 0.5 + this.shadowOffset);
- this.buttonRect.setAttributeNS(null,"cx",this.x + this.width * 0.5);
- this.buttonRect.setAttributeNS(null,"cy",this.y + this.height * 0.5);
- }
- //reposition button text
- if (this.buttonText != undefined) {
- this.parentGroup.removeChild(this.buttonTextElement);
- this.createButtonTexts();
- }
-}
-
-//resize button to a new width and height
-button.prototype.resize = function(newWidth,newHeight) {
- this.width = newWidth;
- this.height = newHeight;
- //case rect
- if (this.buttonType == "rect") {
- this.upperLeftShadow.setAttributeNS(null,"width",this.width);
- this.upperLeftShadow.setAttributeNS(null,"height",this.height);
- this.lowerRightShadow.setAttributeNS(null,"width",this.width);
- this.lowerRightShadow.setAttributeNS(null,"height",this.height);
- this.buttonRect.setAttributeNS(null,"width",this.width);
- this.buttonRect.setAttributeNS(null,"height",this.height);
- }
- else if (this.buttonType == "ellipse") {
- this.upperLeftShadow.setAttributeNS(null,"rx",this.width * 0.5);
- this.upperLeftShadow.setAttributeNS(null,"ry",this.height * 0.5);
- this.lowerRightShadow.setAttributeNS(null,"rx",this.width * 0.5);
- this.lowerRightShadow.setAttributeNS(null,"ry",this.height * 0.5);
- this.buttonRect.setAttributeNS(null,"rx",this.width * 0.5);
- this.buttonRect.setAttributeNS(null,"ry",this.height * 0.5);
- }
- if (this.buttonText != undefined) {
- this.parentGroup.removeChild(this.buttonTextElement);
- this.createButtonTexts();
- }
-}
-
-//remove all button elements
-button.prototype.removeButton = function() {
- this.parentGroup.removeChild(this.upperLeftShadow);
- this.parentGroup.removeChild(this.lowerRightShadow);
- this.parentGroup.removeChild(this.buttonRect);
- if (this.buttonTextElement) {
- this.parentGroup.removeChild(this.buttonTextElement);
- }
- if (this.buttonSymbolInstance) {
- this.parentGroup.removeChild(this.buttonSymbolInstance);
- }
- this.parentGroup.removeChild(this.deActivateRect);
-}
-
-//hide button
-button.prototype.hideButton = function() {
- this.parentGroup.setAttributeNS(null,"display","none");
-}
-
-//show button
-button.prototype.showButton = function() {
- this.parentGroup.setAttributeNS(null,"display","inherit");
-}
-
-//event handling
-button.prototype.handleEvent = function(evt) {
- if (evt.type == "mousedown") {
- this.togglePressed("pressed");
- document.documentElement.addEventListener("mouseup",this,false);
- }
- if (evt.type == "mouseup") {
- this.togglePressed("released");
- document.documentElement.removeEventListener("mouseup",this,false);
- }
- if (evt.type == "click") {
- //for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround
- //attention: only some of the evt properties are forwarded here, you can add more, if you need them
- var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}
- this.timer.setTimeout("fireFunction",this.timerMs,timerEvt);
- }
-}
-
-button.prototype.togglePressed = function(type) {
- if (type == "pressed") {
- for (var attrib in this.shadeDarkStyles) {
- this.upperLeftShadow.setAttributeNS(null,attrib,this.shadeDarkStyles[attrib]);
- }
- for (var attrib in this.shadeLightStyles) {
- this.lowerRightShadow.setAttributeNS(null,attrib,this.shadeLightStyles[attrib]);
- }
- }
- if (type == "released") {
- for (var attrib in this.shadeDarkStyles) {
- this.lowerRightShadow.setAttributeNS(null,attrib,this.shadeDarkStyles[attrib]);
- }
- for (var attrib in this.shadeLightStyles) {
- this.upperLeftShadow.setAttributeNS(null,attrib,this.shadeLightStyles[attrib]);
- }
- }
-}
-
-button.prototype.fireFunction = function(evt) {
- if (typeof(this.functionToCall) == "function") {
- if (this.buttonTextElement) {
- this.functionToCall(this.id,evt,this.buttonText);
- }
- if (this.buttonSymbolInstance) {
- this.functionToCall(this.id,evt);
- }
- }
- if (typeof(this.functionToCall) == "object") {
- if (this.buttonTextElement) {
- this.functionToCall.buttonPressed(this.id,evt,this.buttonText);
- }
- if (this.buttonSymbolInstance) {
- this.functionToCall.buttonPressed(this.id,evt);
- }
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-button.prototype.getTextValue = function() {
- return this.buttonText;
-}
-
-button.prototype.setTextValue = function(value) {
- this.buttonText = value;
- //remove previous buttonTextElement
- if (this.buttonTextElement) {
- this.parentGroup.removeChild(this.buttonTextElement);
- }
- this.createButtonTexts();
-}
-
-//this is a helper function to create the text elements, it is used from two different methods, .createButton() and .setTextValue()
-button.prototype.createButtonTexts = function() {
- if (this.buttonText != undefined) {
- //first see if there is a multiline button
- var buttonTexts = String(this.buttonText).split("\n");
-
- //set a start y-offset
- var dy = this.textStyles["font-size"]*1.1;
-
- //if you don't like our method for y-positioning here, you can experiment with the formula here and define your own "initY"
- var initY = (this.height - dy * buttonTexts.length) / 2 + this.textStyles["font-size"];
-
- //create text element
- this.buttonTextElement = document.createElementNS(svgNS,"text");
- this.buttonTextElement.setAttributeNS(null,"x",(this.x + this.width / 2));
- this.buttonTextElement.setAttributeNS(null,"y",(this.y + initY));
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- this.buttonTextElement.setAttributeNS(null,attrib,value);
- }
- this.buttonTextElement.setAttributeNS(null,"pointer-events","none");
- this.buttonTextElement.setAttributeNS(null,"text-anchor","middle");
- this.buttonTextElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","space","preserve");
- for (var j=0;j<buttonTexts.length;j++) {
- var tspan = document.createElementNS(svgNS,"tspan");
- tspan.setAttributeNS(null,"x",(this.x + this.width / 2));
- if (j == 0) {
- tspan.setAttributeNS(null,"dy",0);
- }
- else {
- tspan.setAttributeNS(null,"dy",dy);
- }
- var textNode = document.createTextNode(buttonTexts[j]);
- tspan.appendChild(textNode);
- this.buttonTextElement.appendChild(tspan);
- }
- this.parentGroup.appendChild(this.buttonTextElement);
- }
-}
-
-button.prototype.activate = function(value) {
- this.deActivateRect.setAttributeNS(null,"display","none");
- this.activated = true;
-}
-
-button.prototype.deactivate = function(value) {
- this.deActivateRect.setAttributeNS(null,"display","inherit");
- this.parentGroup.appendChild(this.deActivateRect);
- this.activated = false;
-}
-
-//switchbutton
-//initialize inheritance
-switchbutton.prototype = new button();
-switchbutton.prototype.constructor = switchbutton;
-switchbutton.superclass = button.prototype;
-
-function switchbutton(id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset) {
- var nrArguments = 15;
- if (arguments.length > 0) {
- if (arguments.length == nrArguments) {
- this.init(id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset);
- }
- else {
- alert("Error in Switchbutton ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- }
-}
-
-switchbutton.prototype.init = function(id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset) {
- switchbutton.superclass.init.call(this,id,parentNode,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,textStyles,buttonStyles,shadeLightStyles,shadeDarkStyles,shadowOffset);
- this.on = false;
-}
-
-//overwriting handleEventcode
-switchbutton.prototype.handleEvent = function(evt) {
- //for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround
- //attention: only some of the evt properties are forwarded here, you can add more, if you need them
- var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}
- if (evt.type == "click") {
- if (this.on) {
- this.on = false;
- this.togglePressed("released");
- this.timer.setTimeout("fireFunction",this.timerMs,timerEvt);
- }
- else {
- this.on = true;
- this.togglePressed("pressed");
- this.timer.setTimeout("fireFunction",this.timerMs,timerEvt);
- }
- }
-}
-
-switchbutton.prototype.getSwitchValue = function() {
- return this.on;
-}
-
-switchbutton.prototype.setSwitchValue = function(onOrOff,firefunction) {
- this.on = onOrOff;
- //artificial timer event - don't use the values!
- var timerEvt = {x:0,y:0,type:"click",detail:1,timeStamp:0}
- if (this.on) {
- this.togglePressed("pressed");
- if (firefunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,timerEvt);
- }
- }
- else {
- this.togglePressed("released");
- if (firefunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,timerEvt);
- }
- }
-}
-
-//overwriting fireFunction code
-switchbutton.prototype.fireFunction = function(evt) {
- if (typeof(this.functionToCall) == "function") {
- if (this.buttonTextElement) {
- this.functionToCall(this.id,evt,this.on,this.buttonText);
- }
- if (this.buttonSymbolInstance) {
- this.functionToCall(this.id,evt,this.on);
- }
- }
- if (typeof(this.functionToCall) == "object") {
- if (this.buttonTextElement) {
- this.functionToCall.buttonPressed(this.id,evt,this.on,this.buttonText);
- }
- if (this.buttonSymbolInstance) {
- this.functionToCall.buttonPressed(this.id,evt,this.on);
- }
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/colourPicker.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/colourPicker.js
deleted file mode 100644
index f008091..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/colourPicker.js
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
-Scripts to create interactive colour pickers in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.0, 2006-10-26
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* none so far
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/colourPicker/
-
-----
-
-current version: 1.0
-
-version history:
-1.0 (2006-10-26)
-initial version
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/colourPicker/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/colourPicker/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function colourPicker(id,parentNode,x,y,width,height,bgstyles,textstyles,sliderSymbId,satSliderVisible,valSliderVisible,alphaSliderVisible,colValTextVisible,fillVisible,strokeVisible,startHue,endHue,nrStopVals,fillStartColor,strokeStartColor,functionToCall) {
- var nrArguments = 21;
- var createColourPicker= true;
- if (arguments.length == nrArguments) {
- this.id = id; //the id of the colour picker
- this.parentNode = parentNode; //the id or node reference of the parent group where the button can be appended
- this.x = x; //upper left corner of colour picker
- this.y = y; //upper left corner of colour picker
- this.width = width; //width of colour picker
- this.height = height; //height of colour picker
- this.bgstyles = bgstyles; //an array of literals containing presentation attributes of the colourpicker background
- this.textstyles = textstyles; //if shadowcolor = none than no shadow will be used
- this.sliderSymbId = sliderSymbId; //id referencing the slider symbol to be used for the sliders
- this.satSliderVisible = satSliderVisible; //possible values for visibility: true/false
- this.valSliderVisible = valSliderVisible; //possible values for visibility: true/false
- this.alphaSliderVisible = alphaSliderVisible; //possible values for visibility: true/false
- this.colValTextVisible = colValTextVisible; //possible values for visibility: true/false
- this.fillVisible = fillVisible; //possible values for visibility: true/false
- this.strokeVisible = strokeVisible; //possible values for visibility: true/false
- this.startHue = startHue; //start hue in degree (0 to 360)
- this.endHue = endHue; //end hue in degree (0 to 360), end hue should be larger than start hue
- this.nrStopVals = nrStopVals; //nr of stop vals in between, in addition to start and end
- this.fillStartColors = fillStartColor.split(","); //string, rgba.format, f.e. 255,0,0,1
- this.strokeStartColors = strokeStartColor.split(","); //string, rgba.format, f.e. 255,0,0,1
- this.functionToCall = functionToCall; //a function or object to call, in case of an object, the method "getColor" is called; if you don't need any, than just say undefined
- if (this.fillVisible) {
- this.activeColourType = "fill";
- }
- else {
- this.activeColourType = "stroke";
- }
- //now test if defs section is available
- try {
- this.svgdefs = document.getElementsByTagNameNS(svgNS,"defs").item(0);
- }
- catch (ex) {
- createColourPicker = false;
- alert("Error "+ex+", Could not find a <defs /> section in your svg-file!\nPlease add at least an empty <defs /> element!");
- }
- this.created = false;
- }
- else {
- createColourPicker = false;
- alert("Error in colourPicker ("+id+") constructor: wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createColourPicker) {
- this.createColourpicker();
- }
- else {
- alert("Could not create colourPicker with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-//test if parent group exists
-colourPicker.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- this.parentGroup = document.createElementNS(svgNS,"g");
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g" || this.parentNode.nodeName == "svg:svg" || this.parentNode.nodeName == "svg:g") {
- this.parentNode.appendChild(this.parentGroup);
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if button group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- document.getElementById(this.parentNode).appendChild(this.parentGroup);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-
-colourPicker.prototype.createColourpicker = function() {
- var result = this.testParent();
- if (result) {
- this.nrSliders = 1; //these are to define the distribution along y-axis
- this.nrRects = 0; //these are to define the distribution along x-axis
-
- //create gradients in defs section
- //hueGradient
- var hueGradientDefs = document.createElementNS(svgNS,"linearGradient");
- hueGradientDefs.setAttributeNS(null,"id",this.id+"_hueGradient");
- var curHue = this.startHue;
- var curPerc = 0;
- var hueIncr = (this.endHue - this.startHue) / (this.nrStopVals - 1);
- var percIncr = 100 / (this.nrStopVals - 1);
- for (i = 0;i<this.nrStopVals;i++) {
- if (curPerc > 100) {
- curPerc = 100;
- }
- if (curHue > this.endHue) {
- curHue = this.endHue;
- }
- var stopVal = document.createElementNS(svgNS,"stop");
- stopVal.setAttributeNS(null,"offset",curPerc+"%");
- myRgbArr = hsv2rgb(Math.round(curHue),1,1);
- stopVal.setAttributeNS(null,"stop-color","rgb("+myRgbArr['red']+","+myRgbArr['green']+","+myRgbArr['blue']+")");
- hueGradientDefs.appendChild(stopVal);
- curPerc += percIncr;
- curHue += hueIncr;
- }
- if (this.created) {
- this.svgdefs.replaceChild(hueGradientDefs,document.getElementById(this.id+"_hueGradient"));
- }
- else {
- this.svgdefs.appendChild(hueGradientDefs);
- }
- //generate satGradient if visible
- if (this.satSliderVisible) {
- var satGradientDefs = document.createElementNS(svgNS,"linearGradient");
- satGradientDefs.setAttributeNS(null,"id",this.id+"_satGradient");
- this.satStartGradient = document.createElementNS(svgNS,"stop");
- this.satStartGradient.setAttributeNS(null,"offset","0%");
- this.satStartGradient.setAttributeNS(null,"stop-color","rgb(255,255,255)");
- satGradientDefs.appendChild(this.satStartGradient);
- this.satEndGradient = document.createElementNS(svgNS,"stop");
- this.satEndGradient.setAttributeNS(null,"offset","100%");
- this.satEndGradient.setAttributeNS(null,"stop-color","rgb(255,0,0)");
- satGradientDefs.appendChild(this.satEndGradient);
- if (this.created) {
- this.svgdefs.replaceChild(satGradientDefs,document.getElementById(this.id+"_satGradient"));
- }
- else {
- this.svgdefs.appendChild(satGradientDefs);
- }
- this.nrSliders++;
- }
- //generate valGradient if visible
- if (this.valSliderVisible) {
- var valGradientDefs = document.createElementNS(svgNS,"linearGradient");
- valGradientDefs.setAttributeNS(null,"id",this.id+"_valGradient");
- this.valStartGradient = document.createElementNS(svgNS,"stop");
- this.valStartGradient.setAttributeNS(null,"offset","0%");
- this.valStartGradient.setAttributeNS(null,"stop-color","rgb(0,0,0)");
- valGradientDefs.appendChild(this.valStartGradient);
- this.valEndGradient = document.createElementNS(svgNS,"stop");
- this.valEndGradient.setAttributeNS(null,"offset","100%");
- this.valEndGradient.setAttributeNS(null,"stop-color","rgb(255,0,0)");
- valGradientDefs.appendChild(this.valEndGradient);
- if (this.created) {
- this.svgdefs.replaceChild(valGradientDefs,document.getElementById(this.id+"_valGradient"));
- }
- else {
- this.svgdefs.appendChild(valGradientDefs);
- }
- this.nrSliders++;
- }
- //generate opacityGradient if visible
- if (this.alphaSliderVisible) {
- var alphaGradientDefs = document.createElementNS(svgNS,"linearGradient");
- alphaGradientDefs.setAttributeNS(null,"id",this.id+"_alphaGradient");
- this.alphaStartGradient = document.createElementNS(svgNS,"stop");
- this.alphaStartGradient.setAttributeNS(null,"offset","0%");
- this.alphaStartGradient.setAttributeNS(null,"stop-color","rgb(255,0,0)");
- this.alphaStartGradient.setAttributeNS(null,"stop-opacity",0);
- alphaGradientDefs.appendChild(this.alphaStartGradient );
- this.alphaEndGradient = document.createElementNS(svgNS,"stop");
- this.alphaEndGradient.setAttributeNS(null,"offset","100%");
- this.alphaEndGradient.setAttributeNS(null,"stop-color","rgb(255,0,0)");
- this.alphaEndGradient.setAttributeNS(null,"stop-opacity",1);
- alphaGradientDefs.appendChild(this.alphaEndGradient);
- if (this.created) {
- this.svgdefs.replaceChild(alphaGradientDefs,document.getElementById(this.id+"_alphaGradient"));
- }
- else {
- this.svgdefs.appendChild(alphaGradientDefs);
- }
- this.nrSliders++;
- }
-
- //create bg rectangle
- var bgRect = document.createElementNS(svgNS,"rect");
- bgRect.setAttributeNS(null,"x",this.x);
- bgRect.setAttributeNS(null,"y",this.y);
- bgRect.setAttributeNS(null,"width",this.width);
- bgRect.setAttributeNS(null,"height",this.height);
- for (var attrib in this.bgstyles) {
- bgRect.setAttributeNS(null,attrib,this.bgstyles[attrib]);
- }
- this.parentGroup.appendChild(bgRect);
-
- //now createSliders
- var invisSliderLineWidth = this.width * 0.05;
- var slidRectHeight = invisSliderLineWidth * 0.5;
- var sliderStyles = {"stroke":"none","fill":"none"};
- var yNew = this.y + this.height * 0.13;
- var yNewInc = this.height * 0.8 / this.nrSliders;
- //create hue slider
- //first create rectangle behind slider to hold gradient
- this.rectHue = document.createElementNS(svgNS,"rect");
- this.rectHue.setAttributeNS(null,"x",(this.x + this.width * 0.04));
- this.rectHue.setAttributeNS(null,"y",(yNew - slidRectHeight * 0.5));
- this.rectHue.setAttributeNS(null,"width",(this.x + this.width * 0.7)-(this.x + this.width * 0.04));
- this.rectHue.setAttributeNS(null,"height",slidRectHeight);
- this.rectHue.setAttributeNS(null,"fill","url(#"+this.id+"_hueGradient)");
- this.parentGroup.appendChild(this.rectHue);
- this.slidHue = new slider("hueSlider_"+this.id,this.parentGroup,this.x + this.width * 0.04,yNew,this.startHue,this.x + this.width * 0.7,yNew,this.endHue,0,sliderStyles,invisSliderLineWidth,this.sliderSymbId,this,true);
- var hueText = document.createElementNS(svgNS,"text");
- hueText.setAttributeNS(null,"x",this.slidHue.x2 + this.width * 0.02);
- hueText.setAttributeNS(null,"y",this.slidHue.y2 + this.width * 0.015);
- hueText.setAttributeNS(null,"pointer-events","none");
- for (var attrib in this.textstyles) {
- hueText.setAttributeNS(null,attrib,this.textstyles[attrib]);
- }
- var hueTextNode = document.createTextNode("Hue ("+this.startHue+String.fromCharCode(176)+"-"+this.endHue+String.fromCharCode(176)+")");
- hueText.appendChild(hueTextNode);
- this.parentGroup.appendChild(hueText);
-
- //create rects to show colour values for fill and stroke
- if (this.strokeVisible) {
- this.strokeRect = document.createElementNS(svgNS,"rect");
- if (this.fillVisible) {
- this.strokeRect.setAttributeNS(null,"x",this.slidHue.x1 + this.width * 0.1);
- this.strokeRect.setAttributeNS(null,"y",this.y + this.height * 0.45);
- }
- else {
- this.strokeRect.setAttributeNS(null,"x",this.slidHue.x1);
- this.strokeRect.setAttributeNS(null,"y",this.y + this.height * 0.3);
- }
- this.strokeRect.setAttributeNS(null,"width",this.width * 0.15);
- this.strokeRect.setAttributeNS(null,"height",this.height * 0.3);
- this.strokeRect.setAttributeNS(null,"fill","none");
- this.strokeRect.setAttributeNS(null,"stroke","rgb("+this.strokeStartColors[0]+","+this.strokeStartColors[1]+","+this.strokeStartColors[2]+")");
- this.strokeRect.setAttributeNS(null,"stroke-width",invisSliderLineWidth * 0.5);
- this.strokeRect.setAttributeNS(null,"stroke-opacity",this.strokeStartColors[3]);
- this.strokeRect.setAttributeNS(null,"id",this.id+"_strokeColour");
- this.strokeRect.setAttributeNS(null,"pointer-events","all");
- this.strokeRect.addEventListener("click",this,false);
- this.parentGroup.appendChild(this.strokeRect);
- this.nrRects++;
- }
- if (this.fillVisible) {
- this.fillRect = document.createElementNS(svgNS,"rect");
- this.fillRect.setAttributeNS(null,"x",this.slidHue.x1);
- this.fillRect.setAttributeNS(null,"y",this.y + this.height * 0.3);
- this.fillRect.setAttributeNS(null,"width",this.width * 0.15);
- this.fillRect.setAttributeNS(null,"height",this.height * 0.3);
- this.fillRect.setAttributeNS(null,"fill","rgb("+this.fillStartColors[0]+","+this.fillStartColors[1]+","+this.fillStartColors[2]+")");
- this.fillRect.setAttributeNS(null,"fill-opacity",this.fillStartColors[3]);
- this.fillRect.setAttributeNS(null,"id",this.id+"_fillColour");
- this.fillRect.addEventListener("click",this,false);
- if (this.activeColourType == "stroke") {
- this.parentGroup.insertBefore(this.fillRect,this.strokeRect);
- }
- else {
- this.parentGroup.appendChild(this.fillRect);
- }
- this.nrRects++;
- }
-
- switch(this.nrRects) {
- case 0:
- slidLeft = this.slidHue.x1;
- break;
- case 1:
- slidLeft = this.slidHue.x1 + this.width * 0.2;
- break;
- default:
- slidLeft = this.slidHue.x1 + this.width * 0.3;
- break;
- }
-
- yNew = yNew + yNewInc;
- if (this.satSliderVisible) {
- //create rectangle to hold sat gradient
- this.rectSat = document.createElementNS(svgNS,"rect");
- this.rectSat.setAttributeNS(null,"x",slidLeft);
- this.rectSat.setAttributeNS(null,"y",(yNew - slidRectHeight * 0.5));
- this.rectSat.setAttributeNS(null,"width",(this.x + this.width * 0.7)-slidLeft);
- this.rectSat.setAttributeNS(null,"height",slidRectHeight);
- this.rectSat.setAttributeNS(null,"fill","url(#"+this.id+"_satGradient)");
- this.parentGroup.appendChild(this.rectSat);
- //create sat slider
- this.slidSat = new slider("satSlider_"+this.id,this.parentGroup,slidLeft,yNew,0,this.x + this.width * 0.7,yNew,100,100,sliderStyles,invisSliderLineWidth,this.sliderSymbId,this,true);
- var satText = document.createElementNS(svgNS,"text");
- for (var attrib in this.textstyles) {
- satText.setAttributeNS(null,attrib,this.textstyles[attrib]);
- }
- satText.setAttributeNS(null,"pointer-events","none");
- satText.setAttributeNS(null,"x",this.slidSat.x2 + this.width * 0.02);
- satText.setAttributeNS(null,"y",this.slidSat.y2 + this.width * 0.015);
- var satTextNode = document.createTextNode("Saturation (%)");
- satText.appendChild(satTextNode);
- this.parentGroup.appendChild(satText);
- yNew = yNew + yNewInc;
- }
- if (this.valSliderVisible) {
- //create rectangle to hold val gradient
- this.rectVal = document.createElementNS(svgNS,"rect");
- this.rectVal.setAttributeNS(null,"x",slidLeft);
- this.rectVal.setAttributeNS(null,"y",(yNew - slidRectHeight * 0.5));
- this.rectVal.setAttributeNS(null,"width",(this.x + this.width * 0.7)-slidLeft);
- this.rectVal.setAttributeNS(null,"height",slidRectHeight);
- this.rectVal.setAttributeNS(null,"fill","url(#"+this.id+"_valGradient)");
- this.parentGroup.appendChild(this.rectVal);
- //create val slider
- this.slidVal = new slider("valSlider_"+this.id,this.parentGroup,slidLeft,yNew,0,this.x + this.width * 0.7,yNew,100,100,sliderStyles,invisSliderLineWidth,this.sliderSymbId,this,true);
- var valText = document.createElementNS(svgNS,"text");
- for (var attrib in this.textstyles) {
- valText.setAttributeNS(null,attrib,this.textstyles[attrib]);
- }
- valText.setAttributeNS(null,"pointer-events","none");
- valText.setAttributeNS(null,"x",this.slidVal.x2 + this.width * 0.02);
- valText.setAttributeNS(null,"y",this.slidVal.y2 + this.width * 0.015);
- var valTextNode = document.createTextNode("Value (%)");
- valText.appendChild(valTextNode);
- this.parentGroup.appendChild(valText);
- yNew = yNew + yNewInc;
- }
- if (this.alphaSliderVisible) {
- //create rectangle to hold alpha gradient
- this.rectAlpha = document.createElementNS(svgNS,"rect");
- this.rectAlpha.setAttributeNS(null,"x",slidLeft);
- this.rectAlpha.setAttributeNS(null,"y",(yNew - slidRectHeight * 0.5));
- this.rectAlpha.setAttributeNS(null,"width",(this.x + this.width * 0.7)-slidLeft);
- this.rectAlpha.setAttributeNS(null,"height",slidRectHeight);
- this.rectAlpha.setAttributeNS(null,"fill","url(#"+this.id+"_alphaGradient)");
- this.parentGroup.appendChild(this.rectAlpha);
- //create val slider
- this.slidAlpha = new slider("alphaSlider_"+this.id,this.parentGroup,slidLeft,yNew,0,this.x + this.width * 0.7,yNew,100,100,sliderStyles,invisSliderLineWidth,this.sliderSymbId,this,true);
- var alphaText = document.createElementNS(svgNS,"text");
- for (var attrib in this.textstyles) {
- alphaText.setAttributeNS(null,attrib,this.textstyles[attrib]);
- }
- alphaText.setAttributeNS(null,"pointer-events","none");
- alphaText.setAttributeNS(null,"x",this.slidAlpha.x2 + this.width * 0.02);
- alphaText.setAttributeNS(null,"y",this.slidAlpha.y2 + this.width * 0.015);
- var alphaTextNode = document.createTextNode("Opacity (%)");
- alphaText.appendChild(alphaTextNode);
- this.parentGroup.appendChild(alphaText);
- }
- //create text to hold rgb/hsv values
- if (this.colValTextVisible) {
- this.colValText = document.createElementNS(svgNS,"text");
- for (var attrib in this.textstyles) {
- this.colValText.setAttributeNS(null,attrib,this.textstyles[attrib]);
- }
- this.colValText.setAttributeNS(null,"x",this.slidHue.x1);
- this.colValText.setAttributeNS(null,"y",this.y + this.height * 0.95);
- var textNode = document.createTextNode("RGB: 255,0,0; HSV: 0,100,100");
- this.colValText.appendChild(textNode);
- this.parentGroup.appendChild(this.colValText);
- }
-
- fillHSVvar = rgb2hsv(parseInt(this.fillStartColors[0]),parseInt(this.fillStartColors[1]),parseInt(this.fillStartColors[2]));
- strokeHSVvar = rgb2hsv(parseInt(this.strokeStartColors[0]),parseInt(this.strokeStartColors[1]),parseInt(this.strokeStartColors[2]));
- this.hue = new Array();
- this.hue["fill"] = fillHSVvar["hue"];
- this.hue["stroke"] = strokeHSVvar["hue"];
- this.sat = new Array();
- this.sat["fill"] = fillHSVvar["sat"];
- this.sat["stroke"] = strokeHSVvar["sat"];
- this.val = new Array();
- this.val["fill"] = fillHSVvar["val"];
- this.val["stroke"] = strokeHSVvar["val"];
- this.alpha = new Array();
- this.alpha["fill"] = parseFloat(this.fillStartColors[3]);
- this.alpha["stroke"] = parseFloat(this.strokeStartColors[3]);
- this.rgbArr = new Array();
- this.rgbArr["fill"] = hsv2rgb(this.hue["fill"],this.sat["fill"],this.val["fill"]);
- this.rgbArr["stroke"] = hsv2rgb(this.hue["stroke"],this.sat["stroke"],this.val["stroke"]);
- this.setRGBAColour(this.activeColourType,this.rgbArr[this.activeColourType]["red"],this.rgbArr[this.activeColourType]["green"],this.rgbArr[this.activeColourType]["blue"],this.alpha[this.activeColourType],false);
-
- //indicate that it was created once
- this.created = true;
- }
- else {
- alert("could not create or reference 'parentNode' of button with id '"+this.id+"'");
- }
-}
-
-colourPicker.prototype.handleEvent = function(evt) {
- var el = evt.target;
- if (evt.type == "click") {
- var id = el.getAttributeNS(null,"id");
- if (id == this.id+"_fillColour") {
- this.activeColourType = "fill";
- if (this.strokeVisible) {
- this.parentGroup.insertBefore(this.strokeRect,this.fillRect);
- }
- }
- if (id == this.id+"_strokeColour") {
- this.activeColourType = "stroke";
- if (this.fillVisible) {
- this.parentGroup.insertBefore(this.fillRect,this.strokeRect);
- }
- }
- if (id == this.id+"_fillColour" || id == this.id+"_strokeColour") {
- this.setRGBAColour(this.activeColourType,this.rgbArr[this.activeColourType]["red"],this.rgbArr[this.activeColourType]["green"],this.rgbArr[this.activeColourType]["blue"],this.alpha[this.activeColourType],false);
- }
- }
-}
-
-//this method should be used from external
-colourPicker.prototype.getValues = function() {
- var result = {"fill":{"red":this.rgbArr["fill"]["red"],"green":this.rgbArr["fill"]["green"],"blue":this.rgbArr["fill"]["blue"],"alpha":this.alpha["fill"],"hue":this.hue["fill"],"sat":this.sat["fill"],"val":this.val["fill"]},"stroke":{"red":this.rgbArr["stroke"]["red"],"green":this.rgbArr["stroke"]["green"],"blue":this.rgbArr["stroke"]["blue"],"alpha":this.alpha["stroke"],"hue":this.hue["stroke"],"sat":this.sat["stroke"],"val":this.val["stroke"]}};
- return result;
-}
-
-//this method is used by this object but may be also used from external
-colourPicker.prototype.setRGBAColour = function(colourType,red,green,blue,alpha,fireFunction) {
- //colourType = fill|stroke
- hsvArr = rgb2hsv(red,green,blue);
- this.hue[colourType] = hsvArr["hue"];
- this.sat[colourType] = hsvArr["sat"];
- this.val[colourType] = hsvArr["val"];
- this.alpha[colourType] = alpha;
- this.rgbArr[colourType]["red"] = red;
- this.rgbArr[colourType]["green"] = green;
- this.rgbArr[colourType]["blue"] = blue;
- if (colourType == this.activeColourType) {
- this.slidHue.setValue(this.hue[colourType]);
- if (this.satSliderVisible) {
- this.slidSat.setValue(Math.round(this.sat[colourType] * 100));
- rgbSatEnd = hsv2rgb(this.hue[this.activeColourType],1,this.val[this.activeColourType]);
- rgbSatStart = hsv2rgb(this.hue[this.activeColourType],0,this.val[this.activeColourType]);
- this.satStartGradient.setAttributeNS(null,"stop-color","rgb("+rgbSatStart["red"]+","+rgbSatStart["green"]+","+rgbSatStart["blue"]+")");
- this.satEndGradient.setAttributeNS(null,"stop-color","rgb("+rgbSatEnd["red"]+","+rgbSatEnd["green"]+","+rgbSatEnd["blue"]+")");
- if (myMapApp.navigator == "Batik") {
- this.rectSat.removeAttributeNS(null,"fill");
- this.rectSat.setAttributeNS(null,"fill","url(#"+this.id+"_satGradient)");
- }
- }
- if (this.valSliderVisible) {
- this.slidVal.setValue(Math.round(this.val[colourType] * 100));
- rgbValEnd = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],1);
- rgbValStart = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],0);
- this.valStartGradient.setAttributeNS(null,"stop-color","rgb("+rgbValStart["red"]+","+rgbValStart["green"]+","+rgbValStart["blue"]+")");
- this.valEndGradient.setAttributeNS(null,"stop-color","rgb("+rgbValEnd["red"]+","+rgbValEnd["green"]+","+rgbValEnd["blue"]+")");
- if (myMapApp.navigator == "Batik") {
- this.rectVal.removeAttributeNS(null,"fill");
- this.rectVal.setAttributeNS(null,"fill","url(#"+this.id+"_valGradient)");
- }
- }
- if (this.alphaSliderVisible) {
- this.slidAlpha.setValue(Math.round(this.alpha[colourType] * 100));
- rgbAlpha = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],this.val[this.activeColourType]);
- this.alphaStartGradient.setAttributeNS(null,"stop-color","rgb("+rgbAlpha["red"]+","+rgbAlpha["green"]+","+rgbAlpha["blue"]+")");
- this.alphaEndGradient.setAttributeNS(null,"stop-color","rgb("+rgbAlpha["red"]+","+rgbAlpha["green"]+","+rgbAlpha["blue"]+")");
- if (myMapApp.navigator == "Batik") {
- this.rectAlpha.removeAttributeNS(null,"fill");
- this.rectAlpha.setAttributeNS(null,"fill","url(#"+this.id+"_alphaGradient)");
- }
- }
- if (this.colValTextVisible) {
- this.colValText.firstChild.nodeValue = "RGBA: "+this.rgbArr[this.activeColourType]["red"]+","+this.rgbArr[this.activeColourType]["green"]+","+this.rgbArr[this.activeColourType]["blue"]+","+Math.round(this.alpha[this.activeColourType] * 100) +"; HSVA: "+this.hue[this.activeColourType]+","+Math.round(this.sat[this.activeColourType] * 100)+","+Math.round(this.val[this.activeColourType] * 100)+","+Math.round(this.alpha[this.activeColourType] * 100);
- }
- }
- //set values in fill and stroke rectangles
- if (colourType == "stroke") {
- this.strokeRect.setAttributeNS(null,"stroke","rgb("+red+","+green+","+blue+")");
- this.strokeRect.setAttributeNS(null,"stroke-opacity",alpha);
- }
- if (colourType == "fill") {
- this.fillRect.setAttributeNS(null,"fill","rgb("+red+","+green+","+blue+")");
- this.fillRect.setAttributeNS(null,"fill-opacity",alpha);
- }
- if (fireFunction) {
- this.fireFunction();
- }
-}
-
-//this is a helper method to be used by this object only
-colourPicker.prototype.getSliderVal = function(changeType,sliderId,slidValue) {
- //get all colour values from sliders
- if (sliderId == "hueSlider_"+this.id) {
- this.hue[this.activeColourType] = Math.round(this.slidHue.value);
- }
- if (sliderId == "satSlider_"+this.id && this.satSliderVisible) {
- this.sat[this.activeColourType] = Math.round(this.slidSat.value) / 100;
- }
- if (sliderId == "valSlider_"+this.id && this.valSliderVisible) {
- this.val[this.activeColourType] = Math.round(this.slidVal.value) / 100;
- }
- if (sliderId == "alphaSlider_"+this.id && this.alphaSliderVisible) {
- this.alpha[this.activeColourType] = Math.round(this.slidAlpha.value) / 100;
- }
- this.rgbArr[this.activeColourType] = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],this.val[this.activeColourType]);
- if (this.fillVisible && this.activeColourType == "fill") {
- this.fillRect.setAttributeNS(null,"fill","rgb("+this.rgbArr["fill"]["red"]+","+this.rgbArr["fill"]["green"]+","+this.rgbArr["fill"]["blue"]+")");
- this.fillRect.setAttributeNS(null,"fill-opacity",this.alpha[this.activeColourType]);
- }
- if (this.strokeVisible && this.activeColourType == "stroke") {
- this.strokeRect.setAttributeNS(null,"stroke","rgb("+this.rgbArr["stroke"]["red"]+","+this.rgbArr["stroke"]["green"]+","+this.rgbArr["stroke"]["blue"]+")");
- this.strokeRect.setAttributeNS(null,"stroke-opacity",this.alpha[this.activeColourType]);
- }
- if (this.colValTextVisible) {
- this.colValText.firstChild.nodeValue = "RGBA: "+this.rgbArr[this.activeColourType]["red"]+","+this.rgbArr[this.activeColourType]["green"]+","+this.rgbArr[this.activeColourType]["blue"]+","+Math.round(this.alpha[this.activeColourType] * 100) +"; HSVA: "+this.hue[this.activeColourType]+","+Math.round(this.sat[this.activeColourType] * 100)+","+Math.round(this.val[this.activeColourType] * 100)+","+Math.round(this.alpha[this.activeColourType] * 100);
- }
- if (this.satSliderVisible) {
- rgbSatEnd = hsv2rgb(this.hue[this.activeColourType],1,this.val[this.activeColourType]);
- rgbSatStart = hsv2rgb(this.hue[this.activeColourType],0,this.val[this.activeColourType]);
- this.satStartGradient.setAttributeNS(null,"stop-color","rgb("+rgbSatStart["red"]+","+rgbSatStart["green"]+","+rgbSatStart["blue"]+")");
- this.satEndGradient.setAttributeNS(null,"stop-color","rgb("+rgbSatEnd["red"]+","+rgbSatEnd["green"]+","+rgbSatEnd["blue"]+")");
- if (myMapApp.navigator == "Batik") {
- this.rectSat.removeAttributeNS(null,"fill");
- this.rectSat.setAttributeNS(null,"fill","url(#"+this.id+"_satGradient)");
- }
- }
- if (this.valSliderVisible) {
- rgbValEnd = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],1);
- rgbValStart = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],0);
- this.valStartGradient.setAttributeNS(null,"stop-color","rgb("+rgbValStart["red"]+","+rgbValStart["green"]+","+rgbValStart["blue"]+")");
- this.valEndGradient.setAttributeNS(null,"stop-color","rgb("+rgbValEnd["red"]+","+rgbValEnd["green"]+","+rgbValEnd["blue"]+")");
- if (myMapApp.navigator == "Batik") {
- this.rectVal.removeAttributeNS(null,"fill");
- this.rectVal.setAttributeNS(null,"fill","url(#"+this.id+"_valGradient)");
- }
- }
- if (this.alphaSliderVisible) {
- rgbAlpha = hsv2rgb(this.hue[this.activeColourType],this.sat[this.activeColourType],this.val[this.activeColourType]);
- this.alphaStartGradient.setAttributeNS(null,"stop-color","rgb("+rgbAlpha["red"]+","+rgbAlpha["green"]+","+rgbAlpha["blue"]+")");
- this.alphaEndGradient.setAttributeNS(null,"stop-color","rgb("+rgbAlpha["red"]+","+rgbAlpha["green"]+","+rgbAlpha["blue"]+")");
- if (myMapApp.navigator == "Batik") {
- this.rectAlpha.removeAttributeNS(null,"fill");
- this.rectAlpha.setAttributeNS(null,"fill","url(#"+this.id+"_alphaGradient)");
- }
- }
- this.fireFunction();
-}
-
-//this hides a colourPicker
-colourPicker.prototype.hide = function() {
- this.parentGroup.setAttributeNS(null,"display","none");
-}
-
-//this method shows a colourPicker once it was hidden
-colourPicker.prototype.show = function() {
- this.parentGroup.setAttributeNS(null,"display","inherit");
-}
-
-//this is an internal method
-colourPicker.prototype.fireFunction = function() {
- var values = this.getValues();
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,values);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.colourChanged(this.id,values);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-//this method is for internal use only
-colourPicker.prototype.rebuild = function() {
- this.fillStartColors = new Array(this.rgbArr["fill"]["red"],this.rgbArr["fill"]["green"],this.rgbArr["fill"]["blue"],this.alpha["fill"]);
- this.strokeStartColors = new Array(this.rgbArr["stroke"]["red"],this.rgbArr["stroke"]["green"],this.rgbArr["stroke"]["blue"],this.alpha["stroke"]);
- this.parentGroup.parentNode.removeChild(this.parentGroup);
- this.createColourpicker();
-}
-
-//this method allows to move the colourPicker to a different position
-colourPicker.prototype.moveTo = function(x,y) {
- this.x = x;
- this.y = y;
- this.rebuild();
-}
-
-//this method changes the size of the colourPicker, you should make sure that the width and height values aren't too small, otherwise the colourPicker would look a bit strange ...
-colourPicker.prototype.resize = function(width,height) {
- this.width = width;
- this.height = height;
- this.rebuild();
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/comboBox.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/comboBox.js
deleted file mode 100644
index 93978fc..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/comboBox.js
+++ /dev/null
@@ -1,1178 +0,0 @@
-/*
-Scripts to create interactive comboboxes in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.2.1, 2006-10-03
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-
-----
-
-current version: 1.2.1
-
-version history:
-1.0 (2006-02-20)
-initial version
-
-1.1 (2006-05-17)
-decoupled styling from this file, fixes event handling so people can scroll outside scroller if mouse is down (events now added to root element)
-
-1.2 (2006-10-02)
-changed internally "groupId" to "id" to make it consistent with other GUI elements, introduced "parentId" as a new constructor parameter for the same reason, introduced new methods "resize()" and "moveTo()"
-
-1.2.1 (2006-10-03)
-corrected a slight bug regarding DOM hierarchy of created elements
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/combobox/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-If you wish, you can modify parameters (such as "look and feel") in the function "combobox" (constructor).
-You can adapt colors, fonts, cellpaddings, etc.
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/combobox/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function combobox(id,parentNode,elementsArray,width,xOffset,yOffset,cellHeight,textPadding,heightNrElements,multiple,offsetValue,textStyles,boxStyles,scrollbarStyles,smallrectStyles,highlightStyles,triangleStyles,functionToCall) {
- var nrArguments = 18;
- var createCombobox= true;
- if (arguments.length == nrArguments) {
- //get constructor variables
- this.id = id;
- this.parentNode = parentNode;
- this.elementsArray = elementsArray;
- this.width = width;
- this.xOffset = xOffset;
- this.yOffset = yOffset;
- this.cellHeight = cellHeight; //cellHeight in viewBox coordinates
- this.textPadding = textPadding; //this is relative to the left of the cell
- this.heightNrElements = heightNrElements;
- //check if heightNrElements is bigger than elements in the array
- if (this.heightNrElements > this.elementsArray.length) {
- this.heightNrElements = this.elementsArray.length;
- }
- this.multiple = multiple;
- this.curLowerIndex = offsetValue;
- //check if curLowIndex is within range
- if (this.curLowerIndex > (this.elementsArray.length - this.heightNrElements)) {
- this.curLowerIndex = this.elementsArray.length - this.heightNrElements;
- }
- this.textStyles = textStyles; //array of literals containing presentation attributes for text
- if (!this.textStyles["font-size"]) {
- this.textStyles["font-size"] = "11";
- }
- this.boxStyles = boxStyles; //array of literals containing presentation attributes for the sel box
- if (!this.boxStyles["fill"]) {
- this.boxStyles["fill"] = "white"; //this fill value is also used for boxes under indiv. text elements (unselected status)
- }
- if (!this.boxStyles["stroke"]) {
- this.boxStyles["stroke"] = "dimgray";
- }
- if (!this.boxStyles["stroke-width"]) {
- this.boxStyles["stroke-width"] = 1;
- }
- this.scrollbarStyles = scrollbarStyles; //array of literals containing presentation attributes for the scrollbar
- this.smallrectStyles = smallrectStyles; //array of literals containing presentation attributes for the small rectangle next to selectbox
- this.highlightStyles = highlightStyles; //array of literals containing presentation attributes for the highlighted rectangles
- this.triangleStyles = triangleStyles; //array of literals containing presentation attributes for the triangle in the selectionList, also applies to fill of scroller
- this.functionToCall = functionToCall;
-
- //calculate other values
- this.triangleFourth = Math.round(this.cellHeight / 4); //this is only used internally
- this.textPadding = textPadding; //this is relative to the left of the cell
- this.textPaddingVertical = this.cellHeight - (this.cellHeight - this.textStyles["font-size"]) * 0.7; //this is relative to the top of the cell
- this.scrollerMinHeight = this.cellHeight * 0.5; //minimal height of the scroller rect
-
- //status variables
- this.scrollStep = 0; //y-value to go for one element
- this.scrollerHeight = 0; //height of dragable scroller bar
- this.scrollActive = false; //determines if scrolling per up/down button is active
- this.panY = false; //stores the y value of event
- this.scrollCumulus = 0; //if value is less then a scrollstep we need to accumulate scroll values
- this.scrollDir = ""; //later holds "up" and "down"
- this.exists = true; //true means it exists, gets value false if method "removeSelectionList" is called
- this.mouseDownStatus = false; //status that specifies if mouse is down or up on individual elements
- this.pressedKeys = ""; //stores key events (pressed char values)
- this.keyTimer = undefined;
- this.svgRootHasEventListener = false; //status variable to define if svg root has key and mouseover listener or not
- }
- else {
- createCombobox = false;
- alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createCombobox) {
- //timer stuff
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
-
- //create combobox
- var result = this.testParent();
- if (result) {
- //this.parentGroup = document.getElementById(this.id);
- this.createOrUpdateCombobox();
- }
- else {
- alert("could not create or reference 'parentNode' of combobox with id '"+this.id+"'");
- }
- }
- else {
- alert("Could not create combobox with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-//test if parent group exists or create a new group at the end of the file
-combobox.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g") {
- this.parentGroup = this.parentNode;
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if Windows group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- this.parentGroup = document.getElementById(this.parentNode);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-combobox.prototype.createOrUpdateCombobox = function() {
- //check if there are more elements in the array than heightNrElements
- if (this.heightNrElements < this.elementsArray.length) {
- nrSelections = this.heightNrElements;
- }
- else {
- nrSelections = this.elementsArray.length;
- }
- //calculate height
- var comboboxHeight = this.cellHeight * nrSelections;
- //rectangle below (only fill, stroke is added at a separate rect)
- var created = true;
- if (!this.rectBelowBox) {
- this.rectBelowBox = document.createElementNS(svgNS,"rect");
- this.rectBelowBox.setAttributeNS(null,"stroke","none");
- created = false;
- }
- this.rectBelowBox.setAttributeNS(null,"x",this.xOffset);
- this.rectBelowBox.setAttributeNS(null,"y",this.yOffset);
- this.rectBelowBox.setAttributeNS(null,"width",this.width - this.cellHeight);
- this.rectBelowBox.setAttributeNS(null,"height",comboboxHeight);
- for (var attrib in this.boxStyles) {
- if (attrib != "stroke" && attrib != "stroke-width") {
- this.rectBelowBox.setAttributeNS(null,attrib,this.boxStyles[attrib]);
- }
- }
- if (!created) {
- this.parentGroup.appendChild(this.rectBelowBox);
- }
- //create temporary group for indiv. combo elements
- var comboElementsGroupCreated = false;
- if (this.comboElementsGroup) {
- this.parentGroup.removeChild(this.comboElementsGroup);
- comboElementsGroupCreated = true;
- }
- this.comboElementsGroup = document.createElementNS(svgNS,"g");
- if (comboElementsGroupCreated) {
- this.parentGroup.insertBefore(this.comboElementsGroup,this.rectAboveBox);
- }
- else {
- this.parentGroup.appendChild(this.comboElementsGroup);
- }
-
- //create rectangle above combobox (only stroke)
- created = true;
- if (!this.rectAboveBox) {
- this.rectAboveBox = document.createElementNS(svgNS,"rect");
- this.rectAboveBox.setAttributeNS(null,"fill","none");
- created = false;
- }
- this.rectAboveBox.setAttributeNS(null,"x",this.xOffset);
- this.rectAboveBox.setAttributeNS(null,"y",this.yOffset);
- this.rectAboveBox.setAttributeNS(null,"width",this.width - this.cellHeight);
- this.rectAboveBox.setAttributeNS(null,"height",comboboxHeight);
- for (var attrib in this.boxStyles) {
- if (attrib != "fill") {
- this.rectAboveBox.setAttributeNS(null,attrib,this.boxStyles[attrib]);
- }
- }
- if (!created) {
- this.parentGroup.appendChild(this.rectAboveBox);
- }
- //build textElements from array
- //hold currentSelection Index to unroll list at new offset
- for (var i=0;i<nrSelections;i++) {
- //add rectangles to capture events
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",this.yOffset + this.cellHeight * i);
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- if (this.elementsArray[this.curLowerIndex + i].value) {
- for (var attrib in this.highlightStyles) {
- node.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- else {
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- }
- node.setAttributeNS(null,"id","selHighlightSelection_" + this.id + "_" + (i + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mousedown", this, false);
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseup", this, false);
- this.comboElementsGroup.appendChild(node);
- //add text-elements
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",this.yOffset + this.textPaddingVertical + this.cellHeight * i);
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + i].key);
- node.appendChild(selectionText);
- this.comboElementsGroup.appendChild(node);
- }
-
- //create Scrollbar
- if (this.heightNrElements < this.elementsArray.length) {
- //calculate scrollstep
- this.scrollerHeight = (this.heightNrElements / this.elementsArray.length) * (comboboxHeight - 2 * this.cellHeight);
- if (this.scrollerHeight < this.scrollerMinHeight) {
- this.scrollerHeight = this.scrollerMinHeight;
- }
- this.scrollStep = (comboboxHeight - 2 * this.cellHeight - this.scrollerHeight) / (this.elementsArray.length - this.heightNrElements);
- //scrollbar
- created = true;
- if (!this.scrollbarRect) {
- this.scrollbarRect = document.createElementNS(svgNS,"rect");
- this.scrollbarRect.addEventListener("mousedown", this, false);
- this.scrollbarRect.setAttributeNS(null,"id","selScrollbarRect_"+this.id);
- created = false;
- }
- this.scrollbarRect.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- this.scrollbarRect.setAttributeNS(null,"y",this.yOffset + this.cellHeight);
- this.scrollbarRect.setAttributeNS(null,"width",this.cellHeight);
- this.scrollbarRect.setAttributeNS(null,"height",comboboxHeight - this.cellHeight * 2);
- for (var attrib in this.scrollbarStyles) {
- this.scrollbarRect.setAttributeNS(null,attrib,this.scrollbarStyles[attrib]);
- }
- if (!created) {
- this.parentGroup.appendChild(this.scrollbarRect);
- }
- //upper rectangle
- created = true;
- if (!this.scrollUpperRect) {
- this.scrollUpperRect = document.createElementNS(svgNS,"rect");
- this.scrollUpperRect.setAttributeNS(null,"id","selScrollUpperRect_"+this.id);
- this.scrollUpperRect.addEventListener("mousedown", this, false);
- this.scrollUpperRect.addEventListener("mouseup", this, false);
- created = false;
- }
- this.scrollUpperRect.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- this.scrollUpperRect.setAttributeNS(null,"y",this.yOffset);
- this.scrollUpperRect.setAttributeNS(null,"width",this.cellHeight);
- this.scrollUpperRect.setAttributeNS(null,"height",this.cellHeight);
- for (var attrib in this.smallrectStyles) {
- this.scrollUpperRect.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- if (!created) {
- this.parentGroup.appendChild(this.scrollUpperRect);
- }
- //upper triangle
- created = true;
- if (!this.upperTriangle) {
- this.upperTriangle = document.createElementNS(svgNS,"path");
- this.upperTriangle.setAttributeNS(null,"pointer-events","none");
- created = false;
- }
- var myPath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" Z";
- this.upperTriangle.setAttributeNS(null,"d",myPath);
- for (var attrib in this.triangleStyles) {
- this.upperTriangle.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- if (!this.created) {
- this.parentGroup.appendChild(this.upperTriangle);
- }
- //lower rectangle
- created = true;
- if (!this.scrollLowerRect) {
- this.scrollLowerRect = document.createElementNS(svgNS,"rect");
- this.scrollLowerRect.setAttributeNS(null,"id","selScrollLowerRect_" + this.id);
- this.scrollLowerRect.addEventListener("mousedown", this, false);
- this.scrollLowerRect.addEventListener("mouseup", this, false);
- created = false;
- }
- this.scrollLowerRect.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- this.scrollLowerRect.setAttributeNS(null,"y",this.yOffset + comboboxHeight - this.cellHeight);
- this.scrollLowerRect.setAttributeNS(null,"width",this.cellHeight);
- this.scrollLowerRect.setAttributeNS(null,"height",this.cellHeight);
- for (var attrib in this.smallrectStyles) {
- this.scrollLowerRect.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- if (!created) {
- this.parentGroup.appendChild(this.scrollLowerRect);
- }
- //lower triangle
- created = true;
- if (!this.lowerTriangle) {
- this.lowerTriangle = document.createElementNS(svgNS,"path");
- this.lowerTriangle.setAttributeNS(null,"pointer-events","none");
- created = false;
- }
- var myPath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(this.yOffset + comboboxHeight - this.cellHeight + this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(this.yOffset + comboboxHeight - this.cellHeight + this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(this.yOffset + comboboxHeight - this.cellHeight + 3 * this.triangleFourth)+" Z";
- this.lowerTriangle.setAttributeNS(null,"d",myPath);
- for (var attrib in this.triangleStyles) {
- this.lowerTriangle.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- if (!created) {
- this.parentGroup.appendChild(this.lowerTriangle);
- }
- //scrollerRect
- created = true;
- if (!this.scroller) {
- this.scroller = document.createElementNS(svgNS,"rect");
- this.scroller.setAttributeNS(null,"pointer-events","none");
- this.scroller.setAttributeNS(null,"id","selScroller_"+this.id);
- created = false;
- }
- this.scroller.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- this.scroller.setAttributeNS(null,"y",this.yOffset + this.cellHeight + this.scrollStep * this.curLowerIndex);
- this.scroller.setAttributeNS(null,"width",this.cellHeight);
- this.scroller.setAttributeNS(null,"height",this.scrollerHeight);
- for (var attrib in this.smallrectStyles) {
- this.scroller.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- if (!created) {
- this.parentGroup.appendChild(this.scroller);
- }
- }
-}
-
-combobox.prototype.handleEvent = function(evt) {
- var el = evt.currentTarget;
- var callerId = el.getAttributeNS(null,"id");
- var myRegExp = new RegExp(this.id);
- if (evt.type == "mouseover") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselHighlightSelection_/)) {
- if (this.mouseDownStatus) {
- this.selectOrUnselect(evt);
- evt.stopPropagation();
- }
- else {
- if (!this.svgRootHasEventListener) {
- document.documentElement.addEventListener("mouseover",this,false);
- document.documentElement.addEventListener("keypress",this,false);
- this.svgRootHasEventListener = true;
- }
- }
- }
- }
- if (!myRegExp.test(evt.target.getAttributeNS(null,"id"))) {
- //case that the event comes from the documentRoot element
- //but not from the combobox itself
- this.mouseDownStatus = false;
- document.documentElement.removeEventListener("mouseover",this,false);
- document.documentElement.removeEventListener("keypress",this,false);
- this.svgRootHasEventListener = false;
- }
- }
- if (evt.type == "mousedown") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselHighlightSelection_/)) {
- this.selectOrUnselect(evt);
- this.mouseDownStatus = true;
- document.documentElement.addEventListener("mouseup",this,false);
- evt.stopPropagation();
- }
- }
- if (callerId.match(/\bselScrollUpperRect_|\bselScrollLowerRect/)) {
- this.scrollDir = "down";
- this.scrollActive = true;
- document.documentElement.addEventListener("mouseup",this,false);
- if (callerId.match(/UpperRect/)) {
- this.scrollDir = "up";
- }
- this.scroll(this.scrollDir,1,true); //1 is one element to scroll, true says that we should move scrollbar
- this.timer.setTimeout("scrollPerButton",400)
- }
- if (callerId.match(/\bselScrollbarRect_/)) {
- this.scrollBarMove(evt);
- }
- }
- if (evt.type == "mouseup") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselHighlightSelection_/)) {
- this.mouseDownStatus = false;
- if (this.panStatus) {
- this.scrollBarMove(evt);
- }
- if (this.scrollActive) {
- this.scrollActive = false;
- document.documentElement.removeEventListener("mouseup",this,false);
- }
- evt.stopPropagation();
- }
- if (callerId.match(/\bselScrollUpperRect_|\bselScrollLowerRect/)) {
- this.scrollActive = false;
- }
- }
- if (el.nodeName == "svg") {
- if (this.panStatus) {
- //stop scroll mode
- this.scrollBarMove(evt);
- }
- if (this.scrollActive) {
- this.scrollActive = false;
- document.documentElement.removeEventListener("mouseup",this,false);
- }
- }
- }
- if (evt.type == "mousemove") {
- if (el.nodeName == "svg") {
- this.scrollBarMove(evt);
- }
- } //add keypress event
- if (evt.type == "keypress") {
- if (evt.charCode) {
- var character = String.fromCharCode(evt.charCode).toLowerCase();
- }
- else {
- //case opera and others
- var character = String.fromCharCode(evt.keyCode).toLowerCase();
- if (evt.keyCode == 0 || evt.keyCode == 16 || evt.keyCode == 17 || evt.keyCode == 18) {
- //shift key
- character = "";
- }
- }
-
- this.pressedKeys += character;
-
- if (character.length > 0) {
- if (this.keyTimer) {
- this.timer.clearTimeout(this.keyTimer);
- }
- this.keyTimer = this.timer.setTimeout("resetPressedKeys",1000);
- this.scrollToKey();
- }
- }
-}
-
-combobox.prototype.moveTo = function(moveX,moveY) {
- this.xOffset = moveX;
- this.yOffset = moveY;
- this.createOrUpdateCombobox();
-}
-
-combobox.prototype.resize = function(newWidth) {
- this.width = newWidth;
- this.createOrUpdateCombobox();
-}
-
-combobox.prototype.resetPressedKeys = function() {
- this.keyTimer = undefined;
- this.pressedKeys = "";
-}
-
-combobox.prototype.selectOrUnselect = function(evt) {
- var mySelEl = evt.target;
- var result = mySelEl.getAttributeNS(null,"id").split("_");
- var idNr = result[2]; //the numerical id in the array
- if (this.multiple) {
- //multiple selections are allowed
- if (evt.type == "mousedown") {
- if (evt.ctrlKey) {
- if (this.elementsArray[idNr].value) {
- mySelEl.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (mySelEl.hasAttributeNS(null,"fill-opacity")) {
- mySelEl.removeAttributeNS(null,"fill-opacity");
- }
- this.elementsArray[idNr].value = false;
- }
- else {
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.elementsArray[idNr].value = true;
- }
- }
- else {
- if (evt.shiftKey) {
- var selectedArray = new Array();
- for (var i=0;i<this.elementsArray.length;i++) {
- //see how many and where elements are already selected
- if (this.elementsArray[i].value) {
- selectedArray.push(i);
- }
- }
- if (selectedArray.length == 0) {
- //if no element was selected we select the given element
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.elementsArray[idNr].value = true;
- }
- else {
- //now we need to calculate the distances to other
- var distance = this.elementsArray.length;
- var nearestElement = 0;
- for (var i=0;i<selectedArray.length;i++) {
- var tempDist = Math.abs(idNr - selectedArray[i]);
- if (tempDist < distance) {
- distance = tempDist;
- nearestElement = selectedArray[i];
- }
- }
- if (nearestElement < idNr) {
- var lowerIndex = nearestElement;
- var upperIndex = idNr;
- }
- else {
- var lowerIndex = idNr;
- var upperIndex = nearestElement;
- }
- for (var i=lowerIndex;i<=upperIndex;i++) {
- var mySelEl = document.getElementById("selHighlightSelection_" + this.id + "_" + i);
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.elementsArray[i].value = true;
- }
- }
- }
- else {
- this.deselectAll(false);
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.elementsArray[idNr].value = true;
- }
- }
- }
- if (evt.type == "mouseover") {
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.elementsArray[idNr].value = true;
- }
- }
- else {
- //only one selection is allowed at the time
- this.deselectAll(false);
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.elementsArray[idNr].value = true;
- }
- if (this.functionToCall) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.deselectAll = function(fireFunction) {
- for (var i=0;i<this.elementsArray.length;i++) {
- if (this.elementsArray[i].value) {
- this.elementsArray[i].value = false;
- if (i >= this.curLowerIndex && i < (this.curLowerIndex + this.heightNrElements)) {
- var mySelEl = document.getElementById("selHighlightSelection_" + this.id + "_" + i);
- mySelEl.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (mySelEl.hasAttributeNS(null,"fill-opacity")) {
- mySelEl.removeAttributeNS(null,"fill-opacity");
- }
- }
- }
- }
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.selectAll = function(fireFunction) {
- for (var i=0;i<this.elementsArray.length;i++) {
- if (!this.elementsArray[i].value) {
- this.elementsArray[i].value = true;
- if (i >= this.curLowerIndex && i < (this.curLowerIndex + this.heightNrElements)) {
- var mySelEl = document.getElementById("selHighlightSelection_" + this.id + "_" + i);
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- }
- }
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.invertSelection = function(fireFunction) {
- for (var i=0;i<this.elementsArray.length;i++) {
- if (this.elementsArray[i].value) {
- this.elementsArray[i].value = false;
- if (i >= this.curLowerIndex && i < (this.curLowerIndex + this.heightNrElements)) {
- var mySelEl = document.getElementById("selHighlightSelection_" + this.id + "_" + i);
- mySelEl.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (mySelEl.hasAttributeNS(null,"fill-opacity")) {
- mySelEl.removeAttributeNS(null,"fill-opacity");
- }
- }
- }
- else {
- this.elementsArray[i].value = true;
- if (i >= this.curLowerIndex && i < (this.curLowerIndex + this.heightNrElements)) {
- var mySelEl = document.getElementById("selHighlightSelection_" + this.id + "_" + i);
- for (var attrib in this.highlightStyles) {
- mySelEl.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- }
- }
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.fireFunction = function() {
- var selectedArray = new Array();
- var selectedArrayIndizes = new Array();
- for (var i=0;i<this.elementsArray.length;i++) {
- //see how many and where elements are already selected
- if (this.elementsArray[i].value) {
- selectedArray.push(this.elementsArray[i].key);
- selectedArrayIndizes.push(i);
- }
- }
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,selectedArray,selectedArrayIndizes);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.getComboboxVals(this.id,selectedArray,selectedArrayIndizes);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-combobox.prototype.scrollPerButton = function() {
- if (this.scrollActive == true) {
- this.scroll(this.scrollDir,1,true); //1 is one element to scroll, true says that we should move scrollbar
- this.timer.setTimeout("scrollPerButton",100)
- }
-}
-
-combobox.prototype.scroll = function(scrollDir,scrollNr,scrollBool) {
- if (scrollNr < this.heightNrElements) {
- if ((this.curLowerIndex > 0) && (scrollDir == "up")) {
- if (scrollNr > this.curLowerIndex) {
- scrollNr = this.curLowerIndex;
- }
- //decrement current index
- this.curLowerIndex = this.curLowerIndex - scrollNr;
- //move scroller
- if (scrollBool == true) {
- this.scroller.setAttributeNS(null,"y",parseFloat(this.scroller.getAttributeNS(null,"y"))+ this.scrollStep * -1);
- }
- //add upper rect elements
- for (var i=0;i<scrollNr;i++) {
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",this.yOffset + this.cellHeight * i);
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- if (this.elementsArray[this.curLowerIndex + i].value) {
- for (var attrib in this.highlightStyles) {
- node.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- else {
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (node.hasAttributeNS(null,"fill-opacity")) {
- node.removeAttributeNS(null,"fill-opacity");
- }
- }
- node.setAttributeNS(null,"id","selHighlightSelection_" + this.id + "_" + (i + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mousedown", this, false);
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseup", this, false);
- this.comboElementsGroup.appendChild(node);
- //add text-nodes
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",this.yOffset + this.textPaddingVertical + this.cellHeight * i);
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + i].key);
- node.appendChild(selectionText);
- this.comboElementsGroup.appendChild(node);
- }
- //move middle elements
- for (var j=i;j<this.heightNrElements;j++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) + (this.cellHeight * scrollNr));
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) + (this.cellHeight * scrollNr));
- }
- //remove lower elements
- for (var k=j;k<(j+scrollNr);k++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (k + this.curLowerIndex));
- this.comboElementsGroup.removeChild(node);
- var node = document.getElementById("selHighlightSelection_" + this.id +"_" + (k + this.curLowerIndex));
- this.comboElementsGroup.removeChild(node);
- }
- }
- else if ((this.curLowerIndex < (this.elementsArray.length - this.heightNrElements)) && (scrollDir == "down")) {
- //move Scroller
- if (scrollBool == true) {
- this.scroller.setAttributeNS(null,"y",parseFloat(this.scroller.getAttributeNS(null,"y")) + this.scrollStep);
- }
- //remove most upper element
- for (var i=0;i<scrollNr;i++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (this.curLowerIndex + i));
- this.comboElementsGroup.removeChild(node);
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + (this.curLowerIndex + i));
- this.comboElementsGroup.removeChild(node);
- }
- //move middle elements
- for (var j=i;j<this.heightNrElements;j++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) - (this.cellHeight * scrollNr));
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) - (this.cellHeight * scrollNr));
- }
- //add most lower element
- for (var k=j;k<(j+scrollNr);k++) {
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",this.yOffset + this.cellHeight * (k - scrollNr));
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- if (this.elementsArray[this.curLowerIndex + k].value) {
- for (var attrib in this.highlightStyles) {
- node.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- else {
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (node.hasAttributeNS(null,"fill-opacity")) {
- node.removeAttributeNS(null,"fill-opacity");
- }
- }
- node.setAttribute("id","selHighlightSelection_" + this.id + "_" + (k + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mousedown", this, false);
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseup", this, false);
- this.comboElementsGroup.appendChild(node);
- //add text-nodes
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (k + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",this.yOffset + this.textPaddingVertical + this.cellHeight * (k - scrollNr));
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + k].key);
- node.appendChild(selectionText);
- this.comboElementsGroup.appendChild(node);
- }
- //increment current index
- this.curLowerIndex = this.curLowerIndex + scrollNr;
- }
- }
- else {
- //remove lower elements
- for (var i=0;i<this.heightNrElements;i++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- this.comboElementsGroup.removeChild(node);
- var node = document.getElementById("selHighlightSelection_" + this.id +"_" + (i + this.curLowerIndex));
- this.comboElementsGroup.removeChild(node);
- }
- if (scrollDir == "down") {
- this.curLowerIndex = this.curLowerIndex + scrollNr;
- }
- else {
- this.curLowerIndex = this.curLowerIndex - scrollNr;
- }
- for (var i=0;i<this.heightNrElements;i++) {
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",this.yOffset + this.cellHeight * i);
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- if (this.elementsArray[this.curLowerIndex + i].value) {
- for (var attrib in this.highlightStyles) {
- node.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- else {
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (node.hasAttributeNS(null,"fill-opacity")) {
- node.removeAttributeNS(null,"fill-opacity");
- }
- }
- node.setAttributeNS(null,"id","selHighlightSelection_" + this.id + "_" + (i + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mousedown", this, false);
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseup", this, false);
- this.comboElementsGroup.appendChild(node);
- //add text-nodes
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",this.yOffset + this.textPaddingVertical + this.cellHeight * i);
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + i].key);
- node.appendChild(selectionText);
- this.comboElementsGroup.appendChild(node);
- }
- }
-}
-
-//event listener for Scrollbar element
-combobox.prototype.scrollBarMove = function(evt) {
- var scrollerMinY = parseFloat(this.scrollbarRect.getAttributeNS(null,"y"));
- var scrollerMaxY = parseFloat(this.scrollbarRect.getAttributeNS(null,"y")) + parseFloat(this.scrollbarRect.getAttributeNS(null,"height")) - parseFloat(this.scroller.getAttributeNS(null,"height"));
- if (evt.type == "mousedown") {
- this.panStatus = true;
- //add event listeners to root element
- var svgroot = document.documentElement;
- svgroot.addEventListener("mousemove", this, false);
- svgroot.addEventListener("mouseup", this, false);
- for (var attrib in this.triangleStyles) {
- this.scroller.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- var coordPoint = myMapApp.calcCoord(evt,this.parentGroup);
- this.panY = coordPoint.y;
- var oldY = parseFloat(this.scroller.getAttributeNS(null,"y"));
- var newY = this.panY - parseFloat(this.scroller.getAttributeNS(null,"height")) / 2;
- if (newY < scrollerMinY) {
- newY = scrollerMinY;
- //maybe recalculate this.panY ??
- }
- if (newY > scrollerMaxY) {
- newY = scrollerMaxY;
- }
- var panDiffY = newY - oldY;
- var scrollDir = "down";
- this.scrollCumulus = 0;
- if(Math.abs(panDiffY) > this.scrollStep) {
- var scrollNr = Math.abs(Math.round(panDiffY / this.scrollStep));
- if (panDiffY > 0) {
- this.scrollCumulus = panDiffY - this.scrollStep * scrollNr;
- }
- else {
- this.scrollCumulus = panDiffY + this.scrollStep * scrollNr;
- scrollDir = "up";
- }
- newY = oldY + panDiffY;
- this.scroller.setAttributeNS(null,"y",newY);
- this.scroll(scrollDir,scrollNr,false);
- }
- }
- if (evt.type == "mouseup") {
- if (this.panStatus == true) {
- var newY = parseFloat(this.scroller.getAttributeNS(null,"y"));
- for (var attrib in this.smallrectStyles) {
- this.scroller.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- this.scroller.setAttributeNS(null,"y",this.yOffset + this.cellHeight + this.scrollStep * this.curLowerIndex);
- }
- var svgroot = document.documentElement;
- svgroot.removeEventListener("mousemove", this, false);
- svgroot.removeEventListener("mouseup", this, false);
- this.panStatus = false;
- }
- if (evt.type == "mousemove") {
- if (this.panStatus == true) {
- var coordPoint = myMapApp.calcCoord(evt,this.parentGroup);
- var panNewEvtY = coordPoint.y;
- var panDiffY = panNewEvtY - this.panY;
- var oldY = parseFloat(this.scroller.getAttributeNS(null,"y"));
- var newY = oldY + panDiffY;
- if (newY < scrollerMinY) {
- newY = scrollerMinY;
- }
- if (newY > scrollerMaxY) {
- newY = scrollerMaxY;
- }
- var panDiffY = newY - oldY;
- this.scrollCumulus += panDiffY;
- var scrollDir = "down";
- var scrollNr = 0;
- if(Math.abs(this.scrollCumulus) >= this.scrollStep) {
- scrollNr = Math.abs(Math.round(this.scrollCumulus / this.scrollStep));
- if (this.scrollCumulus > 0) {
- this.scrollCumulus = this.scrollCumulus - this.scrollStep * scrollNr;
- }
- else {
- this.scrollCumulus = this.scrollCumulus + this.scrollStep * scrollNr;
- scrollDir = "up";
- }
- this.scroll(scrollDir,scrollNr,false);
- }
- else {
- if (Math.abs(this.scrollCumulus) > this.scrollStep) {
- scrollNr = 1;
- if (panDiffY < 0) {
- scrollDir = "up";
- this.scrollCumulus = this.scrollCumulus + this.scrollStep;
- }
- else {
- this.scrollCumulus = this.scrollCumulus - this.scrollStep;
- }
- panDiffY = this.scrollCumulus;
- this.scroll(scrollDir,scrollNr,false);
- }
- else {
- if (newY == scrollerMinY && this.curLowerIndex != 0) {
- this.scroll("up",1,false);
- }
- else if (newY == scrollerMaxY && this.curLowerIndex != (this.elementsArray.length - this.heightNrElements)) {
- this.scroll("down",1,false);
- }
- }
- }
- newY = oldY + panDiffY;
- this.scroller.setAttributeNS(null,"y",newY);
- this.panY = panNewEvtY;
- }
- }
-}
-
-combobox.prototype.scrollToKey = function() {
- for (var i=0;i<this.elementsArray.length;i++) {
- if (this.elementsArray[i].key.toLowerCase().substr(0,this.pressedKeys.length) == this.pressedKeys) {
- this.curLowerIndex = i;
- if (this.curLowerIndex > (this.elementsArray.length - this.heightNrElements)) {
- this.curLowerIndex = this.elementsArray.length - this.heightNrElements;
- }
- this.createOrUpdateCombobox();
- break;
- }
- }
-}
-
-combobox.prototype.elementExists = function(elementName) {
- var result = -1;
- for (i=0;i<this.elementsArray.length;i++) {
- if (this.elementsArray[i].key == elementName) {
- result = i;
- }
- }
- return result;
-}
-
-combobox.prototype.selectElementsByName = function(elementNames,fireFunction) {
- var idsToSelect = new Array();
- for (var i=0;i<elementNames.length;i++) {
- var indexNr = this.elementExists(elementNames[i].key);
- if (indexNr != -1) {
- idsToSelect.push({index:indexNr,value:elementNames[i].value});
- }
- }
- if (idsToSelect.length > 0) {
- this.selectElementsByPosition(idsToSelect,fireFunction);
- }
-}
-
-combobox.prototype.selectElementsByPosition = function(positionArray,fireFunction) {
- for (var i=0;i<positionArray.length;i++) {
- if (positionArray[i].index < this.elementsArray.length) {
- if (positionArray[i].index >= this.curLowerIndex && positionArray[i].index < (this.curLowerIndex + this.heightNrElements)) {
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + positionArray[i].index);
- if (positionArray[i].value) {
- for (var attrib in this.highlightStyles) {
- node.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- else {
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- if (node.hasAttributeNS(null,"fill-opacity")) {
- node.removeAttributeNS(null,"fill-opacity");
- }
- }
- }
- this.elementsArray[positionArray[i].index].value = positionArray[i].value;
- }
- }
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.sortList = function(direction) {
- //direction: asc|desc, for ascending or descending
- var mySelElementString = this.elementsArray[this.activeSelection];
- this.elementsArray.sort(function mySort(a,b) {
- if (a.key > b.key) {
- return 1;
- }
- else {
- return -1;
- }
- });
- if (direction == "desc") {
- this.elementsArray.reverse();
- }
- this.createOrUpdateCombobox();
-}
-
-combobox.prototype.deleteElementsByName = function(elementNames,fireFunction) {
- for (var i=0;i<elementNames.length;i++) {
- existsPosition = this.elementExists(elementNames[i]);
- if (existsPosition != -1) {
- var tempArray = new Array;
- tempArray = tempArray.concat(this.elementsArray.slice(0,existsPosition),this.elementsArray.slice(existsPosition + 1,this.elementsArray.length));
- this.elementsArray = tempArray;
- if (existsPosition < this.curLowerIndex) {
- this.curLowerIndex--;
- }
- }
- }
- this.createOrUpdateCombobox();
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.deleteElementByPosition = function(elementPosition,fireFunction) {
- if (elementPosition < this.elementsArray.length) {
- var tempArray = new Array;
- tempArray = tempArray.concat(this.elementsArray.slice(0,elementPosition),this.elementsArray.slice(elementPosition + 1,this.elementsArray.length));
- this.elementsArray = tempArray;
- if (elementPosition < this.curLowerIndex) {
- this.curLowerIndex -= 1;
- }
- }
- this.createOrUpdateCombobox();
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.addElementAtPosition = function(element,position,fireFunction) {
- if (position > this.elementsArray.length) {
- this.elementsArray.push(element);
- position = this.elementsArray.length - 1;
- }
- else {
- var tempArray = new Array;
- tempArray = tempArray.concat(this.elementsArray.slice(0,position),element,this.elementsArray.slice(position,this.elementsArray.length));
- this.elementsArray = tempArray;
- }
- if (position < this.curLowerIndex) {
- this.curLowerIndex += 1;
- }
- this.createOrUpdateCombobox();
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.addElementsAlphabetically = function(elementsArr,direction,fireFunction) {
- this.elementsArray = this.elementsArray.concat(elementsArr);
- this.sortList(direction);
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-combobox.prototype.getCurrentSelections = function() {
- var selectedArray = new Array();
- for (var i=0;i<this.elementsArray.length;i++) {
- //see how many and where elements are already selected
- if (this.elementsArray[i].value) {
- selectedArray.push(this.elementsArray[i].key);
- }
- }
- return selectedArray;
-}
-
-combobox.prototype.getCurrentSelectionsIndex = function() {
- var selectedArrayIndizes = new Array();
- for (var i=0;i<this.elementsArray.length;i++) {
- //see how many and where elements are already selected
- if (this.elementsArray[i].value) {
- selectedArrayIndizes.push(i);
- }
- }
- return selectedArrayIndizes;
-}
-
-combobox.prototype.removeCombobox = function() {
- //remove all Elements of combobox
- this.exists = false;
- while (this.parentGroup.hasChildNodes()) {
- this.parentGroup.removeChild(this.parentGroup.firstChild);
- }
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/helper_functions.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/helper_functions.js
deleted file mode 100644
index 1c86070..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/helper_functions.js
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
-ECMAScript helper functions
-Copyright (C) <2004> <Andreas Neumann>
-Version 1.1, 2004-11-18
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits: numerous people on svgdevelopers@yahoogroups.com
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (http://www.carto.net/papers/svg/resources/lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/resources/helper_functions.js
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-//global variables necessary to create elements in these namespaces, do not delete them!!!!
-var svgNS = "http://www.w3.org/2000/svg";
-var xlinkNS = "http://www.w3.org/1999/xlink";
-var cartoNS = "http://www.carto.net/attrib";
-var attribNS = "http://www.carto.net/attrib";
-var batikNS = "http://xml.apache.org/batik/ext";
-
-/* ----------------------- helper functions to calculate stuff ---------------- */
-/* ---------------------------------------------------------------------------- */
-function toPolarDir(xdiff,ydiff) { // Subroutine for calculating polar Coordinates
- direction = (Math.atan2(ydiff,xdiff));
- //result is angle in radian
- return(direction);
-}
-
-function toPolarDist(xdiff,ydiff) { // Subroutine for calculating polar Coordinates
- distance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
- return(distance);
-}
-
-function toRectX(direction,distance) { // Subroutine for calculating cartesic coordinates
- x = distance * Math.cos(direction);
- y = distance * Math.sin(direction);
- return(x);
-}
-
-function toRectY(direction,distance) { // Subroutine for calculating cartesic coordinates
- x = distance * Math.cos(direction);
- y = distance * Math.sin(direction);
- return(y);
-}
-
-//Converts degrees to radians.
-function DegToRad(deg) {
- return (deg / 180.0 * Math.PI);
-}
-
-//Converts radians to degrees.
-function RadToDeg(rad) {
- return (rad / Math.PI * 180.0);
-}
-
-//converts decimal degrees to degree/minutes/seconds
-function dd2dms(dd) {
- var minutes = (Math.abs(dd) - Math.floor(Math.abs(dd))) * 60;
- var seconds = (minutes - Math.floor(minutes)) * 60;
- var minutes = Math.floor(minutes);
- var degrees = Math.floor(dd);
- return {deg:degrees,min:minutes,sec:seconds};
-}
-
-//converts degree/minutes/seconds to decimal degrees
-function dms2dd(deg,min,sec) {
- return deg + (min / 60) + (sec / 3600);
-}
-
-//log functions that do not exist in Math object
-function log(x,b) {
- if(b==null) b=Math.E;
- return Math.log(x)/Math.log(b);
-}
-
-//gets 4 z-values (4 corners), a position, delta x and delty and a cellsize as input and returns interpolated z-value
-function intBilinear(za,zb,zc,zd,xpos,ypos,ax,ay,cellsize) { //bilinear interpolation function
- e = (xpos - ax) / cellsize;
- f = (ypos - ay) / cellsize;
-
- //calculation of weights
- wa = (1 - e) * (1 - f);
- wb = e * (1 - f);
- wc = e * f;
- wd = f * (1 - e);
-
- height_interpol = wa * zc + wb * zd + wc * za + wd * zb;
-
- return (height_interpol);
-}
-
-//test if point is left of or right of, result is 1 (leftof) or 0 (rightof)
-function leftOfTest(pointx,pointy,linex1,liney1,linex2,liney2) {
- result = (liney1 - pointy) * (linex2 - linex1) - (linex1 - pointx) * (liney2 - liney1);
- if (result < 0) {
- leftof = 1; //case left of
- }
- else {
- leftof = 0; //case left of
- }
- return(leftof);
-}
-
-//input is point coordinate, and 2 line coordinates
-function distFromLine(xpoint,ypoint,linex1,liney1,linex2,liney2) {
- dx = linex2 - linex1;
- dy = liney2 - liney1;
- distance = (dy * (xpoint - linex1) - dx * (ypoint - liney1)) / Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2));
- return(distance);
-}
-
-//converts radian value to degrees
-function radian2deg(radian) {
- deg = radian / Math.PI * 180;
- return(deg);
-}
-
-//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian
-//Formula: Acos from Scalaproduct of the two vectors divided by ( norm (deutsch Betrag) vector 1 by norm vector 2
-//see http://www.mathe-online.at/mathint/vect2/i.html#Winkel
-function angleBetwTwoLines(a1,a2,b1,b2) {
- angle = Math.acos((a1 * b1 + a2 * b2) / (Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2)) * Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2))));
- return(angle);
-}
-
-//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is new vector c2 returned as array
-//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)
-//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale
-function calcBisectorVector(a1,a2,b1,b2) {
- betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));
- betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));
- c = new Array();
- c[0] = a1 / betraga + b1 / betragb;
- c[1] = a2 / betraga + b2 / betragb;
- return(c);
-}
-
-//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian
-//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)
-//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale
-function calcBisectorAngle(a1,a2,b1,b2) {
- betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));
- betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));
- c1 = a1 / betraga + b1 / betragb;
- c2 = a2 / betraga + b2 / betragb;
- angle = toPolarDir(c1,c2);
- return(angle);
-}
-
-function intersect2lines(line1x1,line1y1,line1x2,line1y2,line2x1,line2y1,line2x2,line2y2) {
- //formula see http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/
- var result = new Array();
- var denominator = (line2y2 - line2y1)*(line1x2 - line1x1) - (line2x2 - line2x1)*(line1y2 - line1y1);
- if (denominator == 0) {
- alert("lines are parallel");
- }
- else {
- ua = ((line2x2 - line2x1)*(line1y1 - line2y1) - (line2y2 - line2y1)*(line1x1 - line2x1)) / denominator;
- ub = ((line1x2 - line1x1)*(line1y1 - line2y1) - (line1y2 - line1y1)*(line1x1 - line2x1)) / denominator;
- }
- result["x"] = line1x1 + ua * (line1x2 - line1x1);
- result["y"] = line1y1 + ua * (line1y2 - line1y1);
- return(result);
-}
-
-/* ----------------------- helper function to sort arrays ---------------- */
-/* ----------------------------------------------------------------------- */
-//my own sort function, uses only first part of string (population value)
-function mySort(a,b) {
- var myResulta = a.split("+");
- var myResultb = b.split("+");
- if (parseFloat(myResulta[0]) < parseFloat(myResultb[0])) {
- return 1;
- }
- else {
- return -1;
- }
-}
-
-/* ----------------------- helper function format number strings -------------- */
-/* ---------------------------------------------------------------------------- */
-//formatting number strings
-//this function add's "'" to a number every third digit
-function formatNumberString(myString) {
- //check if of type string, if number, convert it to string
- if (typeof(myString) == "number") {
- myTempString = myString.toString();
- }
- else {
- myTempString = myString;
- }
- var myNewString="";
- //if it contains a comma, it will be split
- var splitResults = myTempString.split(".");
- var myCounter= splitResults[0].length;
- if (myCounter > 3) {
- while(myCounter > 0) {
- if (myCounter > 3) {
- myNewString = "," + splitResults[0].substr(myCounter - 3,3) + myNewString;
- }
- else {
- myNewString = splitResults[0].substr(0,myCounter) + myNewString;
- }
- myCounter -= 3;
- }
- }
- else {
- myNewString = splitResults[0];
- }
- //concatenate if it contains a comma
- if (splitResults[1]) {
- myNewString = myNewString + "." + splitResults[1];
- }
- return myNewString;
-}
-
-//function for status Bar
-function statusChange(statusText) {
- document.getElementById("statusText").firstChild.nodeValue = "Statusbar: " + statusText;
-}
-
-//scale an object
-function scaleObject(evt,factor) {
-//reference to the currently selected object
- var element = evt.currentTarget;
- var myX = element.getAttributeNS(null,"x");
- var myY = element.getAttributeNS(null,"y");
- var newtransform = "scale(" + factor + ") translate(" + (myX * 1 / factor - myX) + " " + (myY * 1 / factor - myY) +")";
- element.setAttributeNS(null,'transform', newtransform);
-}
-
-//this code is copied from Kevin Lindsey
-//http://www.kevlindev.com/tutorials/basics/transformations/toUserSpace/index.htm
-function getTransformToRootElement(node) {
- try {
- //this part is for fully conformant players
- var CTM = node.getTransformToElement(document.documentElement);
- }
- catch (ex) {
- //this part is for ASV3 or other non-conformant players
- // Initialize our CTM the node's Current Transformation Matrix
- var CTM = node.getCTM();
- // Work our way through the ancestor nodes stopping at the SVG Document
- while ( ( node = node.parentNode ) != document ) {
- // Multiply the new CTM to the one with what we have accumulated so far
- CTM = node.getCTM().multiply(CTM);
- }
- }
- return CTM;
-}
-
-//this is because ASV does not implement the method SVGLocatable.getTransformToElement()
-function getTransformToElement(node,targetNode) {
- try {
- //this part is for fully conformant players
- var CTM = node.getTransformToElement(targetNode);
- }
- catch (ex) {
- //this part is for ASV3 or other non-conformant players
- // Initialize our CTM the node's Current Transformation Matrix
- var CTM = node.getCTM();
- // Work our way through the ancestor nodes stopping at the SVG Document
- while ( ( node = node.parentNode ) != targetNode ) {
- // Multiply the new CTM to the one with what we have accumulated so far
- CTM = node.getCTM().multiply(CTM);
- }
- }
- return CTM;
-}
-
-//calculate HSV 2 RGB: HSV (h 0 to 360, sat and val are between 0 and 1), RGB between 0 and 255
-function hsv2rgb(hue,sat,val) {
- //alert("Hue:"+hue);
- var rgbArr = new Array();
- if ( sat == 0) {
- rgbArr["red"] = Math.round(val * 255);
- rgbArr["green"] = Math.round(val * 255);
- rgbArr["blue"] = Math.round(val * 255);
- }
- else {
- var h = hue / 60;
- var i = Math.floor(h);
- var f = h - i;
- if (i % 2 == 0) {
- f = 1 - f;
- }
- var m = val * (1 - sat);
- var n = val * (1 - sat * f);
- switch(i) {
- case 0:
- rgbArr["red"] = val;
- rgbArr["green"] = n;
- rgbArr["blue"] = m;
- break;
- case 1:
- rgbArr["red"] = n;
- rgbArr["green"] = val;
- rgbArr["blue"] = m;
- break;
- case 2:
- rgbArr["red"] = m;
- rgbArr["green"] = val;
- rgbArr["blue"] = n;
- break;
- case 3:
- rgbArr["red"] = m;
- rgbArr["green"] = n;
- rgbArr["blue"] = val;
- break;
- case 4:
- rgbArr["red"] = n;
- rgbArr["green"] = m;
- rgbArr["blue"] = val;
- break;
- case 5:
- rgbArr["red"] = val;
- rgbArr["green"] = m;
- rgbArr["blue"] = n;
- break;
- case 6:
- rgbArr["red"] = val;
- rgbArr["green"] = n;
- rgbArr["blue"] = m;
- break;
- }
- rgbArr["red"] = Math.round(rgbArr["red"] * 255);
- rgbArr["green"] = Math.round(rgbArr["green"] * 255);
- rgbArr["blue"] = Math.round(rgbArr["blue"] * 255);
- }
- return rgbArr;
-}
-
-//calculate rgb to hsv values
-function rgb2hsv (red,green,blue) {
- //input between 0 and 255 --> normalize to 0 to 1
- //result =
- var hsvArr = new Array();
- red = red / 255;
- green = green / 255;
- blue = blue / 255;
- myMax = Math.max(red, Math.max(green,blue));
- myMin = Math.min(red, Math.min(green,blue));
- v = myMax;
- if (myMax > 0) {
- s = (myMax - myMin) / myMax;
- }
- else {
- s = 0;
- }
- if (s > 0) {
- myDiff = myMax - myMin;
- rc = (myMax - red) / myDiff;
- gc = (myMax - green) / myDiff;
- bc = (myMax - blue) / myDiff;
- if (red == myMax) {
- h = (bc - gc) / 6;
- }
- if (green == myMax) {
- h = (2 + rc - bc) / 6;
- }
- if (blue == myMax) {
- h = (4 + gc - rc) / 6;
- }
- }
- else {
- h = 0;
- }
- if (h < 0) {
- h += 1;
- }
- hsvArr["hue"] = Math.round(h * 360);
- hsvArr["sat"] = s;
- hsvArr["val"] = v;
- return hsvArr;
-}
-
-//populate an array that can be addressed by both a key or an index nr
-function assArrayPopulate(arrayKeys,arrayValues) {
- var returnArray = new Array();
- if (arrayKeys.length != arrayValues.length) {
- alert("error: arrays do not have same length!");
- }
- else {
- for (i=0;i<arrayKeys.length;i++) {
- returnArray[arrayKeys[i]] = arrayValues[i];
- }
- }
- return returnArray;
-}
-
-//replace special (non-ASCII) characters with their charCode
-function replaceSpecialChars(myString) {
- for (i=161;i<256;i++) {
- re = new RegExp("&#"+i+";","g");
- myString = myString.replace(re,String.fromCharCode(i));
- }
- return myString;
-}
-
-/* ----------------------- getXMLData object ----------------------------- */
-/* ----------------------------------------------------------------------- */
-//this object allows to make network requests using getURL or XMLHttpRequest
-//you may specify a url and a callBackFunction
-//the callBackFunction receives a XML node representing the rootElement of the fragment received
-function getXMLData(url,callBackFunction) {
- this.url = url;
- this.callBackFunction = callBackFunction;
- this.xmlRequest = null;
-}
-
-getXMLData.prototype.getData = function() {
- //call getURL() if available
- if (window.getURL) {
- getURL(this.url,this);
- }
- //or call XMLHttpRequest() if available
- else if (window.XMLHttpRequest) {
- var _this = this;
- this.xmlRequest = new XMLHttpRequest();
- this.xmlRequest.overrideMimeType("text/xml");
- this.xmlRequest.open("GET",this.url,true);
- this.xmlRequest.onreadystatechange = function() {_this.handleEvent()};
- this.xmlRequest.send(null);
- }
- //write an error message if neither method is available
- else {
- alert("your browser/svg viewer neither supports window.getURL nor window.XMLHttpRequest!");
- }
-}
-
-//this is the callback method for the getURL function
-getXMLData.prototype.operationComplete = function(data) {
- //check if data has a success property
- if (data.success) {
- //parse content of the XML format to the variable "node"
- var node = parseXML(data.content,document);
- this.callBackFunction(node.firstChild);
- }
- else {
- alert("something went wrong with dynamic loading of geometry!");
- }
-}
-
-//this method receives data from XMLHttpRequest
-getXMLData.prototype.handleEvent = function() {
- if (this.xmlRequest.readyState == 4) {
- var importedNode = document.importNode(this.xmlRequest.responseXML.documentElement,true);
- this.callBackFunction(importedNode);
- }
-}
-
-//starts an animation with the given id
-//this function is useful in combination with window.setTimeout()
-function startAnimation(id) {
- document.getElementById(id).beginElement();
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/initComboBox.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/initComboBox.js
deleted file mode 100644
index 8df1348..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/initComboBox.js
+++ /dev/null
@@ -1,71 +0,0 @@
-//mapApp that handles window resizing
-var myMapApp = new mapApp(false,undefined);
-
-//global selectionLists
-var comboFruits;
-var comboFlowers;
-
-function initMap(evt) {
- //first a few styling parameters:
- var comboBoxCellHeight = 16;
- var comboBoxTextpadding = 3;
- var comboBoxtextStyles = {"font-family":"Arial,Helvetica","font-size":11,"fill":"dimgray"};
- var comboBoxStyles = {"stroke":"dimgray","stroke-width":1,"fill":"white"};
- var comboBoxScrollbarStyles = {"stroke":"dimgray","stroke-width":1,"fill":"whitesmoke"};
- var comboBoxSmallrectStyles = {"stroke":"dimgray","stroke-width":1,"fill":"lightgray"};
- var comboBoxHighlightStyles = {"fill":"dimgray","fill-opacity":0.3};
- var comboBoxTriangleStyles = {"fill":"dimgray"};
- //arrays for selectionList data
- var fruitsGerman = [{key:"Orangen",value:false},{key:"Äpfel",value:false},{key:"Bananen",value:true},{key:"Birnen",value:false}];
- var flowers = new Array({key:"Acacia",value:false},{key:"Acanthus",value:false},{key:"Amaranth",value:false},{key:"Anthericum",value:false},{key:"Arum",value:false},{key:"Ash",value:true},{key:"Aspen",value:false},{key:"Aster",value:false},{key:"Balm",value:false},{key:"Barbery",value:false},{key:"Basil",value:false},{key:"Bellflower",value:true},{key:"Bindweed",value:false},{key:"Bird cherry-tree",value:false},{key:"Black thorn",value:false},{key:"Bladder-senna",value:false},{key:"Bluebottle",value:false},{key:"Borage",value:false},{key:"Box",value:false});
- var roses = new Array({key:"Butterscotch",value:false},{key:"Ci Peace",value:false},{key:"Impatient",value:false},{key:"Lady Hillingdon",value:false},{key:"Lavaglut",value:false},{key:"Mission Bells",value:false},{key:"Sexy Rexy",value:false},{key:"Souvenir de Pierre Notting",value:false},{key:"Sunflare",value:false},{key:"Whisky Mac",value:false},{key:"Whisper Floribunda",value:false});
- var communitiesAarau = new Array({key:"Aarau",value:false},{key:"Aarburg",value:false},{key:"Abtwil",value:true},{key:"Ammerswil",value:false},{key:"Aristau",value:false},{key:"Arni (AG)",value:false},{key:"Attelwil",value:false},{key:"Auenstein",value:false},{key:"Auw",value:false},{key:"Baden",value:false},{key:"Baldingen",value:false},{key:"Beinwil (Freiamt)",value:false},{key:"Beinwil am See",value:false},{key:"Bellikon",value:false},{key:"Benzenschwil",value:false},{key:"Bergdietikon",value:false},{key:"Berikon",value:false},{key:"Besenbüren",value:false},{key:"Bettwil",value:false},{key:"Biberstein",value:false},{key:"Birmenstorf (AG)",value:false},{key:"Birr",value:false},{key:"Birrhard",value:false},{key:"Birrwil",value:false},{key:"Boniswil",value:false},{key:"Boswil",value:false},{key:"Bottenwil",value:false},{key:"Bremgarten (AG)",value:false},{key:"Brittnau",value:false},{key:"Brugg",value:false},{key:"Brunegg",value:false},{key:"Buchs (AG)",value:false},{key:"Burg (AG)",value:false},{key:"Buttwil",value:false},{key:"Böbikon",value:false},{key:"Böttstein",value:false},{key:"Bözen",value:false},{key:"Bünzen",value:false},{key:"Buettikon",value:false},{key:"Densbueren",value:false},{key:"Dietwil",value:false},{key:"Dintikon",value:false},{key:"Dottikon",value:false},{key:"Döttingen",value:false},{key:"Dürrenäsch",value:false},{key:"Effingen",value:false},{key:"Eggenwil",value:false},{key:"Egliswil",value:false},{key:"Eiken",value:false},{key:"Elfingen",value:false},{key:"Endingen",value:false},{key:"Ennetbaden",value:false},{key:"Erlinsbach",value:false},{key:"Etzgen",value:false},{key:"Fahrwangen",value:false},{key:"Fischbach-Goeslikon",value:false},{key:"Fisibach",value:false},{key:"Fislisbach",value:false},{key:"Freienwil",value:false},{key:"Frick",value:false},{key:"Full-Reuenthal",value:false},{key:"Gallenkirch",value:false},{key:"Gansingen",value:false},{key:"Gebenstorf",value:false},{key:"Geltwil",value:false},{key:"Gipf-Oberfrick",value:false},{key:"Gontenschwil",value:false},{key:"Graenichen",value:false},{key:"Habsburg",value:false},{key:"Hallwil",value:false},{key:"Hausen bei Brugg",value:false},{key:"Hellikon",value:false},{key:"Hendschiken",value:false},{key:"Hermetschwil-Staffeln",value:false},{key:"Herznach",value:false},{key:"Hilfikon",value:false},{key:"Hirschthal",value:false},{key:"Holderbank (AG)",value:false},{key:"Holziken",value:false},{key:"Hornussen",value:true},{key:"Hottwil",value:false},{key:"Hunzenschwil",value:false},{key:"Haegglingen",value:false},{key:"Islisberg",value:false},{key:"Ittenthal",value:false},{key:"Jonen",value:false},{key:"Kaiseraugst",value:false},{key:"Kaiserstuhl",value:false},{key:"Kaisten",value:false},{key:"Kallern",value:false},{key:"Killwangen",value:false},{key:"Kirchleerau",value:false},{key:"Klingnau",value:true},{key:"Koblenz",value:true},{key:"Koelliken",value:false},{key:"Kuenten",value:false},{key:"Kuettigen",value:false},{key:"Laufenburg",value:false},{key:"Leibstadt",value:false},{key:"Leimbach (AG)",value:false},{key:"Lengnau (AG)",value:false},{key:"Lenzburg",value:false},{key:"Leuggern",value:false},{key:"Leutwil",value:false},{key:"Linn",value:false},{key:"Lupfig",value:false},{key:"Magden",value:false},{key:"Mandach",value:false},{key:"Meisterschwanden",value:false},{key:"Mellikon",value:false},{key:"Mellingen",value:false},{key:"Menziken",value:false},{key:"Merenschwand",value:false},{key:"Mettau",value:false},{key:"Moosleerau",value:false},{key:"Muhen",value:false},{key:"Mumpf",value:false},{key:"Murgenthal",value:false},{key:"Muri (AG)",value:false},{key:"Maegenwil",value:false},{key:"Moehlin",value:false},{key:"Moenthal",value:false},{key:"Moeriken-Wildegg",value:false},{key:"Muehlau",value:false},{key:"Mühlethal",value:false},{key:"Mülligen",value:false},{key:"Muenchwilen (AG)",value:false},{key:"Neuenhof",value:false},{key:"Niederlenz",value:false},{key:"Niederrohrdorf",value:false},{key:"Niederwil (AG)",value:false},{key:"Oberbözberg",value:false},{key:"Oberehrendingen",value:false},{key:"Oberentfelden",value:false},{key:"Oberflachs",value:false},{key:"Oberhof",value:false},{key:"Oberhofen (AG)",value:false},{key:"Oberkulm",value:false},{key:"Oberlunkhofen",value:false},{key:"Obermumpf",value:false},{key:"Oberrohrdorf",value:false},{key:"Oberrueti",value:false},{key:"Obersiggenthal",value:false},{key:"Oberwil-Lieli",value:false},{key:"Oeschgen",value:false},{key:"Oftringen",value:true},{key:"Olsberg",value:false},{key:"Othmarsingen",value:false},{key:"Reinach (AG)",value:false},{key:"Reitnau",value:false},{key:"Rekingen (AG)",value:false},{key:"Remetschwil",value:false},{key:"Remigen",value:false},{key:"Rheinfelden",value:false},{key:"Rietheim",value:false},{key:"Riniken",value:false},{key:"Rohr (AG)",value:false},{key:"Rothrist",value:false},{key:"Rottenschwil",value:false},{key:"Rudolfstetten-Friedlisberg",value:false},{key:"Rupperswil",value:false},{key:"Ruefenach",value:false},{key:"Ruemikon",value:false},{key:"Safenwil",value:false},{key:"Sarmenstorf",value:false},{key:"Schafisheim",value:false},{key:"Scherz",value:false},{key:"Schinznach Bad",value:false},{key:"Schinznach Dorf",value:false},{key:"Schlossrued",value:false},{key:"Schmiedrued",value:false},{key:"Schneisingen",value:false},{key:"Schupfart",value:false},{key:"Schwaderloch",value:false},{key:"Schöftland",value:false},{key:"Seengen",value:false},{key:"Seon",value:false},{key:"Siglistorf",value:false},{key:"Sins",value:false},{key:"Sisseln",value:false},{key:"Spreitenbach",value:false},{key:"Staffelbach",value:false},{key:"Staufen",value:false},{key:"Stein (AG)",value:false},{key:"Stetten (AG)",value:false},{key:"Stilli",value:false},{key:"Strengelbach",value:false},{key:"Suhr",value:false},{key:"Sulz (AG)",value:false},{key:"Tegerfelden",value:false},{key:"Teufenthal (AG)",value:false},{key:"Thalheim (AG)",value:false},{key:"Turgi",value:false},{key:"Tägerig",value:false},{key:"Ueken",value:false},{key:"Uerkheim",value:false},{key:"Uezwil",value:false},{key:"Umiken",value:false},{key:"Unterboezberg",value:false},{key:"Unterehrendingen",value:false},{key:"Unterendingen",value:false},{key:"Unterentfelden",value:false},{key:"Unterkulm",value:false},{key:"Unterlunkhofen",value:false},{key:"Untersiggenthal",value:false},{key:"Veltheim (AG)",value:false},{key:"Villigen",value:false},{key:"Villmergen",value:false},{key:"Villnachern",value:false},{key:"Vordemwald",value:false},{key:"Wallbach",value:false},{key:"Waltenschwil",value:false},{key:"Wegenstetten",value:false},{key:"Wettingen",value:false},{key:"Widen",value:false},{key:"Wil (AG)",value:false},{key:"Wiliberg",value:false},{key:"Windisch",value:false},{key:"Wislikofen",value:false},{key:"Wittnau",value:false},{key:"Wohlen (AG)",value:false},{key:"Wohlenschwil",value:false},{key:"Wölflinswil",value:false},{key:"Würenlingen",value:false},{key:"Würenlos",value:false},{key:"Zeihen",value:false},{key:"Zeiningen",value:false},{key:"Zetzwil",value:false},{key:"Zofingen",value:false},{key:"Zufikon",value:false},{key:"Zurzach",value:false},{key:"Zuzgen",value:false});
- //usage: var newSelList = new selectionList(groupName,elementsArray,width,xOffset,yOffset,heightNrElements,preSelect,functionToCall);
- //create an empty group with the id as specified above in parameter 'groupName'
- comboFruits = new combobox("fruits","fruits",fruitsGerman,170,50,50,comboBoxCellHeight,comboBoxTextpadding,7,false,0,comboBoxtextStyles,comboBoxStyles,comboBoxScrollbarStyles,comboBoxSmallrectStyles,comboBoxHighlightStyles,comboBoxTriangleStyles,undefined);
- //selFruits.sortList("asc");
- var comboRoses = new combobox("roses","roses",roses,170,50,300,comboBoxCellHeight,comboBoxTextpadding,5,true,50,comboBoxtextStyles,comboBoxStyles,comboBoxScrollbarStyles,comboBoxSmallrectStyles,comboBoxHighlightStyles,comboBoxTriangleStyles,showRoses);
- comboFlowers = new combobox("flowers","flowers",flowers,170,50,550,comboBoxCellHeight,comboBoxTextpadding,8,true,2,comboBoxtextStyles,comboBoxStyles,comboBoxScrollbarStyles,comboBoxSmallrectStyles,comboBoxHighlightStyles,comboBoxTriangleStyles,undefined);
- var comboCommunitiesAargau = new combobox("communitiesAarau","communitiesAarau",communitiesAarau,150,50,200,comboBoxCellHeight,comboBoxTextpadding,10,true,25,comboBoxtextStyles,comboBoxStyles,comboBoxScrollbarStyles,comboBoxSmallrectStyles,comboBoxHighlightStyles,comboBoxTriangleStyles,undefined);
- //select additional elements by name
- //var additionalElements = new Array({key:"Boswil",value:true},{key:"Brugg",value:true},{key:"Brunegg",value:true},{key:"Buttwil",value:false});
- //comboCommunitiesAargau.selectElementsByName(additionalElements,false);
- //select additional elements by index
- //var additionalElements = new Array({index:0,value:true},{index:2,value:true},{index:4,value:true},{index:6,value:false});
- //comboCommunitiesAargau.selectElementsByPosition(additionalElements,false);
- //sort communities desc
- //comboFruits.sortList("asc");
- //get current selections
- //alert(comboCommunitiesAargau.getCurrentSelections().join(","));
- //get current selections index
- //alert(comboCommunitiesAargau.getCurrentSelectionsIndex().join(","));
- //remove combobox
- //comboCommunitiesAargau.removeCombobox();
- //delete elements
- //var deleteElements = new Array("Boswil","Brugg","Brunegg","Buttwil");
- //comboCommunitiesAargau.deleteElementsByName(deleteElements,false);
- //delete element by position, zero based
- //comboCommunitiesAargau.deleteElementByPosition(1,false);
- //add element at a certain position
- //comboCommunitiesAargau.addElementAtPosition({key:"Götzens",value:true},0,false);
- //add multiple elements alphabetically
- //var addElementsArray = new Array({key:"Zürich",value:true},{key:"Rickenbach (ZH)",value:true},{key:"Innsbruck",value:false});
- //comboCommunitiesAargau.addElementsAlphabetically(addElementsArray,"desc",false);
-}
-
-function removeSelFlowers() {
- if (selFlowers.exists == true) {
- selFlowers.removeSelectionList();
- }
- else {
- alert('selectionList already removed');
- }
-}
-
-function showRoses(comboboxName,selectedValues,selectedIndizes) {
- var rosesString = selectedValues.join(",");
- if (rosesString.length == 0) {
- rosesString = " ";
- }
- document.getElementById("selectedRoses").firstChild.nodeValue = rosesString;
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/initSelectionList.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/initSelectionList.js
deleted file mode 100644
index 7fea150..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/initSelectionList.js
+++ /dev/null
@@ -1,91 +0,0 @@
-//mapApp that handles window resizing
-var myMapApp = new mapApp(false,undefined);
-var fruitSorts;
-var myFruitsResult = new fruitsResult();
-
-//global selectionLists
-var selFruits;
-var selFlowers;
-var selCommunitiesAargau;
-var selRoses;
-var selnumbers1;
-var selnumbers2;
-
-function initMap(evt) {
- //styling parameters
- var selBoxCellHeight = 16;
- var selBoxTextpadding = 3;
- var selBoxtextStyles = {"font-family":"Arial,Helvetica","font-size":11,"fill":"dimgray"};
- var selBoxStyles = {"stroke":"dimgray","stroke-width":1,"fill":"white"};
- var selBoxScrollbarStyles = {"stroke":"dimgray","stroke-width":1,"fill":"whitesmoke"};
- var selBoxSmallrectStyles = {"stroke":"dimgray","stroke-width":1,"fill":"lightgray"};
- var selBoxHighlightStyles = {"fill":"dimgray","fill-opacity":0.3};
- var selBoxTriangleStyles = {"fill":"dimgray"};
-
- //arrays for selectionList data
- var fruits = ["Oranges","Apples","Bananas","Pears"];
- fruitSorts = {"Oranges":["Navel"],"Apples":["Fuji","Granny Smith","Pink Lady"],"Bananas":["Chiquita","Havel"],"Pears":["Alexander","Gute Luise"]};
- var flowers = new Array("Acacia","Acanthus","Amaranth","Anthericum","Arum","Ash","Aspen","Aster","Balm","Barbery","Basil","Bellflower","Bindweed","Bird cherry-tree","Black thorn","Bladder-senna","Bluebottle","Borage","Box");
- var roses = new Array("Butterscotch","Ci Peace","Impatient","Lady Hillingdon","Lavaglut","Mission Bells","Sexy Rexy","Souvenir de Pierre Notting","Sunflare","Whisky Mac","Whisper Floribunda");
- var communitiesAarau = new Array("Aarau","Aarburg","Abtwil","Ammerswil","Aristau","Arni (AG)","Attelwil","Auenstein","Auw","Baden","Baldingen","Beinwil (Freiamt)","Beinwil am See","Bellikon","Benzenschwil","Bergdietikon","Berikon","Besenbueren","Bettwil","Biberstein","Birmenstorf (AG)","Birr","Birrhard","Birrwil","Boniswil","Boswil","Bottenwil","Bremgarten (AG)","Brittnau","Brugg","Brunegg","Buchs (AG)","Burg (AG)","Buttwil","Boebikon","Boettstein","Boezen","Buenzen","Buettikon","Densbueren","Dietwil","Dintikon","Dottikon","Doettingen","Duerrenaesch","Effingen","Eggenwil","Egliswil","Eiken","Elfingen","Endingen","Ennetbaden","Erlinsbach","Etzgen","Fahrwangen","Fischbach-Goeslikon","Fisibach","Fislisbach","Freienwil","Frick","Full-Reuenthal","Gallenkirch","Gansingen","Gebenstorf","Geltwil","Gipf-Oberfrick","Gontenschwil","Graenichen","Habsburg","Hallwil","Hausen bei Brugg","Hellikon","Hendschiken","Hermetschwil-Staffeln","Herznach","Hilfikon","Hirschthal","Holderbank (AG)","Holziken","Hornussen","Hottwil","Hunzenschwil","Haegglingen","Islisberg","Ittenthal","Jonen","Kaiseraugst","Kaiserstuhl","Kaisten","Kallern","Killwangen","Kirchleerau","Klingnau","Koblenz","Koelliken","Kuenten","Kuettigen","Laufenburg","Leibstadt","Leimbach (AG)","Lengnau (AG)","Lenzburg","Leuggern","Leutwil","Linn","Lupfig","Magden","Mandach","Meisterschwanden","Mellikon","Mellingen","Menziken","Merenschwand","Mettau","Moosleerau","Muhen","Mumpf","Murgenthal","Muri (AG)","Maegenwil","Moehlin","Moenthal","Moeriken-Wildegg","Muehlau","Muehlethal","Muelligen","Muenchwilen (AG)","Neuenhof","Niederlenz","Niederrohrdorf","Niederwil (AG)","Oberboezberg","Oberehrendingen","Oberentfelden","Oberflachs","Oberhof","Oberhofen (AG)","Oberkulm","Oberlunkhofen","Obermumpf","Oberrohrdorf","Oberrueti","Obersiggenthal","Oberwil-Lieli","Oeschgen","Oftringen","Olsberg","Othmarsingen","Reinach (AG)","Reitnau","Rekingen (AG)","Remetschwil","Remigen","Rheinfelden","Rietheim","Riniken","Rohr (AG)","Rothrist","Rottenschwil","Rudolfstetten-Friedlisberg","Rupperswil","Ruefenach","Ruemikon","Safenwil","Sarmenstorf","Schafisheim","Scherz","Schinznach Bad","Schinznach Dorf","Schlossrued","Schmiedrued","Schneisingen","Schupfart","Schwaderloch","Schoeftland","Seengen","Seon","Siglistorf","Sins","Sisseln","Spreitenbach","Staffelbach","Staufen","Stein (AG)","Stetten (AG)","Stilli","Strengelbach","Suhr","Sulz (AG)","Tegerfelden","Teufenthal (AG)","Thalheim (AG)","Turgi","Taegerig","Ueken","Uerkheim","Uezwil","Umiken","Unterboezberg","Unterehrendingen","Unterendingen","Unterentfelden","Unterkulm","Unterlunkhofen","Untersiggenthal","Veltheim (AG)","Villigen","Villmergen","Villnachern","Vordemwald","Wallbach","Waltenschwil","Wegenstetten","Wettingen","Widen","Wil (AG)","Wiliberg","Windisch","Wislikofen","Wittnau","Wohlen (AG)","Wohlenschwil","Woelflinswil","Wuerenlingen","Wuerenlos","Zeihen","Zeiningen","Zetzwil","Zofingen","Zufikon","Zurzach","Zuzgen");
-
- //usage: var newSelList = new selectionList(groupId,elementsArray,width,xOffset,yOffset,cellHeight,textPadding,heightNrElements,textStyles,boxStyles,scrollbarStyles,smallrectStyles,highlightStyles,triangleStyles,preSelect,openAbove,putOnTopOfParent,functionToCall);
- //create an empty group with the id as specified above in parameter 'groupId'
- selFruits = new selectionList("fruits","fruits",fruits,170,50,50,selBoxCellHeight,selBoxTextpadding,7,selBoxtextStyles,selBoxStyles,selBoxScrollbarStyles,selBoxSmallrectStyles,selBoxHighlightStyles,selBoxTriangleStyles,3,false,true,myFruitsResult);
- selFruits.sortList("asc");
- selRoses = new selectionList("roses","roses",roses,170,50,100,selBoxCellHeight,selBoxTextpadding,4,selBoxtextStyles,selBoxStyles,selBoxScrollbarStyles,selBoxSmallrectStyles,selBoxHighlightStyles,selBoxTriangleStyles,0,false,true,showRoses);
- selFlowers = new selectionList("flowers","flowers",flowers,170,50,720,selBoxCellHeight,selBoxTextpadding,5,selBoxtextStyles,selBoxStyles,selBoxScrollbarStyles,selBoxSmallrectStyles,selBoxHighlightStyles,selBoxTriangleStyles,0,true,true,undefined);
- selCommunitiesAargau = new selectionList("communitiesAarau","communitiesAarau",communitiesAarau,150,50,200,selBoxCellHeight,selBoxTextpadding,10,selBoxtextStyles,selBoxStyles,selBoxScrollbarStyles,selBoxSmallrectStyles,selBoxHighlightStyles,selBoxTriangleStyles,0,false,true,undefined);
- var numbers1 = new Array("1","2","3","4","5","6","7","8","9");
- var newArray = generateRandomArray("1");
- selnumbers2 = new selectionList("numbers2","selnumbers",newArray,50,700,100,selBoxCellHeight,selBoxTextpadding,10,selBoxtextStyles,selBoxStyles,selBoxScrollbarStyles,selBoxSmallrectStyles,selBoxHighlightStyles,selBoxTriangleStyles,0,false,true,undefined);
- selnumbers1 = new selectionList("numbers1","selnumbers",numbers1,30,700,50,selBoxCellHeight,selBoxTextpadding,10,selBoxtextStyles,selBoxStyles,selBoxScrollbarStyles,selBoxSmallrectStyles,selBoxHighlightStyles,selBoxTriangleStyles,0,false,true,updateNumbers2);
-}
-
-function removeSelFlowers() {
- if (selFlowers.exists == true) {
- selFlowers.removeSelectionList();
- }
- else {
- alert('selectionList already removed');
- }
-}
-
-function fruitsResult() { }
-
-fruitsResult.prototype.getSelectionListVal = function(selBoxName,fruitNr,arrayVal) {
- alert("You selected Fruit Nr. "+(fruitNr+1)+": "+arrayVal+". Yum!\nAvailable Sorts are: "+fruitSorts[arrayVal].join(", "));
-}
-
-function showRoses(selBoxName,roseNr,arrayVal) {
- document.getElementById("rosename").firstChild.nodeValue = arrayVal;
- roseName = "images/" + arrayVal.toLowerCase().replace(/\s/g,"_") + ".jpg";
- document.getElementById("roseimage").setAttributeNS(xlinkNS,"xlink:href",roseName);
-}
-
-function toggleAargauOpenMode() {
- if (selCommunitiesAargau.openAbove) {
- selCommunitiesAargau.openAbove = false;
- }
- else {
- selCommunitiesAargau.openAbove = true;
- }
-}
-
-function generateRandomArray(baseVal) {
- var newArray = new Array();
- for(var i=0;i<10;i++) {
-
-// THIS LINE IS OUTCOMMENTED TO GET CONSISTENT RESULTS WHEN LAYOUT TESTING IN WEBKIT!
-// newArray[i] = baseVal + (Math.round(Math.random()*1000));
-
- newArray[i] = baseVal;
- }
- return newArray;
-}
-
-function updateNumbers2(selBoxName,index,value) {
- var newArray = generateRandomArray(value);
- selnumbers2.elementsArray = newArray;
- selnumbers2.selectElementByPosition(0,false);
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/mapApp.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/mapApp.js
deleted file mode 100644
index ccdaef2..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/mapApp.js
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
-Scripts for creating SVG apps, converting clientX/Y to viewBox coordinates
-and for displaying tooltips
-
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.2, 2006-10-06
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* thanks to Kevin Lindsey for his many examples and providing the ViewBox class
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/mapApp/
-
-----
-
-current version: 1.2
-
-version history:
-1.0 (2006-06-01)
-initial version
-Was programmed earlier, but now documented
-
-1.1 (2006-06-15)
-added properties this.innerWidth, this.innerHeight (wrapper around different behaviour of viewers), added method ".adjustViewBox()" to adjust the viewBox to the this.innerWidth and this.innerHeight of the UA's window
-
-1.2 (2006-10-06)
-added two new constructor parameter "adjustVBonWindowResize" and "resizeCallbackFunction". If the first parameter is set to true, the viewBox of this mapApp will always adjust itself to the innerWidth and innerHeight of the browser window or frame containing the SVG application
-the "resizeCallbackFunction" can be of type "function", later potentially also of type "object". This function is called every time the mapApp was resized (browser/UA window was resized). It isn't called the first time when the mapApp was initialized
-added a new way to detect resize events in Firefox which didn't implement the SVGResize event so far
-added several arrays to hold GUI references
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/mapApp/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this code, please link to the original (http://www.carto.net/papers/svg/gui/mapApp/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-//this mapApp object helps to convert clientX/clientY coordinates to the coordinates of the group where the element is within
-//normally one can just use .getScreenCTM(), but ASV3 does not implement it, 95% of the code in this function is for ASV3!!!
-//credits: Kevin Lindsey for his example at http://www.kevlindev.com/gui/utilities/viewbox/ViewBox.js
-function mapApp(adjustVBonWindowResize,resizeCallbackFunction) {
- this.adjustVBonWindowResize = adjustVBonWindowResize;
- this.resizeCallbackFunction = resizeCallbackFunction;
- this.initialized = false;
- if (!document.documentElement.getScreenCTM) {
- //add zoom and pan event event to document element
- //this part is only required for viewers not supporting document.documentElement.getScreenCTM() (e.g. ASV3)
- document.documentElement.addEventListener("SVGScroll",this,false);
- document.documentElement.addEventListener("SVGZoom",this,false);
- }
- //add SVGResize event, note that because FF does not yet support the SVGResize event, there is a workaround
- try {
- //browsers with native SVG support
- window.addEventListener("resize",this,false);
- }
- catch(er) {
- //SVG UAs, like Batik and ASV/Iex
- document.documentElement.addEventListener("SVGResize",this,false);
- }
- //determine the browser main version
- this.navigator = "Batik";
- if (window.navigator) {
- if (window.navigator.appName.match(/Adobe/gi)) {
- this.navigator = "Adobe";
- }
- if (window.navigator.appName.match(/Netscape/gi)) {
- this.navigator = "Mozilla";
- }
- if (window.navigator.appName.match(/Opera/gi)) {
- this.navigator = "Opera";
- }
- if (window.navigator.appName.match(/Safari/gi)) {
- this.navigator = "Safari";
- }
- }
- //we need to call this once to initialize this.innerWidth/this.innerHeight
- this.resetFactors();
- //per default, tooltips are disabled
- this.tooltipsEnabled = false;
- //create new arrays to hold GUI references
- this.Windows = new Array();
- this.checkBoxes = new Array();
- this.radioButtonGroups = new Array();
- this.tabgroups = new Array();
- this.textboxes = new Array();
- this.buttons = new Array();
- this.selectionLists = new Array();
- this.comboboxes = new Array();
- this.sliders = new Array();
- this.scrollbars = new Array();
- this.colourPickers = new Array();
-}
-
-mapApp.prototype.handleEvent = function(evt) {
- if (evt.type == "SVGResize" || evt.type == "resize" || evt.type == "SVGScroll" || evt.type == "SVGZoom") {
- this.resetFactors();
- }
- if ((evt.type == "mouseover" || evt.type == "mouseout" || evt.type == "mousemove") && this.tooltipsEnabled) {
- this.displayTooltip(evt);
- }
-}
-
-mapApp.prototype.resetFactors = function() {
- //set inner width and height
- if (window.innerWidth) {
- this.innerWidth = window.innerWidth;
- this.innerHeight = window.innerHeight;
- }
- else {
- var viewPort = document.documentElement.viewport;
- this.innerWidth = viewPort.width;
- this.innerHeight = viewPort.height;
- }
- if (this.adjustVBonWindowResize) {
- this.adjustViewBox();
- }
- //this code is for ASV3
- if (!document.documentElement.getScreenCTM) {
- var svgroot = document.documentElement;
- this.viewBox = new ViewBox(svgroot);
- var trans = svgroot.currentTranslate;
- var scale = svgroot.currentScale;
- this.m = this.viewBox.getTM();
- //undo effects of zoom and pan
- this.m = this.m.scale( 1/scale );
- this.m = this.m.translate(-trans.x, -trans.y);
- }
- if (this.resizeCallbackFunction && this.initialized) {
- if (typeof(this.resizeCallbackFunction) == "function") {
- this.resizeCallbackFunction();
- }
- }
- this.initialized = true;
-}
-
-//set viewBox of document.documentElement to innerWidth and innerHeight
-mapApp.prototype.adjustViewBox = function() {
- document.documentElement.setAttributeNS(null,"viewBox","0 0 "+this.innerWidth+" "+this.innerHeight);
-}
-
-mapApp.prototype.calcCoord = function(evt,ctmNode) {
- var svgPoint = document.documentElement.createSVGPoint();
- svgPoint.x = evt.clientX;
- svgPoint.y = evt.clientY;
- if (!document.documentElement.getScreenCTM) {
- //undo the effect of transformations
- if (ctmNode) {
- var matrix = getTransformToRootElement(ctmNode);
- }
- else {
- var matrix = getTransformToRootElement(evt.target);
- }
- svgPoint = svgPoint.matrixTransform(matrix.inverse().multiply(this.m));
- }
- else {
- //case getScreenCTM is available
- if (ctmNode) {
- var matrix = ctmNode.getScreenCTM();
- }
- else {
- var matrix = evt.target.getScreenCTM();
- }
- svgPoint = svgPoint.matrixTransform(matrix.inverse());
- }
- //undo the effect of viewBox and zoomin/scroll
- return svgPoint;
-}
-
-mapApp.prototype.calcInvCoord = function(svgPoint) {
- if (!document.documentElement.getScreenCTM) {
- var matrix = getTransformToRootElement(document.documentElement);
- }
- else {
- var matrix = document.documentElement.getScreenCTM();
- }
- svgPoint = svgPoint.matrixTransform(matrix);
- return svgPoint;
-}
-
-//initialize tootlips
-mapApp.prototype.initTooltips = function(groupId,tooltipTextAttribs,tooltipRectAttribs,xOffset,yOffset,padding) {
- var nrArguments = 6;
- if (arguments.length == nrArguments) {
- this.toolTipGroup = document.getElementById(groupId);
- this.tooltipTextAttribs = tooltipTextAttribs;
- if (!this.tooltipTextAttribs["font-size"]) {
- this.tooltipTextAttribs["font-size"] = 12;
- }
- this.tooltipRectAttribs = tooltipRectAttribs;
- this.xOffset = xOffset;
- this.yOffset = yOffset;
- this.padding = padding;
- if (!this.toolTipGroup) {
- alert("Error: could not find tooltip group with id '"+groupId+"'. Please specify a correct tooltip parent group id!");
- }
- else {
- //set tooltip group to invisible
- this.toolTipGroup.setAttributeNS(null,"visibility","hidden");
- this.toolTipGroup.setAttributeNS(null,"pointer-events","none");
- this.tooltipsEnabled = true;
- //create tooltip text element
- this.tooltipText = document.createElementNS(svgNS,"text");
- for (var attrib in this.tooltipTextAttribs) {
- value = this.tooltipTextAttribs[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- this.tooltipText.setAttributeNS(null,attrib,value);
- }
- //create textnode
- var textNode = document.createTextNode("Tooltip");
- this.tooltipText.appendChild(textNode);
- this.toolTipGroup.appendChild(this.tooltipText);
- var bbox = this.tooltipText.getBBox();
- this.tooltipRect = document.createElementNS(svgNS,"rect");
- this.tooltipRect.setAttributeNS(null,"x",bbox.x-this.padding);
- this.tooltipRect.setAttributeNS(null,"y",bbox.y-this.padding);
- this.tooltipRect.setAttributeNS(null,"width",bbox.width+this.padding*2);
- this.tooltipRect.setAttributeNS(null,"height",bbox.height+this.padding*2);
- for (var attrib in this.tooltipRectAttribs) {
- this.tooltipRect.setAttributeNS(null,attrib,this.tooltipRectAttribs[attrib]);
- }
- this.toolTipGroup.insertBefore(this.tooltipRect,this.tooltipText);
- }
- }
- else {
- alert("Error in method 'initTooltips': wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
-}
-
-mapApp.prototype.addTooltip = function(tooltipNode,tooltipTextvalue,followmouse,checkForUpdates,targetOrCurrentTarget,childAttrib) {
- var nrArguments = 6;
- if (arguments.length == nrArguments) {
- //get reference
- if (typeof(tooltipNode) == "string") {
- tooltipNode = document.getElementById(tooltipNode);
- }
- //check if tooltip attribute present or create one
- if (!tooltipNode.hasAttributeNS(attribNS,"tooltip")) {
- if (tooltipTextvalue) {
- tooltipNode.setAttributeNS(attribNS,"tooltip",tooltipTextvalue);
- }
- else {
- tooltipNode.setAttributeNS(attribNS,"tooltip","Tooltip");
- }
- }
- //see if we need updates
- if (checkForUpdates) {
- tooltipNode.setAttributeNS(attribNS,"tooltipUpdates","true");
- }
- //see if we have to use evt.target
- if (targetOrCurrentTarget == "target") {
- tooltipNode.setAttributeNS(attribNS,"tooltipParent","true");
- }
- //add childAttrib
- if (childAttrib) {
- tooltipNode.setAttributeNS(attribNS,"tooltipAttrib",childAttrib);
- }
- //add event listeners
- tooltipNode.addEventListener("mouseover",this,false);
- tooltipNode.addEventListener("mouseout",this,false);
- if (followmouse) {
- tooltipNode.addEventListener("mousemove",this,false);
- }
- }
- else {
- alert("Error in method 'addTooltip()': wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
-}
-
-mapApp.prototype.displayTooltip = function(evt) {
- var curEl = evt.currentTarget;
- var coords = this.calcCoord(evt,this.toolTipGroup.parentNode);
- if (evt.type == "mouseover") {
- this.toolTipGroup.setAttributeNS(null,"visibility","visible");
- this.toolTipGroup.setAttributeNS(null,"transform","translate("+(coords.x+this.xOffset)+","+(coords.y+this.yOffset)+")");
- this.updateTooltip(evt);
- }
- if (evt.type == "mouseout") {
- this.toolTipGroup.setAttributeNS(null,"visibility","hidden");
- }
- if (evt.type == "mousemove") {
- this.toolTipGroup.setAttributeNS(null,"transform","translate("+(coords.x+this.xOffset)+","+(coords.y+this.yOffset)+")");
- if (curEl.hasAttributeNS(attribNS,"tooltipUpdates")) {
- this.updateTooltip(evt);
- }
- }
-}
-
-mapApp.prototype.updateTooltip = function(evt) {
- var el = evt.currentTarget;
- if (el.hasAttributeNS(attribNS,"tooltipParent")) {
- var attribName = "tooltip";
- if (el.hasAttributeNS(attribNS,"tooltipAttrib")) {
- attribName = el.getAttributeNS(attribNS,"tooltipAttrib");
- }
- el = evt.target;
- var myText = el.getAttributeNS(attribNS,attribName);
- }
- else {
- var myText = el.getAttributeNS(attribNS,"tooltip");
- }
- var textArray = myText.split("\\n");
- while(this.tooltipText.hasChildNodes()) {
- this.tooltipText.removeChild(this.tooltipText.lastChild);
- }
- for (var i=0;i<textArray.length;i++) {
- var tspanEl = document.createElementNS(svgNS,"tspan");
- tspanEl.setAttributeNS(null,"x",0);
- var dy = this.tooltipTextAttribs["font-size"];
- if (i == 0) {
- var dy = 0;
- }
- tspanEl.setAttributeNS(null,"dy",dy);
- var textNode = document.createTextNode(textArray[i]);
- tspanEl.appendChild(textNode);
- this.tooltipText.appendChild(tspanEl);
- }
- // set text and rect attributes
- var bbox = this.tooltipText.getBBox();
- this.tooltipRect.setAttributeNS(null,"x",bbox.x-this.padding);
- this.tooltipRect.setAttributeNS(null,"y",bbox.y-this.padding);
- this.tooltipRect.setAttributeNS(null,"width",bbox.width+this.padding*2);
- this.tooltipRect.setAttributeNS(null,"height",bbox.height+this.padding*2);
-}
-
-mapApp.prototype.enableTooltips = function() {
- this.tooltipsEnabled = true;
-}
-
-mapApp.prototype.disableTooltips = function() {
- this.tooltipsEnabled = false;
- this.toolTipGroup.setAttributeNS(null,"visibility","hidden");
-}
-
-/*************************************************************************/
-
-/*****
-*
-* ViewBox.js
-*
-* copyright 2002, Kevin Lindsey
-*
-*****/
-
-ViewBox.VERSION = "1.0";
-
-
-/*****
-*
-* constructor
-*
-*****/
-function ViewBox(svgNode) {
- if ( arguments.length > 0 ) {
- this.init(svgNode);
- }
-}
-
-
-/*****
-*
-* init
-*
-*****/
-ViewBox.prototype.init = function(svgNode) {
- var viewBox = svgNode.getAttributeNS(null, "viewBox");
- var preserveAspectRatio = svgNode.getAttributeNS(null, "preserveAspectRatio");
-
- if ( viewBox != "" ) {
- var params = viewBox.split(/\s*,\s*|\s+/);
-
- this.x = parseFloat( params[0] );
- this.y = parseFloat( params[1] );
- this.width = parseFloat( params[2] );
- this.height = parseFloat( params[3] );
- } else {
- this.x = 0;
- this.y = 0;
- this.width = innerWidth;
- this.height = innerHeight;
- }
-
- this.setPAR(preserveAspectRatio);
- var dummy = this.getTM(); //to initialize this.windowWidth/this.windowHeight
-};
-
-
-/*****
-*
-* getTM
-*
-*****/
-ViewBox.prototype.getTM = function() {
- var svgRoot = document.documentElement;
- var matrix = document.documentElement.createSVGMatrix();
- //case width/height contains percent
- this.windowWidth = svgRoot.getAttributeNS(null,"width");
- if (this.windowWidth.match(/%/) || this.windowWidth == null) {
- if (this.windowWidth == null) {
- if (window.innerWidth) {
- this.windowWidth = window.innerWidth;
- }
- else {
- this.windowWidth = svgRoot.viewport.width;
- }
- }
- else {
- var factor = parseFloat(this.windowWidth.replace(/%/,""))/100;
- if (window.innerWidth) {
- this.windowWidth = window.innerWidth * factor;
- }
- else {
- this.windowWidth = svgRoot.viewport.width * factor;
- }
- }
- }
- else {
- this.windowWidth = parseFloat(this.windowWidth);
- }
- this.windowHeight = svgRoot.getAttributeNS(null,"height");
- if (this.windowHeight.match(/%/) || this.windowHeight == null) {
- if (this.windowHeight == null) {
- if (window.innerHeight) {
- this.windowHeight = window.innerHeight;
- }
- else {
- this.windowHeight = svgRoot.viewport.height;
- }
- }
- else {
- var factor = parseFloat(this.windowHeight.replace(/%/,""))/100;
- if (window.innerHeight) {
- this.windowHeight = window.innerHeight * factor;
- }
- else {
- this.windowHeight = svgRoot.viewport.height * factor;
- }
- }
- }
- else {
- this.windowHeight = parseFloat(this.windowHeight);
- }
- var x_ratio = this.width / this.windowWidth;
- var y_ratio = this.height / this.windowHeight;
-
- matrix = matrix.translate(this.x, this.y);
- if ( this.alignX == "none" ) {
- matrix = matrix.scaleNonUniform( x_ratio, y_ratio );
- } else {
- if ( x_ratio < y_ratio && this.meetOrSlice == "meet" ||
- x_ratio > y_ratio && this.meetOrSlice == "slice" )
- {
- var x_trans = 0;
- var x_diff = this.windowWidth*y_ratio - this.width;
-
- if ( this.alignX == "Mid" )
- x_trans = -x_diff/2;
- else if ( this.alignX == "Max" )
- x_trans = -x_diff;
-
- matrix = matrix.translate(x_trans, 0);
- matrix = matrix.scale( y_ratio );
- }
- else if ( x_ratio > y_ratio && this.meetOrSlice == "meet" ||
- x_ratio < y_ratio && this.meetOrSlice == "slice" )
- {
- var y_trans = 0;
- var y_diff = this.windowHeight*x_ratio - this.height;
-
- if ( this.alignY == "Mid" )
- y_trans = -y_diff/2;
- else if ( this.alignY == "Max" )
- y_trans = -y_diff;
-
- matrix = matrix.translate(0, y_trans);
- matrix = matrix.scale( x_ratio );
- }
- else
- {
- // x_ratio == y_ratio so, there is no need to translate
- // We can scale by either value
- matrix = matrix.scale( x_ratio );
- }
- }
-
- return matrix;
-}
-
-
-/*****
-*
-* get/set methods
-*
-*****/
-
-/*****
-*
-* setPAR
-*
-*****/
-ViewBox.prototype.setPAR = function(PAR) {
- // NOTE: This function needs to use default values when encountering
- // unrecognized values
- if ( PAR ) {
- var params = PAR.split(/\s+/);
- var align = params[0];
-
- if ( align == "none" ) {
- this.alignX = "none";
- this.alignY = "none";
- } else {
- this.alignX = align.substring(1,4);
- this.alignY = align.substring(5,9);
- }
-
- if ( params.length == 2 ) {
- this.meetOrSlice = params[1];
- } else {
- this.meetOrSlice = "meet";
- }
- } else {
- this.align = "xMidYMid";
- this.alignX = "Mid";
- this.alignY = "Mid";
- this.meetOrSlice = "meet";
- }
-};
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/scrollbar.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/scrollbar.js
deleted file mode 100644
index 3fc069f..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/scrollbar.js
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
-Scripts to create interactive scrollbars in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 0.9.1, 2006-10-30
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-
-----
-
-current version: 0.9.1
-
-version history:
-0.9 (2006-10-12)
-initial version
-
-0.9.1 (2006-10-30)
-added .show(), .hide() and .remove() methods
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/scrollbar/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/scrollbar/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function scrollbar(id,parentNode,x,y,width,height,startValue,endValue,initialHeightPerc,initialOffset,scrollStep,scrollButtonLocations,scrollbarStyles,scrollerStyles,triangleStyles,highlightStyles,functionToCall) {
- var nrArguments = 17;
- var createScrollbar = true;
- if (arguments.length == nrArguments) {
- //get constructor variables
- this.id = id;
- this.parentNode = parentNode;
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- this.startValue = startValue;
- this.endValue = endValue;
- this.initialHeightPerc = initialHeightPerc;
- this.initialOffset = initialOffset;
- this.scrollStep = scrollStep; //this value indicates how much the slider will scroll when the arrow buttons are pressed, values are in percentage
- this.scrollButtonLocations = scrollButtonLocations;
- if (this.scrollButtonLocations != "bottom_bottom" && this.scrollButtonLocations != "top_bottom" && this.scrollButtonLocations && "top_top" && this.scrollButtonLocations != "none_none") {
- createScrollbar = false;
- alert("Error: parameter 'scrollButtonLocations' can only be of the following values: 'bottom_bottom' || 'top_top' || 'top_bottom' || 'none_none'.");
- }
- this.scrollbarStyles = scrollbarStyles;
- this.scrollerStyles = scrollerStyles;
- this.triangleStyles = triangleStyles;
- this.highlightStyles = highlightStyles;
- this.functionToCall = functionToCall;
- //additional properties to be used later
- this.horizOrVertical = "vertical"; //specifies wether scrollbar is horizontal or vertical
- this.cellHeight = this.width; //the height or width of the buttons on top or bottom of the scrollbar
- this.scrollStatus = false; //indicates whether scrolling is active
- this.buttonScrollActive = false; //indicates whether the scrollbutton is currently being pressed
- this.scrollbarScrollActive = false; //indicates whether the scrollbar is currently being pressed
- }
- else {
- createScrollbar = false;
- alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createScrollbar) {
- //create scrollbar
- var result = this.testParent();
- if (result) {
- //timer stuff
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
- this.createScrollbar();
- }
- else {
- alert("could not create or reference 'parentNode' of scrollbar with id '"+this.id+"'");
- }
- }
- else {
- alert("Could not create scrollbar with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-//test if parent group exists or create a new group at the end of the file
-scrollbar.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- this.parentGroup = document.createElementNS(svgNS,"g");
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g" || this.parentNode.nodeName == "svg:svg" || this.parentNode.nodeName == "svg:g") {
- this.parentNode.appendChild(this.parentGroup);
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if button group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- document.getElementById(this.parentNode).appendChild(this.parentGroup);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-//create scrollbar geometry
-scrollbar.prototype.createScrollbar = function() {
- //first determine if vertical of horizontal
- if (this.width > this.height) {
- this.horizOrVertical = "horizontal";
- this.cellHeight = this.height;
- }
- this.triangleFourth = Math.round(this.cellHeight / 4); //this is used to construct the triangles for the buttons
-
- if (this.scrollButtonLocations != "none_none") {
- this.scrollUpperRect = document.createElementNS(svgNS,"rect");
- this.scrollLowerRect = document.createElementNS(svgNS,"rect");
- this.scrollUpperTriangle = document.createElementNS(svgNS,"path");
- this.scrollLowerTriangle = document.createElementNS(svgNS,"path");
- }
-
- if (this.horizOrVertical == "vertical") {
- this.scrollUpperRectX = this.x;
- this.scrollLowerRectX = this.x;
- switch (this.scrollButtonLocations) {
- case "top_top":
- this.scrollbarX = this.x;
- this.scrollbarY = this.y + (2 * this.cellHeight);
- this.scrollbarWidth = this.width;
- this.scrollbarHeight = this.height - (2 * this.cellHeight);
- this.scrollUpperRectY = this.y;
- this.scrollLowerRectY = this.y + this.cellHeight;
- break;
- case "bottom_bottom":
- this.scrollbarX = this.x;
- this.scrollbarY = this.y;
- this.scrollbarWidth = this.width;
- this.scrollbarHeight = this.height - (2 * this.cellHeight);
- this.scrollUpperRectY = this.y + this.height - (2 * this.cellHeight);
- this.scrollLowerRectY = this.y + this.height - this.cellHeight;
- break;
- case "top_bottom":
- this.scrollbarX = this.x;
- this.scrollbarY = this.y + this.cellHeight;
- this.scrollbarWidth = this.width;
- this.scrollbarHeight = this.height - (2 * this.cellHeight);
- this.scrollUpperRectY = this.y;
- this.scrollLowerRectY = this.y + this.height - this.cellHeight;
- break;
- default:
- this.scrollbarX = this.x;
- this.scrollbarY = this.y;
- this.scrollbarWidth = this.width;
- this.scrollbarHeight = this.height;
- break;
- }
- var myUpperTriPath = "M"+(this.scrollUpperRectX + this.cellHeight * 0.5)+" "+(this.scrollUpperRectY + this.triangleFourth)+" L"+(this.scrollUpperRectX + 3 * this.triangleFourth)+" "+(this.scrollUpperRectY + 3 * this.triangleFourth)+" L"+(this.scrollUpperRectX + this.triangleFourth)+" "+(this.scrollUpperRectY + 3 * this.triangleFourth)+" Z";
- var myLowerTriPath = "M"+(this.scrollLowerRectX + this.cellHeight * 0.5)+" "+(this.scrollLowerRectY + 3 * this.triangleFourth)+" L"+(this.scrollLowerRectX + this.triangleFourth)+" "+(this.scrollLowerRectY + this.triangleFourth)+" L"+(this.scrollLowerRectX + this.triangleFourth * 3)+" "+(this.scrollLowerRectY + this.triangleFourth)+" Z";
- }
-
- if (this.horizOrVertical == "horizontal") {
- this.scrollUpperRectY = this.y;
- this.scrollLowerRectY = this.y;
- switch (this.scrollButtonLocations) {
- case "top_top":
- this.scrollbarX = this.x + (2 * this.cellHeight);
- this.scrollbarY = this.y;
- this.scrollbarWidth = this.width - (2 * this.cellHeight);
- this.scrollbarHeight = this.height;
- this.scrollUpperRectX = this.x;
- this.scrollLowerRectX = this.x + this.cellHeight;
- break;
- case "bottom_bottom":
- this.scrollbarX = this.x;
- this.scrollbarY = this.y;
- this.scrollbarWidth = this.width - (2 * this.cellHeight);
- this.scrollbarHeight = this.height;
- this.scrollUpperRectX = this.x + this.width - (2 * this.cellHeight);
- this.scrollLowerRectX = this.x + this.width - this.cellHeight;
- break;
- case "top_bottom":
- this.scrollbarX = this.x + this.cellHeight;
- this.scrollbarY = this.y;
- this.scrollbarWidth = this.width - (2 * this.cellHeight);
- this.scrollbarHeight = this.height;
- this.scrollUpperRectX = this.x;
- this.scrollLowerRectX = this.x + this.width - this.cellHeight;
- break;
- default:
- this.scrollbarX = this.x;
- this.scrollbarY = this.y;
- this.scrollbarWidth = this.width;
- this.scrollbarHeight = this.height;
- break;
- }
- var myUpperTriPath = "M"+(this.scrollUpperRectX + this.triangleFourth)+" "+(this.scrollUpperRectY + this.triangleFourth * 2)+" L"+(this.scrollUpperRectX + 3 * this.triangleFourth)+" "+(this.scrollUpperRectY + this.triangleFourth)+" L"+(this.scrollUpperRectX + 3 * this.triangleFourth)+" "+(this.scrollUpperRectY + 3 * this.triangleFourth)+" Z";
- var myLowerTriPath = "M"+(this.scrollLowerRectX + this.triangleFourth * 3)+" "+(this.scrollLowerRectY + 2 * this.triangleFourth)+" L"+(this.scrollLowerRectX + this.triangleFourth)+" "+(this.scrollLowerRectY + this.triangleFourth * 3)+" L"+(this.scrollLowerRectX + this.triangleFourth)+" "+(this.scrollLowerRectY + this.triangleFourth)+" Z";
- }
-
- this.scrollbar = document.createElementNS(svgNS,"rect");
- this.scrollbar.setAttributeNS(null,"x",this.scrollbarX);
- this.scrollbar.setAttributeNS(null,"y",this.scrollbarY);
- this.scrollbar.setAttributeNS(null,"width",this.scrollbarWidth);
- this.scrollbar.setAttributeNS(null,"height",this.scrollbarHeight);
- this.scrollbar.setAttributeNS(null,"id","scrollbar_"+this.id);
- for (var attrib in this.scrollbarStyles) {
- this.scrollbar.setAttributeNS(null,attrib,this.scrollbarStyles[attrib]);
- }
- this.scrollbar.addEventListener("mousedown",this,false);
- this.parentGroup.appendChild(this.scrollbar);
- //now create scroller
- this.scroller = document.createElementNS(svgNS,"rect");
- if (this.horizOrVertical == "vertical") {
- this.scroller.setAttributeNS(null,"x",this.scrollbarX);
- this.scrollerY = this.scrollbarY + (this.scrollbarHeight - this.scrollbarHeight * this.initialHeightPerc) * this.initialOffset;
- this.scroller.setAttributeNS(null,"y",this.scrollerY);
- this.scroller.setAttributeNS(null,"width",this.scrollbarWidth);
- this.scrollerHeight = this.scrollbarHeight * this.initialHeightPerc;
- this.scroller.setAttributeNS(null,"height",this.scrollerHeight);
- }
- if (this.horizOrVertical == "horizontal") {
- this.scrollerX = this.scrollbarX + (this.scrollbarWidth - this.scrollbarWidth * this.initialHeightPerc) * this.initialOffset;
- this.scroller.setAttributeNS(null,"x",this.scrollerX);
- this.scroller.setAttributeNS(null,"y",this.scrollbarY);
- this.scrollerWidth = this.scrollbarWidth * this.initialHeightPerc;
- this.scroller.setAttributeNS(null,"width",this.scrollerWidth);
- this.scroller.setAttributeNS(null,"height",this.scrollbarHeight);
- }
- for (var attrib in this.scrollerStyles) {
- this.scroller.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- //need to add events here
- this.scroller.setAttributeNS(null,"id","scroller_"+this.id);
- this.scroller.addEventListener("mousedown",this,false);
- this.parentGroup.appendChild(this.scroller);
- //append rects and triangles
- if (this.scrollButtonLocations != "none_none") {
- //upper rect
- for (var attrib in this.scrollerStyles) {
- this.scrollUpperRect.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- this.scrollUpperRect.setAttributeNS(null,"x",this.scrollUpperRectX);
- this.scrollUpperRect.setAttributeNS(null,"y",this.scrollUpperRectY);
- this.scrollUpperRect.setAttributeNS(null,"width",this.cellHeight);
- this.scrollUpperRect.setAttributeNS(null,"height",this.cellHeight);
- this.scrollUpperRect.addEventListener("mousedown", this, false);
- this.scrollUpperRect.setAttributeNS(null,"id","scrollUpperRect_"+this.id);
- this.parentGroup.appendChild(this.scrollUpperRect);
- //lower rect
- for (var attrib in this.scrollerStyles) {
- this.scrollLowerRect.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- this.scrollLowerRect.setAttributeNS(null,"x",this.scrollLowerRectX);
- this.scrollLowerRect.setAttributeNS(null,"y",this.scrollLowerRectY);
- this.scrollLowerRect.setAttributeNS(null,"width",this.cellHeight);
- this.scrollLowerRect.setAttributeNS(null,"height",this.cellHeight);
- this.scrollLowerRect.addEventListener("mousedown", this, false);
- this.scrollLowerRect.setAttributeNS(null,"id","scrollLowerRect_"+this.id);
- this.parentGroup.appendChild(this.scrollLowerRect);
- //upper triangle
- this.scrollUpperTriangle.setAttributeNS(null,"d",myUpperTriPath);
- this.scrollUpperTriangle.setAttributeNS(null,"pointer-events","none");
- for (var attrib in this.triangleStyles) {
- this.scrollUpperTriangle.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- this.parentGroup.appendChild(this.scrollUpperTriangle);
- //lower triangle
- this.scrollLowerTriangle.setAttributeNS(null,"d",myLowerTriPath);
- this.scrollLowerTriangle.setAttributeNS(null,"pointer-events","none");
- for (var attrib in this.triangleStyles) {
- this.scrollLowerTriangle.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- this.parentGroup.appendChild(this.scrollLowerTriangle);
- }
- }
-
- scrollbar.prototype.handleEvent = function(evt) {
- var el = evt.target;
- var callerId = el.getAttributeNS(null,"id");
- if (evt.type == "mousedown") {
- if (callerId == "scroller_"+this.id) {
- //case the mouse went down on scroller
- this.scroll(evt);
- }
- if (callerId == "scrollLowerRect_"+this.id || callerId == "scrollUpperRect_"+this.id) {
- //this part is for scrolling per button
- this.buttonScrollActive = true;
- this.scrollDir = "down";
- this.currentScrollButton = evt.target;
- this.currentScrollTriangle = this.scrollLowerTriangle;
- if (callerId == "scrollUpperRect_"+this.id) {
- this.scrollDir = "up";
- this.currentScrollTriangle = this.scrollUpperTriangle;
- }
- document.documentElement.addEventListener("mouseup",this,false);
- //change appearance of button
- for (var attrib in this.scrollerStyles) {
- this.currentScrollButton.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.highlightStyles) {
- this.currentScrollButton.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- //change appearance of triangle
- for (var attrib in this.triangleStyles) {
- this.currentScrollTriangle.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.scrollerStyles) {
- this.currentScrollTriangle.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- this.scrollPercent(this.scrollDir,this.scrollStep);
- this.timer.setTimeout("scrollPerButton",400);
- }
- if (callerId == "scrollbar_"+this.id) {
- //this part is for scrolling when mouse is down on scrollbar
- var coords = myMapApp.calcCoord(evt,this.scrollbar);
- this.scrollbarScrollActive = true;
- this.scrollDir = "down";
- if (this.horizOrVertical == "vertical") {
- if (coords.y < this.scrollerY) {
- this.scrollDir = "up";
- }
- }
- if (this.horizOrVertical == "horizontal") {
- if (coords.x < this.scrollerX) {
- this.scrollDir = "up";
- }
- }
- document.documentElement.addEventListener("mouseup",this,false);
- //change styling
- for (var attrib in this.scrollerStyles) {
- this.scroller.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.highlightStyles) {
- this.scroller.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- this.scrollPercent(this.scrollDir,this.scrollStep*10);
- this.timer.setTimeout("scrollPerScrollbar",400);
- }
- }
- if (evt.type == "mousemove" && this.scrollStatus) {
- //this is for scrolling per scroller
- this.scroll(evt);
- }
- if (evt.type == "mouseup") {
- //this is for finishing the different scroll modi
- if (this.scrollStatus) {
- //finishing scroll per scroller
- this.scroll(evt);
- }
- if (this.buttonScrollActive) {
- //finishing scroll per button
- this.buttonScrollActive = false;
- document.documentElement.removeEventListener("mouseup",this,false);
- //change appearance of button
- for (var attrib in this.highlightStyles) {
- this.currentScrollButton.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.scrollerStyles) {
- this.currentScrollButton.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- //change appearance of triangle
- for (var attrib in this.scrollerStyles) {
- this.currentScrollTriangle.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.triangleStyles) {
- this.currentScrollTriangle.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- this.currentScrollButton = undefined;
- this.currentScrollTriangle = undefined;
- }
- if (this.scrollbarScrollActive) {
- //finishing scroll per scrollbar
- this.scrollbarScrollActive = false;
- document.documentElement.removeEventListener("mouseup",this,false);
- //change styling
- for (var attrib in this.highlightStyles) {
- this.scroller.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.scrollerStyles) {
- this.scroller.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- }
- }
-}
-
-scrollbar.prototype.scroll = function(evt) {
- var coords = myMapApp.calcCoord(evt,this.scrollbar);
- if (evt.type == "mousedown") {
- document.documentElement.addEventListener("mousemove",this,false);
- document.documentElement.addEventListener("mouseup",this,false);
- this.scrollStatus = true;
- this.panCoords = coords;
- this.fireFunction("scrollStart");
- //change styling
- for (var attrib in this.scrollerStyles) {
- this.scroller.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.highlightStyles) {
- this.scroller.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- if (evt.type == "mousemove") {
- var diffX = coords.x - this.panCoords.x;
- var diffY = coords.y - this.panCoords.y;
- var scrollerDiff = false;
- if (this.horizOrVertical == "vertical") {
- var scrollerOrigY = this.scrollerY;
- this.scrollerY += diffY;
- if (this.scrollerY < this.scrollbarY) {
- this.scrollerY = this.scrollbarY;
- }
- if ((this.scrollerY + this.scrollerHeight) > (this.scrollbarY + this.scrollbarHeight)) {
- this.scrollerY = this.scrollbarY + this.scrollbarHeight - this.scrollerHeight;
- }
- this.scroller.setAttributeNS(null,"y",this.scrollerY);
- if (scrollerOrigY != this.scrollerY) {
- scrollerDiff = true;
- }
- }
- if (this.horizOrVertical == "horizontal") {
- var scrollerOrigX = this.scrollerX;
- this.scrollerX += diffX;
- if (this.scrollerX < this.scrollbarX) {
- this.scrollerX = this.scrollbarX;
- }
- if ((this.scrollerX + this.scrollerWidth) > (this.scrollbarX + this.scrollbarWidth)) {
- this.scrollerX = this.scrollbarX + this.scrollbarWidth - this.scrollerWidth;
- }
- this.scroller.setAttributeNS(null,"x",this.scrollerX);
- if (scrollerOrigX != this.scrollerX) {
- scrollerDiff = true;
- }
- }
- if (scrollerDiff) {
- this.fireFunction("scrollChange");
- }
- this.panCoords = coords;
- }
- if (evt.type == "mouseup") {
- this.scrollStatus = false;
- document.documentElement.removeEventListener("mousemove",this,false);
- document.documentElement.removeEventListener("mouseup",this,false);
- //change styling
- for (var attrib in this.highlightStyles) {
- this.scroller.removeAttributeNS(null,attrib);
- }
- for (var attrib in this.scrollerStyles) {
- this.scroller.setAttributeNS(null,attrib,this.scrollerStyles[attrib]);
- }
- this.fireFunction("scrollEnd");
- }
-}
-
-scrollbar.prototype.scrollPercent = function(direction,increment) {
- var currentValues = this.getValue();
- if (direction == "up") {
- increment = increment * -1;
- }
- var newPercent = currentValues.perc + increment;
- if (newPercent < 0) {
- newPercent = 0;
- }
- if (newPercent > 1) {
- newPercent = 1;
- }
- this.scrollToPercent(newPercent);
-}
-
-scrollbar.prototype.scrollToPercent = function(percValue) {
- if (percValue >= 0 && percValue <= 1) {
- if (this.horizOrVertical == "vertical") {
- var newY = this.scrollbarY + (this.scrollbarHeight - this.scrollerHeight) * percValue;
- this.scrollerY = newY;
- this.scroller.setAttributeNS(null,"y",newY);
- }
- if (this.horizOrVertical == "horizontal") {
- var newX = this.scrollbarX + (this.scrollbarWidth - this.scrollerWidth) * percValue;
- this.scrollerX = newX;
- this.scroller.setAttributeNS(null,"x",newX);
- }
- this.fireFunction("scrolledStep");
- }
- else {
- alert("error in method '.scrollToPercent()' of scrollbar with id '"+this.id+"'. Value out of range. Value needs to be in range 0 <= value <= 1.");
- }
-}
-
-scrollbar.prototype.scrollPerButton = function() {
- if (this.buttonScrollActive) {
- this.scrollPercent(this.scrollDir,this.scrollStep);
- this.timer.setTimeout("scrollPerButton",150);
- }
-}
-
-scrollbar.prototype.scrollPerScrollbar = function() {
- if (this.scrollbarScrollActive) {
- this.scrollPercent(this.scrollDir,this.scrollStep*5);
- this.timer.setTimeout("scrollPerScrollbar",150);
- }
-}
-
-scrollbar.prototype.scrollToValue = function(value) {
- if ((value >= this.startValue && value <= this.endValue) || (value <= this.startValue && value >= this.endValue)) {
- var percValue = value/(this.endValue - this.startValue);
- this.scrollToPercent(percValue);
- }
- else {
- alert("Error in scrollbar with id '"+this.id+"': the provided value '"+value+"' is out of range. The valid range is between '"+this.startValue+"' and '"+this.endValue+"'");
- }
-}
-
-scrollbar.prototype.getValue = function() {
- var perc;
- if (this.horizOrVertical == "vertical") {
- perc = (this.scrollerY - this.scrollbarY) / (this.scrollbarHeight - this.scrollerHeight);
- }
- if (this.horizOrVertical == "horizontal") {
- perc = (this.scrollerX - this.scrollbarX) / (this.scrollbarWidth - this.scrollerWidth);
- }
- var abs = this.startValue + (this.endValue - this.startValue) * perc;
- return {"abs":abs,"perc":perc};
-}
-
-scrollbar.prototype.fireFunction = function(changeType) {
- var values = this.getValue();
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,changeType,values.abs,values.perc);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.scrollbarChanged(this.id,changeType,values.abs,values.perc);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-scrollbar.prototype.hide = function() {
- this.parentGroup.setAttributeNS(null,"display","none");
-}
-
-scrollbar.prototype.show = function() {
- this.parentGroup.setAttributeNS(null,"display","inherit");
-}
-
-scrollbar.prototype.remove = function() {
- this.parentGroup.parentNode.removeChild(this.parentGroup);
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/selectionList.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/selectionList.js
deleted file mode 100644
index ec9fb74..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/selectionList.js
+++ /dev/null
@@ -1,1065 +0,0 @@
-/*
-Scripts to create interactive selectionLists/Dropdown boxes in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.4, 2006-07-18
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* Initial code was taken from Michel Hirtzler --> pilat.free.fr (thanks!)
-* Thanks also to many people of svgdevelopers@yahoogroups.com
-* Suggestions by Bruce Rindahl
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/selectionlist/
-
-----
-
-current version: 1.4
-
-version history:
-0.99 (2004-10-26)
-initial version
-
-1.0 (2005-09-15)
-allow undefined values in callback function for selectionlists that need not react on changes (suggestion by Bruce Rindahl)
-allow selectionlist to be placed in a transformed group
-now also works in MozillaSVG (due to changes in mapApp.js)
-
-1.1 (2005-09-28)
-removed "string" option in functionToCall (not important any more). function and object should be good enough
-timer object from http://www.codingforums.com/showthread.php?s=&threadid=10531 is now used; attention: you need to link this script as well!
-due to the new timer object we can now also mouse down and scroll more than one entry until we mouseup again, previously one had to click for forwarding each individual element
-
-1.2 (2005-10-24)
-removed style attributes and replaced them with individual XML attributes
-initial tests on Opera 9 TP1, it seems to work except for the scrolling - due to a mouse-move event bug
-
-1.2.1 (2005-02-07)
-upgraded the documentation and fixed documentation errors
-
-1.2.2 (2006-02-16)
-added option to open selectionList to the top of the original box, this is useful for layouts where the selectionList is at the bottom of a page
-added option to always put the selectionList on the top of it's parent group after activation in order to force the geometry to be on the top of all other geometry within the same group
-improved background rectangle: these are now two rectangles: one on the bottom for the fill, one on the top for stroking
-tested with Opera 9 TP2, works now fine, except keyboard input
-
-1.2.3 (2006-02-21)
-removed dependency on replaceSpecialChars (in file helper_functions.js) as this is not really needed in a true utf8 environment.
-improved key event handling. People can now enter more than one key (within one second for each consequent key) and the list will jump to entries that match the keys; key events now also work in opera 9+ - however they sometimes collide with keyboard shortcuts.
-
-1.3 (2006-03-11)
-changed parameters of constructor (styling system): now an array of literals containing presentation attributes. Not hardcoded in selectionList.js anymore. Added check for number of arguments.
-
-1.4 (2006-07-18)
-added additional constructor parameter "parentNode", changed groupId to id, added methods .resize(width) and .moveTo(x,y)
-improved scrolling (now also possible outside of the scrollbar, once the mouse is down)
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/selectionlist/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-If you wish, you can modify parameters (such as "look and feel") in the function "selectionList" (constructor).
-You can adapt colors, fonts, cellpaddings, etc.
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/selectionlist/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function selectionList(id,parentNode,elementsArray,width,xOffset,yOffset,cellHeight,textPadding,heightNrElements,textStyles,boxStyles,scrollbarStyles,smallrectStyles,highlightStyles,triangleStyles,preSelect,openAbove,putOnTopOfParent,functionToCall) {
- var nrArguments = 19;
- var createSelbox= true;
- if (arguments.length == nrArguments) {
- //get constructor variables
- this.id = id; //the id or node reference of the group where the
- this.parentNode = parentNode; //can be of type string (id) or node reference (svg or g node)
- this.elementsArray = elementsArray; //the array containing the text elements of the selectionList
- this.width = width; //width of the selectionList in viewBox coordinates
- this.xOffset = xOffset; //upper left corner (xOffset) of selection list in viewBox coordinates
- this.yOffset = yOffset; //upper left corner (yOffset) of selection list in viewBox coordinates
- this.cellHeight = cellHeight; //cellHeight in viewBox coordinates
- this.heightNrElements = heightNrElements; //nr of elements for unfolded selectionList (number, integer)
- this.textStyles = textStyles; //array of literals containing presentation attributes for text
- if (!this.textStyles["font-size"]) {
- this.textStyles["font-size"] = "11";
- }
- this.boxStyles = boxStyles; //array of literals containing presentation attributes for the sel box
- if (!this.boxStyles["fill"]) {
- this.boxStyles["fill"] = "white"; //this fill value is also used for boxes under indiv. text elements (unselected status)
- }
- if (!this.boxStyles["stroke"]) {
- this.boxStyles["stroke"] = "dimgray";
- }
- if (!this.boxStyles["stroke-width"]) {
- this.boxStyles["stroke-width"] = 1;
- }
- this.scrollbarStyles = scrollbarStyles; //array of literals containing presentation attributes for the scrollbar
- this.smallrectStyles = smallrectStyles; //array of literals containing presentation attributes for the small rectangle next to selectbox
- this.highlightStyles = highlightStyles; //array of literals containing presentation attributes for the highlighted rectangles
- this.triangleStyles = triangleStyles; //array of literals containing presentation attributes for the triangle in the selectionList, also applies to fill of scroller
- this.preSelect = preSelect;
- this.openAbove = openAbove;
- this.putOnTopOfParent = putOnTopOfParent;
- this.functionToCall = functionToCall;
-
- //calculate other values
- this.triangleFourth = Math.round(this.cellHeight / 4); //this is only used internally
- this.textPadding = textPadding; //this is relative to the left of the cell
- this.textPaddingVertical = this.cellHeight - (this.cellHeight - this.textStyles["font-size"]) * 0.7; //this is relative to the top of the cell
- this.scrollerMinHeight = this.cellHeight * 0.5; //minimal height of the scroller rect
-
- //references
- this.scrollBar = undefined; //later a reference to the scrollbar rectangle
-
- //status variables
- this.activeSelection = this.preSelect; //holds currently selected index value
- this.listOpen = false; //status folded=false, open=true - previously been sLselectionVisible
- this.curLowerIndex = this.preSelect; //this value is adapted if the user moves scrollbar
- this.scrollStep = 0; //y-value to go for one element
- this.scrollerHeight = 0; //height of dragable scroller bar
- this.scrollActive = false; //determines if scrolling per up/down button is active
- this.panY = false; //stores the y value of event
- this.scrollCumulus = 0; //if value is less then a scrollstep we need to accumulate scroll values
- this.scrollDir = ""; //later holds "up" and "down"
- this.exists = true; //true means it exists, gets value false if method "removeSelectionList" is called
- this.pressedKeys = ""; //stores key events (pressed char values)
- this.keyTimer = undefined; //timer for resetting character strings after a given time period
- }
- else {
- createSelbox = false;
- alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createSelbox) {
- //timer stuff
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
- //createSelectionList
- this.createSelectionList();
- }
- else {
- alert("Could not create selectionlist with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-selectionList.prototype.createSelectionList = function() {
- var result = this.testParent();
- if (result) {
- //initial Rect, visible at the beginning
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset);
- node.setAttributeNS(null,"y",this.yOffset);
- node.setAttributeNS(null,"width",this.width);
- node.setAttributeNS(null,"height",this.cellHeight);
- for (var attrib in this.boxStyles) {
- node.setAttributeNS(null,attrib,this.boxStyles[attrib]);
- }
- node.setAttributeNS(null,"id","selRect_"+this.id);
- node.addEventListener("click", this, false);
- this.parentGroup.appendChild(node);
- //initial text
- this.selectedText = document.createElementNS(svgNS,"text");
- this.selectedText.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- this.selectedText.setAttributeNS(null,"y",this.yOffset + this.textPaddingVertical);
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- this.selectedText.setAttributeNS(null,attrib,value);
- }
- this.selectedText.setAttributeNS(null,"pointer-events","none");
- var selectionText = document.createTextNode(this.elementsArray[this.activeSelection]);
- this.selectedText.appendChild(selectionText);
- this.parentGroup.appendChild(this.selectedText);
- //small Rectangle to the right, onclick unfolds the selectionList
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- node.setAttributeNS(null,"y",this.yOffset);
- node.setAttributeNS(null,"width",this.cellHeight);
- node.setAttributeNS(null,"height",this.cellHeight);
- for (var attrib in this.smallrectStyles) {
- node.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- node.setAttributeNS(null,"id","selPulldown_"+this.id);
- node.addEventListener("click", this, false);
- this.parentGroup.appendChild(node);
- //triangle
- var node=document.createElementNS(svgNS,"path");
- var myTrianglePath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFourth)+" Z";
- node.setAttributeNS(null,"d",myTrianglePath);
- for (var attrib in this.triangleStyles) {
- node.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- node.setAttributeNS(null,"id","selTriangle_"+this.id);
- node.setAttributeNS(null,"pointer-events","none");
- this.parentGroup.appendChild(node);
- //rectangle below unfolded selectBox, at begin invisible
- this.rectBelowBox = document.createElementNS(svgNS,"rect");
- this.rectBelowBox.setAttributeNS(null,"x",this.xOffset);
- this.rectBelowBox.setAttributeNS(null,"y",this.yOffset + this.cellHeight);
- this.rectBelowBox.setAttributeNS(null,"width",this.width - this.cellHeight);
- this.rectBelowBox.setAttributeNS(null,"height",0);
- this.rectBelowBox.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- this.rectBelowBox.setAttributeNS(null,"display","none");
- this.parentGroup.appendChild(this.rectBelowBox);
- //rectangle below unfolded selectBox, at begin invisible
- this.rectAboveBox = document.createElementNS(svgNS,"rect");
- this.rectAboveBox.setAttributeNS(null,"x",this.xOffset);
- this.rectAboveBox.setAttributeNS(null,"y",this.yOffset + this.cellHeight);
- this.rectAboveBox.setAttributeNS(null,"width",this.width - this.cellHeight);
- this.rectAboveBox.setAttributeNS(null,"height",0);
- this.rectAboveBox.setAttributeNS(null,"fill","none");
- this.rectAboveBox.setAttributeNS(null,"stroke",this.boxStyles["stroke"]);
- this.rectAboveBox.setAttributeNS(null,"stroke-width",this.boxStyles["stroke-width"]);
- this.rectAboveBox.setAttributeNS(null,"display","none");
- this.parentGroup.appendChild(this.rectAboveBox);
- }
- else {
- alert("could not create or reference 'parentNode' of selectionList with id '"+this.id+"'");
- }
-}
-
-//test if parent group exists or create a new group at the end of the file
-selectionList.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g") {
- this.parentGroup = this.parentNode;
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if Windows group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- this.parentGroup = document.getElementById(this.parentNode);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-selectionList.prototype.handleEvent = function(evt) {
- var el = evt.currentTarget;
- var callerId = el.getAttributeNS(null,"id");
- var myRegExp = new RegExp(this.id);
- if (evt.type == "click") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselPulldown|\bselRect/)) {
- if (this.listOpen == false) {
- if (this.putOnTopOfParent) {
- //put list on top of the parent group (bottom in the DOM tree)
- this.parentGroup.parentNode.appendChild(this.parentGroup);
- }
- this.unfoldList();
- this.listOpen = true;
- }
- else {
- this.foldList();
- this.listOpen = false;
- evt.stopPropagation();
- }
- }
- if (callerId.match(/\bselHighlightSelection_/)) {
- this.selectAndClose(evt);
- evt.stopPropagation();
- }
- }
- else {
- //case that the event comes from the documentRoot element
- //but not from the selectionList itself
- if (!myRegExp.test(evt.target.getAttributeNS(null,"id"))) {
- this.foldList();
- this.listOpen = false;
- }
- }
- }
- if (evt.type == "mouseover") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselHighlightSelection_/)) {
- for (var attrib in this.highlightStyles) {
- el.setAttributeNS(null,attrib,this.highlightStyles[attrib]);
- }
- }
- }
- }
- if (evt.type == "mouseout") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselHighlightSelection_/) ){
- el.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- }
- if (callerId.match(/\bselScrollbarRect_/)) {
- this.scrollBarMove(evt);
- }
- }
- }
- if (evt.type == "mousedown") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselScrollUpperRect_|\bselScrollLowerRect/)) {
- this.scrollDir = "down";
- this.scrollActive = true;
- if (callerId.match(/UpperRect/)) {
- this.scrollDir = "up";
- }
- this.scroll(this.scrollDir,1,true); //1 is one element to scroll, true says that we should move scrollbar
- this.timer.setTimeout("scrollPerButton",400)
- }
- if (callerId.match(/\bselScrollbarRect_/)) {
- //add events to document.documentElement
- document.documentElement.addEventListener("mousemove",this,false);
- document.documentElement.addEventListener("mouseup",this,false);
- this.scrollBarMove(evt);
- }
- }
- }
- if (evt.type == "mouseup") {
- if (myRegExp.test(callerId)) {
- if (callerId.match(/\bselScrollUpperRect_|\bselScrollLowerRect/)) {
- this.scrollActive = false;
- }
- }
- if (el.nodeName == "svg" || el.nodeName == "svg:svg") {
- document.documentElement.removeEventListener("mousemove",this,false);
- document.documentElement.removeEventListener("mouseup",this,false);
- this.scrollBarMove(evt);
- }
- }
- if (evt.type == "mousemove") {
- if (el.nodeName == "svg" || el.nodeName == "svg:svg") {
- this.scrollBarMove(evt);
- }
- } //add keypress event
- if (evt.type == "keypress") {
- if (evt.charCode) {
- var character = String.fromCharCode(evt.charCode).toLowerCase();
- }
- else {
- //case opera and others
- var character = String.fromCharCode(evt.keyCode).toLowerCase();
- if (evt.keyCode == 0 || evt.keyCode == 16 || evt.keyCode == 17 || evt.keyCode == 18) {
- //shift key
- character = "";
- }
- }
-
- this.pressedKeys += character;
-
- if (character.length > 0) {
- if (this.keyTimer) {
- this.timer.clearTimeout(this.keyTimer);
- }
- this.keyTimer = this.timer.setTimeout("resetPressedKeys",1000);
- this.scrollToKey();
- }
- }
-}
-
-selectionList.prototype.resetPressedKeys = function() {
- this.keyTimer = undefined;
- this.pressedKeys = "";
-}
-
-//this function is called when selectionList is unfolded
-selectionList.prototype.unfoldList = function() {
- //create temporary group to hold temp geometry
- if (!this.dynamicTextGroup) {
- this.dynamicTextGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.insertBefore(this.dynamicTextGroup,this.rectAboveBox);
- }
- var nrSelectionsOrig = this.elementsArray.length;
- if (this.heightNrElements < nrSelectionsOrig) {
- nrSelections = this.heightNrElements;
- }
- else {
- nrSelections = nrSelectionsOrig;
- }
- var selectionHeight = this.cellHeight * nrSelections;
- //build textElements from array
- //hold currentSelection Index to unroll list at new offset
- if ((nrSelectionsOrig - this.activeSelection) >= nrSelections) {
- this.curLowerIndex = this.activeSelection;
- }
- else {
- this.curLowerIndex = nrSelectionsOrig - nrSelections;
- }
- //following is a temporary YOffset that serves to distinquish between selectionLists that open above or below
- var YOffset = this.yOffset + this.cellHeight;
- if (this.openAbove) {
- YOffset = this.yOffset - this.heightNrElements * this.cellHeight;
- }
- //adopt background rectangle
- this.rectBelowBox.setAttributeNS(null,"height",selectionHeight);
- this.rectBelowBox.setAttributeNS(null,"display","inherit");
- this.rectBelowBox.setAttributeNS(null,"y",YOffset);
- this.rectAboveBox.setAttributeNS(null,"height",selectionHeight);
- this.rectAboveBox.setAttributeNS(null,"display","inherit");
- this.rectAboveBox.setAttributeNS(null,"y",YOffset);
-
- for (var i=0;i<nrSelections;i++) {
- //add rectangles to capture events
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",YOffset + this.cellHeight * i);
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- node.setAttributeNS(null,"id","selHighlightSelection_" + this.id + "_" + (i + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseout", this, false);
- node.addEventListener("click", this, false);
- node.addEventListener("keypress", this, false);
- this.dynamicTextGroup.appendChild(node);
- //add text-elements
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",YOffset + this.textPaddingVertical + this.cellHeight * i);
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + i]);
- node.appendChild(selectionText);
- this.dynamicTextGroup.appendChild(node);
- }
-
- //create Scrollbar
- if (this.heightNrElements < nrSelectionsOrig) {
- //calculate scrollstep
- this.scrollerHeight = (this.heightNrElements / nrSelectionsOrig) * (selectionHeight - 2 * this.cellHeight);
- if (this.scrollerHeight < this.scrollerMinHeight) {
- this.scrollerHeight = this.scrollerMinHeight;
- }
- this.scrollStep = (selectionHeight - 2 * this.cellHeight - this.scrollerHeight) / (nrSelectionsOrig - this.heightNrElements);
- //scrollbar
- this.scrollBar = document.createElementNS(svgNS,"rect");
- this.scrollBar.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- this.scrollBar.setAttributeNS(null,"y",YOffset + this.cellHeight);
- this.scrollBar.setAttributeNS(null,"width",this.cellHeight);
- this.scrollBar.setAttributeNS(null,"height",selectionHeight - this.cellHeight * 2);
- for (var attrib in this.scrollbarStyles) {
- this.scrollBar.setAttributeNS(null,attrib,this.scrollbarStyles[attrib]);
- }
- this.scrollBar.setAttributeNS(null,"id","selScrollbarRect_"+this.id);
- this.scrollBar.addEventListener("mousedown", this, false);
- //node.addEventListener("mouseup", this, false);
- //node.addEventListener("mousemove", this, false);
- //node.addEventListener("mouseout", this, false);
- this.dynamicTextGroup.appendChild(this.scrollBar);
- //upper rectangle
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- node.setAttributeNS(null,"y",YOffset);
- node.setAttributeNS(null,"width",this.cellHeight);
- node.setAttributeNS(null,"height",this.cellHeight);
- for (var attrib in this.smallrectStyles) {
- node.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- node.setAttributeNS(null,"id","selScrollUpperRect_"+this.id);
- node.addEventListener("mousedown", this, false);
- node.addEventListener("mouseup", this, false);
- this.dynamicTextGroup.appendChild(node);
- //upper triangle
- var node = document.createElementNS(svgNS,"path");
- var myPath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(YOffset + 3 * this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(YOffset + 3 * this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(YOffset + this.triangleFourth)+" Z";
- node.setAttributeNS(null,"d",myPath);
- for (var attrib in this.triangleStyles) {
- node.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- node.setAttributeNS(null,"pointer-events","none");
- this.dynamicTextGroup.appendChild(node);
- //lower rectangle
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- node.setAttributeNS(null,"y",YOffset - this.cellHeight + selectionHeight);
- node.setAttributeNS(null,"width",this.cellHeight);
- node.setAttributeNS(null,"height",this.cellHeight);
- for (var attrib in this.smallrectStyles) {
- node.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- node.setAttributeNS(null,"id","selScrollLowerRect_" + this.id);
- node.addEventListener("mousedown", this, false);
- node.addEventListener("mouseup", this, false);
- this.dynamicTextGroup.appendChild(node);
- //lower triangle
- var node = document.createElementNS(svgNS,"path");
- var myPath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(YOffset - this.cellHeight + selectionHeight + this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(YOffset - this.cellHeight + selectionHeight + this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(YOffset - this.cellHeight + selectionHeight + 3 * this.triangleFourth)+" Z";
- node.setAttributeNS(null,"d",myPath);
- for (var attrib in this.triangleStyles) {
- node.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- node.setAttributeNS(null,"pointer-events","none");
- this.dynamicTextGroup.appendChild(node);
- //scrollerRect
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- node.setAttributeNS(null,"y",YOffset + this.cellHeight + this.scrollStep * this.curLowerIndex);
- node.setAttributeNS(null,"width",this.cellHeight);
- node.setAttributeNS(null,"height",this.scrollerHeight);
- for (var attrib in this.smallrectStyles) {
- node.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- node.setAttributeNS(null,"pointer-events","none");
- node.setAttributeNS(null,"id","selScroller_"+this.id);
- this.dynamicTextGroup.appendChild(node);
- }
- //add event handler to root element to close selectionList if one clicks outside
- document.documentElement.addEventListener("click",this,false);
- document.documentElement.addEventListener("keypress",this,false);
-}
-
-//this function folds/hides the selectionList again
-selectionList.prototype.foldList = function() {
- this.parentGroup.removeChild(this.dynamicTextGroup);
- this.dynamicTextGroup = null;
- this.rectBelowBox.setAttributeNS(null,"display","none");
- this.rectAboveBox.setAttributeNS(null,"display","none");
- document.documentElement.removeEventListener("click",this,false);
- document.documentElement.removeEventListener("keypress",this,false);
- this.scrollBar = undefined;
-}
-
-selectionList.prototype.selectAndClose = function(evt) {
- var mySelEl = evt.target;
- var result = mySelEl.getAttributeNS(null,"id").split("_");
- this.activeSelection = parseInt(result[2]);
- this.curLowerIndex = this.activeSelection;
- this.foldList();
- this.listOpen = false;
- this.selectedText.firstChild.nodeValue = this.elementsArray[this.activeSelection];
- this.timer.setTimeout("fireFunction",this.timerMs);
-}
-
-selectionList.prototype.fireFunction = function() {
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,this.activeSelection,this.elementsArray[this.activeSelection]);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.getSelectionListVal(this.id,this.activeSelection,this.elementsArray[this.activeSelection]);
- }
- //suggestion by Bruce Rindahl
- //allows to initialize a selectionlist without a specific callback function on changing the selectionlist entry
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-selectionList.prototype.scrollPerButton = function() {
- if (this.scrollActive == true) {
- this.scroll(this.scrollDir,1,true); //1 is one element to scroll, true says that we should move scrollbar
- this.timer.setTimeout("scrollPerButton",100)
- }
-}
-
-selectionList.prototype.scroll = function(scrollDir,scrollNr,scrollBool) {
- var nrSelections = this.elementsArray.length;
- var scroller = document.getElementById("selScroller_"+this.id);
- //following is a temporary YOffset that serves to distinquish between selectionLists that open above or below
- var YOffset = this.yOffset + this.cellHeight;
- if (this.openAbove) {
- YOffset = this.yOffset - this.heightNrElements * this.cellHeight;
- }
- if (scrollNr < this.heightNrElements) {
- if ((this.curLowerIndex > 0) && (scrollDir == "up")) {
- if (scrollNr > this.curLowerIndex) {
- scrollNr = this.curLowerIndex;
- }
- //decrement current index
- this.curLowerIndex = this.curLowerIndex - scrollNr;
- //move scroller
- if (scrollBool == true) {
- scroller.setAttributeNS(null,"y",parseFloat(scroller.getAttributeNS(null,"y"))+ this.scrollStep * -1);
- }
- //add upper rect elements
- for (var i=0;i<scrollNr;i++) {
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",YOffset + this.cellHeight * i);
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- node.setAttributeNS(null,"id","selHighlightSelection_" + this.id + "_" + (i + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseout", this, false);
- node.addEventListener("click", this, false);
- node.addEventListener("keypress", this, false);
- this.dynamicTextGroup.appendChild(node);
- //add text-nodes
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",YOffset + this.textPaddingVertical + this.cellHeight * i);
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + i]);
- node.appendChild(selectionText);
- this.dynamicTextGroup.appendChild(node);
- }
- //move middle elements
- for (var j=i;j<this.heightNrElements;j++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) + (this.cellHeight * scrollNr));
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) + (this.cellHeight * scrollNr));
- }
- //remove lower elements
- for (var k=j;k<(j+scrollNr);k++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (k + this.curLowerIndex));
- this.dynamicTextGroup.removeChild(node);
- var node = document.getElementById("selHighlightSelection_" + this.id +"_" + (k + this.curLowerIndex));
- this.dynamicTextGroup.removeChild(node);
- }
- }
- else if ((this.curLowerIndex < nrSelections - this.heightNrElements) && (scrollDir == "down")) {
- //move Scroller
- if (scrollBool == true) {
- scroller.setAttributeNS(null,"y",parseFloat(scroller.getAttributeNS(null,"y")) + this.scrollStep);
- }
- //remove most upper element
- for (var i=0;i<scrollNr;i++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (this.curLowerIndex + i));
- this.dynamicTextGroup.removeChild(node);
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + (this.curLowerIndex + i));
- this.dynamicTextGroup.removeChild(node);
- }
- //move middle elements
- for (var j=i;j<this.heightNrElements;j++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) - (this.cellHeight * scrollNr));
- var node = document.getElementById("selHighlightSelection_" + this.id + "_" + (j + this.curLowerIndex));
- node.setAttributeNS(null,"y",parseFloat(node.getAttributeNS(null,"y")) - (this.cellHeight * scrollNr));
- }
- //add most lower element
- for (var k=j;k<(j+scrollNr);k++) {
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",YOffset + this.cellHeight * (k - scrollNr));
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- node.setAttribute("id","selHighlightSelection_" + this.id + "_" + (k + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseout", this, false);
- node.addEventListener("click", this, false);
- node.addEventListener("keypress", this, false);
- this.dynamicTextGroup.appendChild(node);
- //add text-nodes
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (k + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",YOffset + this.textPaddingVertical + this.cellHeight * (k - scrollNr));
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + k]);
- node.appendChild(selectionText);
- this.dynamicTextGroup.appendChild(node);
- }
- //increment current index
- this.curLowerIndex = this.curLowerIndex + scrollNr;
- }
- }
- else {
- //remove lower elements
- for (var i=0;i<this.heightNrElements;i++) {
- var node = document.getElementById("selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- this.dynamicTextGroup.removeChild(node);
- var node = document.getElementById("selHighlightSelection_" + this.id +"_" + (i + this.curLowerIndex));
- this.dynamicTextGroup.removeChild(node);
- }
- if (scrollDir == "down") {
- this.curLowerIndex = this.curLowerIndex + scrollNr;
- }
- else {
- this.curLowerIndex = this.curLowerIndex - scrollNr;
- }
- for (var i=0;i<this.heightNrElements;i++) {
- var node = document.createElementNS(svgNS,"rect");
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding / 2);
- node.setAttributeNS(null,"y",YOffset + this.cellHeight * i);
- node.setAttributeNS(null,"width",this.width - this.cellHeight - this.textPadding);
- node.setAttributeNS(null,"height",this.cellHeight);
- node.setAttributeNS(null,"fill",this.boxStyles["fill"]);
- node.setAttributeNS(null,"id","selHighlightSelection_" + this.id + "_" + (i + this.curLowerIndex));
- //add event-handler
- node.addEventListener("mouseover", this, false);
- node.addEventListener("mouseout", this, false);
- node.addEventListener("click", this, false);
- node.addEventListener("keypress", this, false);
- this.dynamicTextGroup.appendChild(node);
- //add text-nodes
- var node = document.createElementNS(svgNS,"text");
- node.setAttributeNS(null,"id","selTexts_" + this.id + "_" + (i + this.curLowerIndex));
- node.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- node.setAttributeNS(null,"y",YOffset + this.textPaddingVertical + this.cellHeight * i);
- node.setAttributeNS(null,"pointer-events","none");
- var value = "";
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- node.setAttributeNS(null,attrib,value);
- }
- var selectionText = document.createTextNode(this.elementsArray[this.curLowerIndex + i]);
- node.appendChild(selectionText);
- this.dynamicTextGroup.appendChild(node);
- }
- }
-}
-
-//event listener for Scrollbar element
-selectionList.prototype.scrollBarMove = function(evt) {
- var scroller = document.getElementById("selScroller_" + this.id);
- var scrollerHeight = parseFloat(scroller.getAttributeNS(null,"height"));
- var scrollerMinY = parseFloat(this.scrollBar.getAttributeNS(null,"y"));
- var scrollerMaxY = parseFloat(this.scrollBar.getAttributeNS(null,"y")) + parseFloat(this.scrollBar.getAttributeNS(null,"height")) - scrollerHeight;
- //following is a temporary YOffset that serves to distinquish between selectionLists that open above or below
- var YOffset = this.yOffset + this.cellHeight;
- if (this.openAbove) {
- YOffset = this.yOffset - this.heightNrElements * this.cellHeight;
- }
- if (evt.type == "mousedown") {
- this.panStatus = true;
- for (var attrib in this.triangleStyles) {
- scroller.setAttributeNS(null,attrib,this.triangleStyles[attrib]);
- }
- var coordPoint = myMapApp.calcCoord(evt,this.scrollBar);
- this.panY = coordPoint.y;
- var oldY = parseFloat(scroller.getAttributeNS(null,"y"));
- var newY = this.panY - parseFloat(scroller.getAttributeNS(null,"height")) / 2;
- if (newY < scrollerMinY) {
- newY = scrollerMinY;
- //maybe recalculate this.panY ??
- }
- if (newY > scrollerMaxY) {
- newY = scrollerMaxY;
- }
- var panDiffY = newY - oldY;
- var scrollDir = "down";
- this.scrollCumulus = 0;
- if(Math.abs(panDiffY) > this.scrollStep) {
- var scrollNr = Math.abs(Math.round(panDiffY / this.scrollStep));
- if (panDiffY > 0) {
- this.scrollCumulus = panDiffY - this.scrollStep * scrollNr;
- }
- else {
- this.scrollCumulus = panDiffY + this.scrollStep * scrollNr;
- scrollDir = "up";
- }
- newY = oldY + panDiffY;
- scroller.setAttributeNS(null,"y",newY);
- this.scroll(scrollDir,scrollNr,false);
- }
- }
- if (evt.type == "mouseup" || evt.type == "mouseout") {
- if (this.panStatus == true) {
- var newY = parseFloat(scroller.getAttributeNS(null,"y"));
- for (var attrib in this.smallrectStyles) {
- scroller.setAttributeNS(null,attrib,this.smallrectStyles[attrib]);
- }
- scroller.setAttributeNS(null,"y",YOffset + this.cellHeight + this.scrollStep * this.curLowerIndex);
- }
- this.panStatus = false;
- }
- if (evt.type == "mousemove") {
- if (this.panStatus == true) {
- var coordPoint = myMapApp.calcCoord(evt,this.scrollBar);
- var panNewEvtY = coordPoint.y;
- var panDiffY = panNewEvtY - this.panY;
- var oldY = parseFloat(scroller.getAttributeNS(null,"y"));
- var newY = oldY + panDiffY;
- if (newY < scrollerMinY) {
- newY = scrollerMinY;
- }
- if (newY > scrollerMaxY) {
- newY = scrollerMaxY;
- }
- var panDiffY = newY - oldY;
- if ((panDiffY < 0 && panNewEvtY <= (scrollerMaxY+scrollerHeight)) || (panDiffY > 0 && panNewEvtY >= scrollerMinY)) {
- this.scrollCumulus += panDiffY;
- var scrollDir = "down";
- var scrollNr = 0;
- if(Math.abs(this.scrollCumulus) >= this.scrollStep) {
- scrollNr = Math.abs(Math.round(this.scrollCumulus / this.scrollStep));
- if (this.scrollCumulus > 0) {
- this.scrollCumulus = this.scrollCumulus - this.scrollStep * scrollNr;
- }
- else {
- this.scrollCumulus = this.scrollCumulus + this.scrollStep * scrollNr;
- scrollDir = "up";
- }
- this.scroll(scrollDir,scrollNr,false);
- }
- else {
- if (Math.abs(this.scrollCumulus) > this.scrollStep) {
- scrollNr = 1;
- if (panDiffY < 0) {
- scrollDir = "up";
- this.scrollCumulus = this.scrollCumulus + this.scrollStep;
- }
- else {
- this.scrollCumulus = this.scrollCumulus - this.scrollStep;
- }
- panDiffY = this.scrollCumulus;
- this.scroll(scrollDir,scrollNr,false);
- }
- else {
- if (newY == scrollerMinY && this.curLowerIndex != 0) {
- this.scroll("up",1,false);
- }
- else if (newY == scrollerMaxY && this.curLowerIndex != (this.elementsArray.length - this.heightNrElements)) {
- this.scroll("down",1,false);
- }
- }
- }
- newY = oldY + panDiffY;
- scroller.setAttributeNS(null,"y",newY);
- this.panY = panNewEvtY;
- }
- }
- }
-}
-
-selectionList.prototype.scrollToKey = function(pressedKey) {
- var oldActiveSelection = this.activeSelection;
- for (var i=0;i<this.elementsArray.length;i++) {
- if (this.elementsArray[i].toLowerCase().substr(0,this.pressedKeys.length) == this.pressedKeys) {
- if (this.listOpen == true) {
- this.foldList();
- }
- this.activeSelection = i;
- this.unfoldList();
- this.listOpen = true;
- this.activeSelection = oldActiveSelection;
- break;
- }
- }
-}
-
-selectionList.prototype.elementExists = function(elementName) {
- var result = -1;
- for (i=0;i<this.elementsArray.length;i++) {
- if (this.elementsArray[i] == elementName) {
- result = i;
- }
- }
- return result;
-}
-
-selectionList.prototype.selectElementByName = function(elementName,fireFunction) {
- //fireFunction: (true|false); determines whether to execute selectFunction or not
- existsPosition = this.elementExists(elementName);
- if (existsPosition != -1) {
- if (this.listOpen == true) {
- this.foldList();
- }
- this.activeSelection = existsPosition;
- this.selectedText.firstChild.nodeValue = this.elementsArray[this.activeSelection];
- if (this.listOpen == true) {
- this.unfoldList();
- }
- if (fireFunction == true) {
- this.fireFunction();
- }
- }
- return existsPosition;
-}
-
-selectionList.prototype.selectElementByPosition = function(position,fireFunction) {
- //fireFunction: (true|false); determines whether to execute selectFunction or not
- if (position < this.elementsArray.length) {
- if (this.listOpen == true) {
- this.foldList();
- }
- this.activeSelection = position;
- this.selectedText.firstChild.nodeValue = this.elementsArray[this.activeSelection];
- if (this.listOpen == true) {
- this.unfoldList();
- }
- if (fireFunction == true) {
- this.fireFunction();
- }
- }
- else {
- position = -1;
- }
- return position;
-}
-
-selectionList.prototype.sortList = function(direction) {
- //direction: asc|desc, for ascending or descending
- var mySelElementString = this.elementsArray[this.activeSelection];
- if (this.listOpen == true) {
- this.foldList();
- }
- this.elementsArray.sort();
- if (direction == "desc") {
- this.elementsArray.reverse();
- }
- this.activeSelection = this.elementExists(mySelElementString);
- if (this.listOpen == true) {
- this.unfoldList();
- }
-
- return direction;
-}
-
-selectionList.prototype.deleteElement = function(elementName) {
- existsPosition = this.elementExists(elementName);
- if (existsPosition != -1) {
- if (this.listOpen == true) {
- this.foldList();
- }
- var tempArray = new Array;
- tempArray = tempArray.concat(this.elementsArray.slice(0,existsPosition),this.elementsArray.slice(existsPosition + 1,this.elementsArray.length));
- this.elementsArray = tempArray;
- if (this.activeSelection == existsPosition) {
- this.selectedText.firstChild.nodeValue = this.elementsArray[this.activeSelection];
- }
- if (this.activeSelection > existsPosition) {
- this.activeSelection -= 1;
- }
- if (this.listOpen == true) {
- this.unfoldList();
- }
- }
- return existsPosition;
-}
-
-selectionList.prototype.addElementAtPosition = function(elementName,position) {
- if (position > this.elementsArray.length) {
- this.elementsArray.push(elementName);
- position = this.elementsArray.length - 1;
- }
- else {
- var tempArray = new Array;
- tempArray = tempArray.concat(this.elementsArray.slice(0,position),elementName,this.elementsArray.slice(position,this.elementsArray.length));
- this.elementsArray = tempArray;
- }
- if (this.listOpen == true) {
- this.foldList();
- }
- if (position <= this.activeSelection) {
- this.activeSelection += 1;
- }
- if (this.listOpen == true) {
- this.unfoldList();
- }
- return position;
-}
-
-selectionList.prototype.getCurrentSelectionElement = function() {
- return this.elementsArray[this.activeSelection];
-}
-
-selectionList.prototype.getCurrentSelectionIndex = function() {
- return this.activeSelection;
-}
-
-selectionList.prototype.removeSelectionList = function() {
- //remove all Elements of selectionList
- this.exists = false;
- while (this.parentGroup.hasChildNodes()) {
- this.parentGroup.removeChild(this.parentGroup.firstChild);
- }
-}
-
-selectionList.prototype.moveTo = function(moveX,moveY) {
- this.xOffset = moveX;
- this.yOffset = moveY;
- //reposition initial rectangle
- var initRect = document.getElementById("selRect_"+this.id);
- initRect.setAttributeNS(null,"x",this.xOffset);
- initRect.setAttributeNS(null,"y",this.yOffset);
- //reposition initial text
- this.selectedText.setAttributeNS(null,"x",this.xOffset + this.textPadding);
- this.selectedText.setAttributeNS(null,"y",this.yOffset + this.textPaddingVertical);
- //reposition small rectangle to the right
- var smallRectRight = document.getElementById("selPulldown_"+this.id);
- smallRectRight.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- smallRectRight.setAttributeNS(null,"y",this.yOffset);
- //reposition triangle
- var triangle = document.getElementById("selTriangle_"+this.id);
- var myTrianglePath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFourth)+" Z";
- triangle.setAttributeNS(null,"d",myTrianglePath);
- //change positions of rectbox below and above
- this.rectBelowBox.setAttributeNS(null,"x",this.xOffset);
- this.rectBelowBox.setAttributeNS(null,"y",this.yOffset + this.cellHeight);
- this.rectAboveBox.setAttributeNS(null,"x",this.xOffset);
- this.rectAboveBox.setAttributeNS(null,"y",this.yOffset + this.cellHeight);
-}
-
-selectionList.prototype.resize = function(newWidth) {
- this.width = newWidth;
- //reposition initial rectangle
- var initRect = document.getElementById("selRect_"+this.id);
- initRect.setAttributeNS(null,"width",this.width);
- //reposition small rectangle to the right
- var smallRectRight = document.getElementById("selPulldown_"+this.id);
- smallRectRight.setAttributeNS(null,"x",this.xOffset + this.width - this.cellHeight);
- //reposition triangle
- var triangle = document.getElementById("selTriangle_"+this.id);
- var myTrianglePath = "M"+(this.xOffset + this.width - 3 * this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - this.triangleFourth)+" "+(this.yOffset + this.triangleFourth)+" L"+(this.xOffset + this.width - 2 * this.triangleFourth)+" "+(this.yOffset + 3 * this.triangleFourth)+" Z";
- triangle.setAttributeNS(null,"d",myTrianglePath);
- //change sizes of rectbox below and above
- this.rectBelowBox.setAttributeNS(null,"width",this.width - this.cellHeight);
- this.rectAboveBox.setAttributeNS(null,"width",this.width - this.cellHeight);
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/slider.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/slider.js
deleted file mode 100644
index ce3d83f..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/slider.js
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
-Scripts to create interactive sliders in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.0, 2006-08-04
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* Kevin Lindsey for ideas how to implement such a slider
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/slider/
-
-----
-
-current version: 1.0.
-
-version history:
-0.99 (not documented, somewhere around 2001)
-
-1.0 (2006-08-04)
-changed constructor parameters (added id, parentNode), removed parameter sliderGroupId, added documentation, added method .moveTo()
-
--------
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/slider/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/slider/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-//slider properties
-function slider(id,parentNode,x1,y1,value1,x2,y2,value2,startVal,sliderStyles,invisSliderWidth,sliderSymb,functionToCall,mouseMoveBool) {
- var nrArguments = 14;
- var createSlider= true;
- if (arguments.length == nrArguments) {
- this.id = id; //an internal id, this id is not used in the SVG Dom tree
- this.parentNode = parentNode; //the parentNode, string or nodeReference
- this.x1 = x1; //the start point x of the slider
- this.y1 = y1; //the start point y of the slider
- this.value1 = value1; //the value at the start point, min slider value
- this.x2 = x2; //the end point x of the slider
- this.y2 = y2; //the end point y of the slider
- this.value2 = value2; //the value at the end point, max slider value
- this.startVal = startVal; //the initial value of the slider
- this.value = startVal; //the current value of the slider
- this.sliderStyles = sliderStyles; //the color of the slider line
- this.invisSliderWidth = invisSliderWidth; //the width of invisible part of the slider
- this.sliderSymb = sliderSymb; //the id for the movable symbol to be placed on the slider line
- this.functionToCall = functionToCall; //the callback function
- this.mouseMoveBool = mouseMoveBool; //boolean value to indicate if the slider gives immediate feedback or not
- this.length = toPolarDist((this.x2 - this.x1),(this.y2 - this.y1));
- this.direction = toPolarDir((this.x2 - this.x1),(this.y2 - this.y1));
- this.invisSliderLine = null;
- this.slideStatus = 0;
- }
- else {
- createSlider = false;
- alert("Error in slider ("+id+") constructor: wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createSlider) {
- this.createSlider();
- }
- else {
- alert("Could not create slider with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-//create slider
-slider.prototype.createSlider = function() {
- var result = this.testParent();
- if (result) {
- this.invisSliderLine = document.createElementNS(svgNS,"line");
- this.invisSliderLine.setAttributeNS(null,"x1",this.x1);
- this.invisSliderLine.setAttributeNS(null,"y1",this.y1);
- this.invisSliderLine.setAttributeNS(null,"x2",this.x2);
- this.invisSliderLine.setAttributeNS(null,"y2",this.y2);
- this.invisSliderLine.setAttributeNS(null,"stroke","black");
- this.invisSliderLine.setAttributeNS(null,"stroke-width",this.invisSliderWidth);
- //note that due to bugs in Opera9 and Firefox I can't use pointer-events here
- this.invisSliderLine.setAttributeNS(null,"stroke-opacity","0");
- this.invisSliderLine.setAttributeNS(null,"fill-opacity","0");
- this.invisSliderLine.setAttributeNS(null,"stroke-linecap","square");
- this.invisSliderLine.addEventListener("mousedown",this,false);
- this.parentGroup.appendChild(this.invisSliderLine);
- this.visSliderLine = document.createElementNS(svgNS,"line");
- this.visSliderLine.setAttributeNS(null,"x1",this.x1);
- this.visSliderLine.setAttributeNS(null,"y1",this.y1);
- this.visSliderLine.setAttributeNS(null,"x2",this.x2);
- this.visSliderLine.setAttributeNS(null,"y2",this.y2);
- for (var attrib in this.sliderStyles) {
- this.visSliderLine.setAttributeNS(null,attrib,this.sliderStyles[attrib]);
- }
- this.visSliderLine.setAttributeNS(null,"pointer-events","none");
- this.parentGroup.appendChild(this.visSliderLine);
- this.sliderSymbol = document.createElementNS(svgNS,"use");
- this.sliderSymbol.setAttributeNS(xlinkNS,"xlink:href","#"+this.sliderSymb);
- var myStartDistance = this.length - ((this.value2 - this.startVal) / (this.value2 - this.value1)) * this.length;
- var myPosX = this.x1 + toRectX(this.direction,myStartDistance);
- var myPosY = this.y1 + toRectY(this.direction,myStartDistance);
- var myTransformString = "translate("+myPosX+","+myPosY+") rotate(" + Math.round(this.direction / Math.PI * 180) + ")";
- this.sliderSymbol.setAttributeNS(null,"transform",myTransformString);
- this.sliderSymbol.setAttributeNS(null,"pointer-events","none");
- this.parentGroup.appendChild(this.sliderSymbol);
- }
- else {
- alert("could not create or reference 'parentNode' of slider with id '"+this.id+"'");
- }
-}
-
-//test if parent group exists
-slider.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g" || this.parentNode.nodeName == "svg:svg" || this.parentNode.nodeName == "svg:g") {
- this.parentGroup = this.parentNode;
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if button group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- this.parentGroup = document.getElementById(this.parentNode);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-//remove all slider elements
-slider.prototype.removeSlider = function() {
- this.parentGroup.removeChild(this.sliderSymbol);
- this.parentGroup.removeChild(this.visSliderLine);
- this.parentGroup.removeChild(this.invisSliderLine);
-}
-
-//handle events
-slider.prototype.handleEvent = function(evt) {
- this.drag(evt);
-}
-
-//drag slider
-slider.prototype.drag = function(evt) {
- if (evt.type == "mousedown" || (evt.type == "mousemove" && this.slideStatus == 1)) {
- //get coordinate in slider coordinate system
- var coordPoint = myMapApp.calcCoord(evt,this.invisSliderLine);
- //draw normal line for first vertex
- var ax = this.x2 - this.x1;
- var ay = this.y2 - this.y1;
- //normal vector 1
- var px1 = parseFloat(this.x1) + ay * -1;
- var py1 = parseFloat(this.y1) + ax;
- //normal vector 2
- var px2 = parseFloat(this.x2) + ay * -1;
- var py2 = parseFloat(this.y2) + ax;
-
- if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 0 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 1) {
- if (evt.type == "mousedown" && (evt.detail == 1 || evt.detail == 0)) {
- this.slideStatus = 1;
- document.documentElement.addEventListener("mousemove",this,false);
- document.documentElement.addEventListener("mouseup",this,false);
- }
- myNewPos = intersect2lines(this.x1,this.y1,this.x2,this.y2,coordPoint.x,coordPoint.y,coordPoint.x + ay * -1,coordPoint.y + ax);
- var myPercentage = toPolarDist(myNewPos['x'] - this.x1,myNewPos['y'] - this.y1) / this.length;
- this.value = this.value1 + myPercentage * (this.value2 - this.value1);
- }
- else {
- var myNewPos = new Array();
- if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 0 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 0) {
- //more than max
- this.value = this.value2;
- myNewPos['x'] = this.x2;
- myNewPos['y'] = this.y2;
- }
- if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 1 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 1) {
- //less than min
- this.value = this.value1;
- myNewPos['x'] = this.x1;
- myNewPos['y'] = this.y1;
- }
- }
- var myTransformString = "translate("+myNewPos['x']+","+myNewPos['y']+") rotate(" + Math.round(this.direction / Math.PI * 180) + ")";
- this.sliderSymbol.setAttributeNS(null,"transform",myTransformString);
- this.fireFunction();
- }
- if (evt.type == "mouseup" && (evt.detail == 1 || evt.detail == 0)) {
- if (this.slideStatus == 1) {
- this.slideStatus = 2;
- document.documentElement.removeEventListener("mousemove",this,false);
- document.documentElement.removeEventListener("mouseup",this,false);
- this.fireFunction();
- }
- this.slideStatus = 0;
- }
-}
-
-//this code is executed, after the slider is released
-//you can use switch/if to detect which slider was used (use this.id) for that
-slider.prototype.fireFunction = function() {
- if (this.slideStatus == 1 && this.mouseMoveBool == true) {
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall("change",this.id,this.value);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.getSliderVal("change",this.id,this.value);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
- }
- if (this.slideStatus == 2) {
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall("release",this.id,this.value);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.getSliderVal("release",this.id,this.value);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
- }
-}
-
-slider.prototype.getValue = function() {
- return this.value;
-}
-
-//this is to set the value from other scripts
-slider.prototype.setValue = function(value,fireFunction) {
- this.value = value;
- var myPercAlLine = (this.value - this.value1) / (this.value2 - this.value1);
- var myPosX = this.x1 + toRectX(this.direction,this.length * myPercAlLine);
- var myPosY = this.y1 + toRectY(this.direction,this.length * myPercAlLine);
- var myTransformString = "translate("+myPosX+","+myPosY+") rotate(" + Math.round(this.direction / Math.PI * 180) + ")";
- this.sliderSymbol.setAttributeNS(null,"transform",myTransformString);
- if (fireFunction) {
- //temporary set slideStatus
- this.slideStatus = 2;
- this.fireFunction();
- this.slideStatus = 0;
- }
-}
-
-slider.prototype.moveTo = function(x1,y1,x2,y2) {
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- this.invisSliderLine.setAttributeNS(null,"x1",this.x1);
- this.invisSliderLine.setAttributeNS(null,"y1",this.y1);
- this.invisSliderLine.setAttributeNS(null,"x2",this.x2);
- this.invisSliderLine.setAttributeNS(null,"y2",this.y2);
- this.visSliderLine.setAttributeNS(null,"x1",this.x1);
- this.visSliderLine.setAttributeNS(null,"y1",this.y1);
- this.visSliderLine.setAttributeNS(null,"x2",this.x2);
- this.visSliderLine.setAttributeNS(null,"y2",this.y2);
- //reset direction and length of the slider
- this.length = toPolarDist((this.x2 - this.x1),(this.y2 - this.y1));
- this.direction = toPolarDir((this.x2 - this.x1),(this.y2 - this.y1));
- //reset the value to correctly reposition element
- this.setValue(this.getValue(),false);
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/tabgroup.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/tabgroup.js
deleted file mode 100644
index abf29bf8..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/tabgroup.js
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
-Scripts to create interactive tabs in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.2, 2006-04-03
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* none so far
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/tabgroup/
-
-----
-
-current version: 1.2.1
-
-version history:
-1.0 (2006-03-11)
-initial version
-
-1.1 (2006-04-03)
-added ".moveTo(x,y)" and ".resize(width,height)" methods, added an additional g-element to hold transform values
-
-1.2 (2006-06-19)
-this.parentNode can now also be of type node reference (g or svg element); fixed a small bug when "hideContent" was set to true; changed this.parentGroup and introduced this.tabGroup
-introduced id for group where content can be added, id name is: this.id+"__"+i+"_content"
-
-1.2.1 (2006-07-07)
-fixed a bug for multiline tabs (dy attribute of the tab texts). This bug was apparent when having more than two lines of text in the tabs
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/tabgroup/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/tabgroup/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function tabgroup(id,parentNode,transx,transy,width,height,tabheight,cornerLeft,cornerRight,tabmargins,spaceBetweenTabs,tabStyles,activetabBGColor,tabwindowStyles,tabtextStyles,tabTitles,activeTabindex,hideContent,functionToCall) {
- var nrArguments = 19;
- var createTabgroup = true;
- if (arguments.length == nrArguments) {
- this.id = id;
- this.parentNode = parentNode; //can be of type string (id) or node reference (svg or g node)
- this.transx = transx;
- this.transy = transy;
- this.x = 0;
- this.y = 0;
- this.width = width;
- this.height = height;
- this.tabheight = tabheight;
- this.cornerLeft = cornerLeft; //values are "rect","round","triangle"
- this.cornerRight = cornerRight; //values are "rect","round","triangle"
- this.tabmargins = tabmargins;
- this.spaceBetweenTabs = spaceBetweenTabs;
- this.tabStyles = tabStyles;
- if (!this.tabStyles["fill"]) {
- this.tabStyles["fill"] = "lightgray";
- }
- this.activetabBGColor = activetabBGColor;
- this.tabwindowStyles = tabwindowStyles;
- this.tabtextStyles = tabtextStyles;
- if (!this.tabtextStyles["font-size"]) {
- this.tabtextStyles["font-size"] = 15;
- }
- this.tabTitles = tabTitles;
- if (this.tabTitles instanceof Array) {
- if (this.tabTitles.length == 0) {
- createTabgroup = false;
- alert("Error ("+this.id+"): the array 'tabTitles' has no elements!");
- }
- }
- else {
- createTabgroup = false;
- alert("Error ("+this.id+"): the array 'tabTitles' is not of type array!");
- }
- this.activeTabindex = activeTabindex;
- if (this.activeTabindex >= this.tabTitles.length) {
- createTabgroup = false;
- this.outOfBoundMessage(this.activeTabindex);
- }
- this.hideContent = hideContent; //boolean, defines whether the display of a tab should be set to "none","inherit"
- this.functionToCall = functionToCall;
- if (!(typeof(this.functionToCall) == "function" || typeof(this.functionToCall) == "object" || typeof(this.functionToCall) == "undefined")) {
- createTabgroup = false;
- alert("Error ("+this.id+"): functionToCall is of type '"+typeof(this.functionToCall)+"' and not of type 'function', 'object' or 'undefined'");
- }
- }
- else {
- createTabgroup = false;
- alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createTabgroup) {
- this.parentGroup = null; //later a node reference to the parent group
- this.tabGroup = null; //later a reference to the group within the parentGroup
- this.tabwindows = new Array();
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
- this.createTabGroup();
- }
- else {
- alert("Could not create tabgroup with id '"+this.id+"' due to errors in the constructor parameters");
- }
-}
-
-tabgroup.prototype.createTabGroup = function() {
- var result = this.testParent();
- if (result) {
- this.tabGroup = document.createElementNS(svgNS,"g");
- this.tabGroup.setAttributeNS(null,"transform","translate("+this.transx+","+this.transy+")");
- this.parentGroup.appendChild(this.tabGroup);
- //loop to create all tabs
- var currentX = this.x;
- for (var i=0;i<this.tabTitles.length;i++) {
- currentLeft = currentX;
- this.tabwindows[i] = new Array();
- //create group
- this.tabwindows[i]["group"] = document.createElementNS(svgNS,"g");
- this.tabGroup.appendChild(this.tabwindows[i]["group"]);
- //create tabTitle
- var tabtitles = this.tabTitles[i].split("\n");
- this.tabwindows[i]["tabTitle"] = document.createElementNS(svgNS,"text");
- this.tabwindows[i]["tabTitle"].setAttributeNS(null,"y",this.y + this.tabtextStyles["font-size"]);
- var value="";
- for (var attrib in this.tabtextStyles) {
- value = this.tabtextStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- this.tabwindows[i]["tabTitle"].setAttributeNS(null,attrib,value);
- }
- this.tabwindows[i]["tabTitle"].setAttributeNS(null,"pointer-events","none");
- //create tspans and add text contents
- for (var j=0;j<tabtitles.length;j++) {
- var tspan = document.createElementNS(svgNS,"tspan");
- tspan.setAttributeNS(null,"x",currentX+this.tabmargins);
- var dy = this.tabtextStyles["font-size"]*1.1;
- if (j == 0) {
- dy = 0;
- }
- tspan.setAttributeNS(null,"dy",dy);
- var textNode = document.createTextNode(tabtitles[j]);
- tspan.appendChild(textNode);
- this.tabwindows[i]["tabTitle"].appendChild(tspan);
- }
- this.tabwindows[i]["group"].appendChild(this.tabwindows[i]["tabTitle"]);
- //get bbox
- var bbox = this.tabwindows[i]["tabTitle"].getBBox();
- currentX = Math.round(currentLeft + this.tabmargins * 2 + bbox.width);
- //check if text-anchor is middle and shift the x-values accordingly
- if (this.tabtextStyles["text-anchor"]) {
- if (this.tabtextStyles["text-anchor"] == "middle") {
- this.tabwindows[i]["tabTitle"].setAttributeNS(null,"transform","translate("+(bbox.width * 0.5)+" 0)");
- }
- }
- //now draw tabwindow background
- this.tabwindows[i]["tabbg"] = document.createElementNS(svgNS,"path");
- for (var attrib in this.tabwindowStyles) {
- this.tabwindows[i]["tabbg"].setAttributeNS(null,attrib,this.tabwindowStyles[attrib]);
- }
- //start the path for tab windows
- var d = "M";
- //left corner of tab
- if (this.cornerLeft == "rect") {
- d += currentLeft+" "+this.y;
- }
- if (this.cornerLeft == "triangle") {
- d += currentLeft+" "+(this.y+this.tabmargins)+"L"+(currentLeft+this.tabmargins)+" "+this.y;
- }
- if (this.cornerLeft == "round") {
- d += currentLeft+" "+(this.y+this.tabmargins)+"a"+this.tabmargins+" "+this.tabmargins+" 0 0 1 "+this.tabmargins+" -"+this.tabmargins;
- }
- //right corner of tab
- if (this.cornerRight == "rect") {
- d += "L"+currentX+" "+this.y;
- }
- if (this.cornerRight == "triangle") {
- d += "L"+(currentX-this.tabmargins)+" "+this.y+"L"+currentX+" "+(this.y+this.tabmargins);
- }
- if (this.cornerRight == "round") {
- d += "L"+(currentX-this.tabmargins)+" "+this.y+"a"+this.tabmargins+" "+this.tabmargins+" 0 0 1 "+this.tabmargins+" "+this.tabmargins;
- }
- d += "L"+currentX+" "+(this.y+this.tabheight);
- //complete the path for tab
- var dtab = d + "L"+currentLeft+" "+(this.y+this.tabheight)+"z";
- //complete the path for tab window
- d += "L"+(this.x+this.width)+" "+(this.y+this.tabheight)+"L"+(this.x+this.width)+" "+(this.y+this.height);
- d += "L"+this.x+" "+(this.y+this.height);
- if (currentLeft == this.x) {
- d += "z";
- }
- else {
- d += "L"+this.x+" "+(this.y+this.tabheight)+"L"+currentLeft+" "+(this.y+this.tabheight)+"z";
- }
- this.tabwindows[i]["tabbg"].setAttributeNS(null,"d",d);
- this.tabwindows[i]["group"].insertBefore(this.tabwindows[i]["tabbg"],this.tabwindows[i]["tabTitle"]);
- //create tab element
- this.tabwindows[i]["tab"] = document.createElementNS(svgNS,"path");
- for (var attrib in this.tabStyles) {
- this.tabwindows[i]["tab"].setAttributeNS(null,attrib,this.tabStyles[attrib]);
- }
- this.tabwindows[i]["tab"].setAttributeNS(null,"d",dtab);
- this.tabwindows[i]["tab"].setAttributeNS(null,"id",this.id+"__"+i);
- this.tabwindows[i]["tab"].addEventListener("click",this,false);
- this.tabwindows[i]["group"].insertBefore(this.tabwindows[i]["tab"],this.tabwindows[i]["tabTitle"]);
- //create group for tab content
- this.tabwindows[i]["content"] = document.createElementNS(svgNS,"g");
- this.tabwindows[i]["content"].setAttributeNS(null,"id",this.id+"__"+i+"_content");
- if (this.hideContent) {
- this.tabwindows[i]["content"].setAttributeNS(null,"display","none");
- }
- this.tabwindows[i]["group"].appendChild(this.tabwindows[i]["content"]);
- //set tab activate status
- this.tabwindows[i].activeStatus = true;
- //increment currentX with the space between tabs
- currentX += this.spaceBetweenTabs;
- }
- //activate one tab
- this.tabwindows[this.activeTabindex]["tab"].setAttributeNS(null,"fill",this.activetabBGColor);
- this.tabGroup.appendChild(this.tabwindows[this.activeTabindex]["group"]);
- if (this.hideContent) {
- this.tabwindows[this.activeTabindex]["content"].setAttributeNS(null,"display","inherit");
- }
- }
- else {
- alert("could not create or reference 'parentNode' of tabgroup with id '"+this.id+"'");
- }
- }
-
- //test if window group exists or create a new group at the end of the file
-tabgroup.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g") {
- this.parentGroup = this.parentNode;
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if Windows group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- this.parentGroup = document.getElementById(this.parentNode);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-tabgroup.prototype.handleEvent = function(evt) {
- var tab = evt.target;
- var id = tab.getAttributeNS(null,"id");
- var idArray = id.split("__");
- var index = parseInt(idArray[1]);
- this.activateTabByIndex(index,false);
- //firefunction
- this.timer.setTimeout("fireFunction",this.timerMs);
-}
-
-tabgroup.prototype.fireFunction = function() {
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,this.tabTitles[this.activeTabindex],this.activeTabindex);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.tabActivated(this.id,this.tabTitles[this.activeTabindex],this.activeTabindex);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-tabgroup.prototype.activateTabByIndex = function(tabindex,fireFunction) {
- if (tabindex >= this.tabTitles.length) {
- this.outOfBoundMessage(tabindex);
- tabindex = 0;
- }
- //set old active tab to inactive
- this.tabwindows[this.activeTabindex]["tab"].setAttributeNS(null,"fill",this.tabStyles["fill"]);
- if (this.hideContent) {
- this.tabwindows[this.activeTabindex]["content"].setAttributeNS(null,"display","none");
- }
- //set new index
- this.activeTabindex = tabindex;
- //activate new tab
- this.tabwindows[this.activeTabindex]["tab"].setAttributeNS(null,"fill",this.activetabBGColor);
- //reorder tabs
- this.tabGroup.appendChild(this.tabwindows[this.activeTabindex]["group"]);
- //set display
- if (this.hideContent) {
- this.tabwindows[this.activeTabindex]["content"].setAttributeNS(null,"display","inherit");
- }
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
-}
-
-tabgroup.prototype.activateTabByTitle = function(title,fireFunction) {
- var tabindex = -1;
- for (var i=0;i<this.tabTitles.length;i++) {
- if (this.tabTitles[i] == title) {
- tabindex = i;
- break;
- }
- }
- if (tabindex != -1) {
- this.activateTabByIndex(tabindex,fireFunction);
- }
- else {
- alert("Error ("+this.id+"): Could not find title '"+title+"' in array tabTitles!");
- }
-}
-
-//add content to this.tabwindows[tabindex]["content"]
-tabgroup.prototype.addContent = function(node,tabindex,inheritDisplay) {
- if (tabindex >= this.tabTitles.length) {
- this.outOfBoundMessage(tabindex);
- }
- else {
- if (typeof(node) == "string") {
- node = document.getElementById(node);
- }
- if (node != undefined || node != "null") {
- if (inheritDisplay) {
- node.setAttributeNS(null,"display","inherit");
- }
- this.tabwindows[tabindex]["content"].appendChild(node);
- }
- }
-}
-
-//remove content from this.tabwindows[tabindex]["content"]
-tabgroup.prototype.removeContent = function(node,tabindex) {
- var deletedNode = undefined;
- if (tabindex >= this.tabTitles.length) {
- this.outOfBoundMessage(tabindex);
- }
- else {
- if (typeof(node) == "string") {
- node = document.getElementById(node);
- }
- if (node != undefined || node != "null") {
- deletedNode = this.tabwindows[tabindex]["content"].removeChild(node);
- }
- }
- return deletedNode;
-}
-
-//move the tab, reference is upper left corner
-tabgroup.prototype.moveTo = function(x,y) {
- this.transx = x;
- this.transy = y;
- this.tabGroup.setAttributeNS(null,"transform","translate("+this.transx+","+this.transy+")");
-}
-
-//resize tabgroup
-tabgroup.prototype.resize = function(width,height) {
- this.width = width;
- this.height = height;
- //loop to change all tab sizes
- var currentX = this.x;
- for (var i=0;i<this.tabTitles.length;i++) {
- currentLeft = currentX;
- //get bbox
- var bbox = this.tabwindows[i]["tabTitle"].getBBox();
- currentX = Math.round(currentLeft + this.tabmargins * 2 + bbox.width);
- //start the path for tab windows
- var d = "M";
- //left corner of tab
- if (this.cornerLeft == "rect") {
- d += currentLeft+" "+this.y;
- }
- if (this.cornerLeft == "triangle") {
- d += currentLeft+" "+(this.y+this.tabmargins)+"L"+(currentLeft+this.tabmargins)+" "+this.y;
- }
- if (this.cornerLeft == "round") {
- d += currentLeft+" "+(this.y+this.tabmargins)+"a"+this.tabmargins+" "+this.tabmargins+" 0 0 1 "+this.tabmargins+" -"+this.tabmargins;
- }
- //right corner of tab
- if (this.cornerRight == "rect") {
- d += "L"+currentX+" "+this.y;
- }
- if (this.cornerRight == "triangle") {
- d += "L"+(currentX-this.tabmargins)+" "+this.y+"L"+currentX+" "+(this.y+this.tabmargins);
- }
- if (this.cornerRight == "round") {
- d += "L"+(currentX-this.tabmargins)+" "+this.y+"a"+this.tabmargins+" "+this.tabmargins+" 0 0 1 "+this.tabmargins+" "+this.tabmargins;
- }
- d += "L"+currentX+" "+(this.y+this.tabheight);
- //complete the path for tab window
- d += "L"+(this.x+this.width)+" "+(this.y+this.tabheight)+"L"+(this.x+this.width)+" "+(this.y+this.height);
- d += "L"+this.x+" "+(this.y+this.height);
- if (currentLeft == this.x) {
- d += "z";
- }
- else {
- d += "L"+this.x+" "+(this.y+this.tabheight)+"L"+currentLeft+" "+(this.y+this.tabheight)+"z";
- }
- //set modified path elements
- this.tabwindows[i]["tabbg"].setAttributeNS(null,"d",d);
- //increment currentX with the space between tabs
- currentX += this.spaceBetweenTabs;
- }
-}
-
-//deactivate a single tab
-tabgroup.prototype.disableSingleTab = function(tabindex) {
- if (tabindex >= this.tabTitles.length) {
- this.outOfBoundMessage(tabindex);
- }
- else {
- this.tabwindows[tabindex]["activeStatus"] = false;
- if (!this.tabwindows[tabindex]["tabClone"]) {
- this.tabwindows[tabindex]["tabClone"] = this.tabwindows[tabindex]["tab"].cloneNode(false);
- this.tabwindows[tabindex]["tabClone"].removeEventListener("click",this,false);
- this.tabwindows[tabindex]["tabClone"].setAttributeNS(null,"fill-opacity",0.5);
- if (this.tabwindows[tabindex]["tabClone"].hasAttributeNS(null,"cursor")){
- this.tabwindows[tabindex]["tabClone"].removeAttributeNS(null,"cursor");
- }
- this.tabwindows[tabindex]["group"].appendChild(this.tabwindows[tabindex]["tabClone"]);
- }
- else {
- this.tabwindows[tabindex]["tabClone"].setAttributeNS(null,"display","inherit");
- this.tabwindows[tabindex]["group"].appendChild(this.tabwindows[tabindex]["tabClone"]);
- }
- }
-}
-
-//deactivate all tabs
-tabgroup.prototype.disableAllTabs = function() {
- for (var i=0;i<this.tabTitles.length;i++) {
- this.disableSingleTab(i);
- }
-}
-
-//deactivate all tabs
-tabgroup.prototype.enableAllTabs = function() {
- for (var i=0;i<this.tabTitles.length;i++) {
- this.enableSingleTab(i);
- }
-}
-
-//activate a single tab
-tabgroup.prototype.enableSingleTab = function(tabindex) {
- if (tabindex >= this.tabTitles.length) {
- this.outOfBoundMessage(tabindex);
- }
- else {
- this.tabwindows[tabindex]["activeStatus"] = true;
- if (this.tabwindows[tabindex]["tabClone"]) {
- this.tabwindows[tabindex]["tabClone"].setAttributeNS(null,"display","none");
- }
- }
-}
-
-//out of bound error message
-tabgroup.prototype.outOfBoundMessage = function(tabindex) {
- alert("Error ("+this.id+"): the 'tabindex' (value: "+tabindex+") is out of bounds!\nThe index nr is bigger than the number of tabs.");
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/textbox.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/textbox.js
deleted file mode 100644
index 12c810d..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/textbox.js
+++ /dev/null
@@ -1,909 +0,0 @@
-/*
-Scripts to create interactive textboxes in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.1.2, 2006-10-04
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* Initial code was taken from Olaf Schnabel --> schnabel@karto.baug.ethz.ch (thanks!)
-* Thanks also to many people of svgdevelopers@yahoogroups.com
-* bug report and fix from Volker Gersabeck (make textbox namespace aware and corrected .setValue method when text was transformed)
-* bug report and fix from David Boyd (pressing delete key in ASV would fail if cursor is at end of textbox)
-* enhancement suggestion and bug report by Michael Mehldorn (callback function was called twice in case of enter key, accept also integer values in method .setValue())
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/textbox/
-
-----
-
-current version: 1.1.2
-
-version history:
-1.0 (2006-05-03)
-initial version
-
-1.0.1 (2006-05-04)
-fixed a bug with the delete key after clicking into the textbox
-fixed a bug with removing text selection when clicking again after the selectionbox was visible
-
-1.02 (2006-05-18):
-made object multi-namespace aware (hopefully), this probably needs more testing
-it is now allowed to pass numbers in the constructor and .setValue() method
-
-1.03 (2006-05-22):
-fixed a bug in internal method .testSupportsChar() when using an initially empty textbox
-
-1.04 (2006-06-22)
-added constructor parameter this.parentNode; this.parentNode can be of type String (id) or a node reference (g or svg element)
-replaced this.textboxGroup with this.parentGroup to be compatible with other GUI elements; fixed an "out of index" bug that occasionally appeared in Opera 9 when calculating the cursor position
-
-1.1 (2006-07-11)
-fixed a bug with the delete key (ASV only) if cursor was at the end (thanks to David Boyd), fixed another bug with delete key if cursor was at the end it accidentally deleted the first character, fixed a bug in the method .setValue() (thanks to Volker Gersabeck)
-added constructor parameter textYOffset, added methods ".moveTo(x,y)" and ".resize(width)"
-
-1.1.1 (2006-07-13)
-changed the internal structure a bit. An additional group element is now created. This allows several textboxes to be placed in the same parent group. Previously this had failed. No changes in constructor parameters and methods in this release.
-
-1.1.2 (2006-10-04)
-added parameter "fireFunction" to the "setValue()" method in order to determine whether the associated callback function should be fired or not
-introduced new "changetype" with value "set" which indicates that the textbox value was set by method "setValue"
-
--------
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/textbox/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/textbox/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function textbox(id,parentNode,defaultVal,maxChars,x,y,boxWidth,boxHeight,textYOffset,textStyles,boxStyles,cursorStyles,selBoxStyles,allowedChars,functionToCall) {
- var nrArguments = 15;
- var createTextBox= true;
- if (arguments.length == nrArguments) {
- this.id = id; //the id of the textbox
- this.parentNode = parentNode; //can be of type string (id) or node reference (svg or g node)
- this.maxChars = maxChars; //maximum characters allowed
- this.defaultVal = defaultVal.toString(); //default value to be filled in when textbox is created
- this.x = x; //left of background rectangle
- this.y = y; //top of background rectangle
- this.boxWidth = boxWidth; //background rectangle width
- this.boxHeight = boxHeight; //background rectangle height
- this.textYOffset = textYOffset; //the offset of the text element in relation to the upper side of the textbox rectangle
- this.textStyles = textStyles; //array containing text attributes
- if (!this.textStyles["font-size"]) {
- this.textStyles["font-size"] = 15;
- }
- this.boxStyles = boxStyles; //array containing box styles attributes
- this.cursorStyles = cursorStyles; //array containing text attributes
- this.selBoxStyles = selBoxStyles; //array containing box styles attributes
- //allowedChars contains regular expressions of allowed character ranges
- if (allowedChars) {
- if (typeof(allowedChars) == "string") {
- if (allowedChars.length > 0) {
- this.RegExp = new RegExp(allowedChars);
- }
- }
- }
- else {
- this.RegExp = undefined;
- }
- this.functionToCall = functionToCall; //function to be called if textbox looses focus or enter key is pressed
- this.textboxRect = null; //later holds reference to rect element
- this.textboxText = null; //later holds reference to text element
- this.textboxTextContent = null; //later holds reference to content of text element (first child)
- this.textboxCursor = null; //later holds reference to cursor
- this.textboxStatus = 0; //status 0 means unitialized, 1 means partially initalized, 2 means fully initialized and ready to remove event listeners again, 5 means new value was set by method .setValue()
- this.cursorPosition = 0; //position in whole string
- this.transX = 0; //offset on the left if text string is larger than box
- this.textVal = this.defaultVal; //this is the current text string of the content
- this.shiftDown = false; //boolean value that says if shift was pressed
- this.mouseDown = false; //boolean value that says if mousedown is active
- this.startSelection = 0; //position of the start of the selection
- this.startOrigSelection = 0; //original start position of selection
- this.endSelection = 0; //position of the end of the selection
- this.selectionRectVisible = false; //indicates if selection rect is visible or not
- this.svg = null; //later a nested svg that does clipping
- this.supportsCharGeom = true; //defines if viewer supports geometry calculations on individual characters, such as .getCharAtPosition(SVGPoint)
- }
- else {
- createTextBox = false;
- alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createTextBox) {
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
- this.createTextbox(); //method to initialize textbox
- }
- else {
- alert("Could not create textbox with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-//create textbox
-textbox.prototype.createTextbox = function() {
- var result = this.testParent();
- if (result) {
- //create a textbox parent group
- this.textboxParent = document.createElementNS(svgNS,"g");
- this.parentGroup.appendChild(this.textboxParent);
-
- //create background rect
- this.textboxRect = document.createElementNS(svgNS,"rect");
- this.textboxRect.setAttributeNS(null,"x",this.x);
- this.textboxRect.setAttributeNS(null,"y",this.y);
- this.textboxRect.setAttributeNS(null,"width",this.boxWidth);
- this.textboxRect.setAttributeNS(null,"height",this.boxHeight);
- this.textboxRect.setAttributeNS(null,"pointer-events","fill");
- for (var attrib in this.boxStyles) {
- this.textboxRect.setAttributeNS(null,attrib,this.boxStyles[attrib]);
- }
- this.textboxParent.appendChild(this.textboxRect);
-
- this.svg = document.createElementNS(svgNS,"svg");
- this.svg.setAttributeNS(null,"x",this.x + this.textStyles["font-size"] / 4);
- this.svg.setAttributeNS(null,"y",this.y + this.boxHeight * 0.02);
- this.svg.setAttributeNS(null,"width",this.boxWidth - (this.textStyles["font-size"]) / 2);
- this.svg.setAttributeNS(null,"height",this.boxHeight * 0.96);
- this.svg.setAttributeNS(null,"viewBox",(this.x + this.textStyles["font-size"] / 4)+" "+(this.y + this.boxHeight * 0.02)+" "+(this.boxWidth - (this.textStyles["font-size"]) / 2)+" "+(this.boxHeight * 0.96));
- this.textboxParent.appendChild(this.svg);
-
- //create group to hold text, selectionRect and cursor
- this.textboxTextGroup = document.createElementNS(svgNS,"g");
- this.svg.appendChild(this.textboxTextGroup);
-
- //create text element
- this.textboxText = document.createElementNS(svgNS,"text");
- this.textboxText.setAttributeNS(null,"x",(this.x + this.textStyles["font-size"] / 3));
- this.textboxText.setAttributeNS(null,"y",(this.y + this.textYOffset));
- for (var attrib in this.textStyles) {
- value = this.textStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- this.textboxText.setAttributeNS(null,attrib,value);
- }
- this.textboxText.setAttributeNS(null,"id",this.id+"Text");
- if (myMapApp.navigator != "Opera") {
- this.textboxText.setAttributeNS(null,"pointer-events","none");
- }
- this.textboxText.setAttributeNS("http://www.w3.org/XML/1998/namespace","space","preserve");
- //check if defaultVal is longer than maxChars and truncate if necessary
- if (this.defaultVal.length <= this.maxChars) {
- this.textboxTextContent = document.createTextNode(this.defaultVal);
- this.cursorPosition = this.defaultVal.length - 1;
- }
- else {
- alert("the default textbox value is longer than the maximum of allowed characters\nDefault val will be truncated.");
- this.textVal = this.defaultVal.substr(0,(this.maxChars - 1));
- this.textboxTextContent = document.createTextNode(this.textVal);
- this.cursorPosition = this.maxChars - 1;
- }
- this.textboxText.appendChild(this.textboxTextContent);
- this.textboxTextGroup.appendChild(this.textboxText);
-
- //create selection rectangle
- this.selectionRect = document.createElementNS(svgNS,"rect");
- this.selectionRect.setAttributeNS(null,"x",(this.x + this.textStyles["font-size"] / 3));
- this.selectionRect.setAttributeNS(null,"y",(this.y + this.textYOffset - this.textStyles["font-size"] * 0.9));
- this.selectionRect.setAttributeNS(null,"width",(this.textStyles["font-size"] * 2));
- this.selectionRect.setAttributeNS(null,"height",this.textStyles["font-size"] * 1.1);
- for (var attrib in this.selBoxStyles) {
- this.selectionRect.setAttributeNS(null,attrib,this.selBoxStyles[attrib]);
- }
- this.selectionRect.setAttributeNS(null,"display","none");
- this.textboxTextGroup.appendChild(this.selectionRect);
-
- //create cursor element
- this.textboxCursor = document.createElementNS(svgNS,"line");
- this.textboxCursor.setAttributeNS(null,"x1",this.x);
- this.textboxCursor.setAttributeNS(null,"y1",(this.y + this.textYOffset + this.textStyles["font-size"] * 0.2));
- this.textboxCursor.setAttributeNS(null,"x2",this.x);
- this.textboxCursor.setAttributeNS(null,"y2",(this.y + this.textYOffset - this.textStyles["font-size"] * 0.9));
- for (var attrib in this.cursorStyles) {
- this.textboxCursor.setAttributeNS(null,attrib,this.cursorStyles[attrib]);
- }
- this.textboxCursor.setAttributeNS(null,"id",this.id+"Cursor");
- this.textboxCursor.setAttributeNS(null,"visibility","hidden");
- this.textboxTextGroup.appendChild(this.textboxCursor);
-
- // add event listeners to the textbox group
- this.textboxParent.addEventListener("mousedown",this,false);
- this.textboxParent.addEventListener("mousemove",this,false);
- this.textboxParent.addEventListener("mouseup",this,false);
- this.textboxParent.setAttributeNS(null,"cursor","text");
-
- //test if the svgviewer supports getting geometries of individual characters
- this.timer.setTimeout("testSupportsChar",this.timerMs);
- }
- else {
- alert("could not create or reference 'parentNode' of textbox with id '"+this.id+"'");
- }
-}
-
-textbox.prototype.testSupportsChar = function() {
- //determine whether viewer is capable of charGeom functions
- var isEmpty = false;
- //temporarily create a space to test if getStartPosition is available
- if (this.textVal.length == 0) {
- isEmpty = true;
- this.textboxTextContent.nodeValue = " ";
- }
- try {
- var dummy = this.textboxText.getStartPositionOfChar(0).x;
- }
- catch(er) {
- this.supportsCharGeom = false;
- }
- if (isEmpty) {
- this.textboxTextContent.nodeValue = "";
- }
-}
-
-//test if window group exists or create a new group at the end of the file
-textbox.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g" || this.parentNode.nodeName == "svg:svg" || this.parentNode.nodeName == "svg:g") {
- this.parentGroup = this.parentNode;
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if textbox group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- this.parentGroup = document.getElementById(this.parentNode);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-//remove all textbox elements
-textbox.prototype.removeTextbox = function() {
- this.parentGroup.removeChild(this.textboxParent);
-}
-
-//event handler functions
-textbox.prototype.handleEvent = function(evt) {
- if (evt.type == "mousedown") {
- //this case is when the user mousedowns outside the textbox; in this case the textbox should behave like the user
- //pressed the enter key
- if ((evt.currentTarget.nodeName == "svg" || evt.currentTarget.nodeName == "svg:svg") && this.textboxStatus == 2) {
- this.release();
- }
- else {
- //this is for preparing the textbox with first mousedown and to reposition cursor with each subsequent mousedowns
- if (evt.currentTarget.nodeName == "g" || evt.currentTarget.nodeName == "svg:g") {
- this.calcCursorPosFromMouseEvt(evt);
- // set event listeners, this is only done on first mousedown in the textbox
- if (this.textboxStatus == 0) {
- if (myMapApp.navigator == "Adobe") {
- document.documentElement.addEventListener("keydown",this,false);
- }
- document.documentElement.addEventListener("keypress",this,false);
- document.documentElement.addEventListener("mousedown",this,false);
- document.documentElement.addEventListener("mouseup",this,false);
- document.documentElement.addEventListener("mousemove",this,false);
- // set textbox status
- this.textboxStatus = 1;
- // set cursor visibility
- this.textboxCursor.setAttributeNS(null,"visibility","visible");
- }
- else {
- evt.stopPropagation();
- }
- this.setCursorPos();
- //start text selection
- this.startOrigSelection = this.cursorPosition + 1;
- this.startSelection = this.cursorPosition + 1;
- this.endSelection = this.cursorPosition + 2;
- //remove previous selections
- this.selectionRect.setAttributeNS(null,"display","none");
- this.selectionRectVisible = false;
- //set status of shiftDown and mouseDown
- this.shiftDown = true;
- this.mouseDown = true;
- }
- //this mouseup should be received from background rectangle (received via document element)
- else {
- this.textboxStatus = 2;
- }
- }
- }
- if (evt.type == "mousemove") {
- if (this.textboxStatus == 2 && this.shiftDown && this.mouseDown && this.supportsCharGeom) {
- this.calcCursorPosFromMouseEvt(evt);
- this.setCursorPos();
- if (this.cursorPosition + 1 != this.startOrigSelection) {
- if (this.cursorPosition + 1 < this.startOrigSelection) {
- this.endSelection = this.startOrigSelection;
- this.startSelection = this.cursorPosition + 1;
- }
- else {
- this.startSelection = this.startOrigSelection;
- this.endSelection = this.cursorPosition + 1;
- }
- this.selectionRect.setAttributeNS(null,"display","inherit");
- this.selectionRectVisible = true;
- var rectX = this.textboxText.getStartPositionOfChar(this.startSelection).x
- this.selectionRect.setAttributeNS(null,"x",rectX);
- this.selectionRect.setAttributeNS(null,"width",(this.textboxText.getEndPositionOfChar(this.endSelection - 1).x - rectX));
- var cursorX = parseInt(this.textboxCursor.getAttributeNS(null,"x1"));
- //if cursor runs out on the right, scroll to the right
- if ((cursorX + this.transX) > (this.x + this.boxWidth - this.textStyles["font-size"] / 3)) {
- this.transX = (this.x + this.boxWidth - this.textStyles["font-size"] / 3) - cursorX;
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- //if cursor runs out on the left, scroll to the left
- if ((cursorX + this.transX) < (this.x + this.textStyles["font-size"] / 3)) {
- this.transX += (this.x + this.textStyles["font-size"] / 3) - (cursorX + this.transX);
- if (this.transX * -1 < (this.boxWidth - this.textStyles["font-size"])) {
- this.transX = 0;
- }
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- }
- }
- }
- if (evt.type == "mouseup") {
- if (this.textboxStatus == 2 && this.shiftDown && this.mouseDown) {
- this.mouseDown = false;
- }
- }
- if (evt.type == "keypress") {
- if (evt.keyCode) {
- var charCode = evt.keyCode;
- }
- else {
- var charCode = evt.charCode;
- }
- var keyCode = parseInt(charCode);
- var charCode = undefined;
- this.changed = false; //this tracks if the text was actually changed (if the content was changed)
- //alert("keyCode="+evt.keyCode+", charCode="+evt.charCode+", shiftKey"+evt.shiftKey);
-
- if (myMapApp.navigator != "Adobe") {
- //note that Adobe SVG enters this method through the keydown event
- this.specialCharacters(evt);
- }
-
- if (myMapApp.navigator == "Opera") {
- if (evt.keyCode > 31 && evt.keyCode != 35 && evt.keyCode != 36 && evt.keyCode != 37 && evt.keyCode != 39 && evt.keyCode != 46) {
- evt.charCode = evt.keyCode;
- }
- }
-
- //all real characters
- if (keyCode > 31 && keyCode != 127 && keyCode < 65535 && evt.charCode && evt.charCode < 65535) {
- var textChanged = false;
- var keychar = String.fromCharCode(keyCode);
- var result = 0;
- if (this.RegExp) {
- result = keychar.search(this.RegExp);
- }
- if (result == 0) {
- if (this.shiftDown && this.selectionRectVisible) {
- var tempText = this.textVal.substring(0,this.startSelection) + keychar + this.textVal.substring(this.endSelection,this.textVal.length);
- this.textVal = tempText;
- this.cursorPosition = this.startSelection - 1;
- textChanged = true;
- this.releaseShift();
- }
- else if (this.textVal.length < this.maxChars) {
- if (this.cursorPosition == this.textVal.length -1) {
- this.textVal += keychar; // append new input character
- }
- else {
- var tempText = this.textVal.substring(0,(this.cursorPosition + 1)) + keychar + this.textVal.substring((this.cursorPosition + 1),(this.textVal.length));
- this.textVal = tempText;
- }
- textChanged = true;
- }
- if (this.textVal.length < this.maxChars) {
- this.cursorPosition++;
- }
- else {
- if (textChanged) {
- if (this.cursorPosition < this.textVal.length) {
- this.cursorPosition++;
- }
- else {
- this.cursorPosition = this.textVal.length - 1;
- }
- }
- }
- //make sure that the selections and shift key are resetted
- this.startSelection = this.cursorPosition;
- this.endSelection = this.cursorPosition;
- this.shiftDown = false;
- if (textChanged) {
- this.textboxTextContent.nodeValue=this.textVal;
- this.changed = true;
- //update cursor position
- this.setCursorPos();
- var cursorX = parseInt(this.textboxCursor.getAttributeNS(null,"x1"));
- if ((cursorX + this.transX) > (this.x + this.boxWidth - this.textStyles["font-size"] / 3)) {
- this.transX = (this.x + this.boxWidth - this.textStyles["font-size"] / 3) - (cursorX + this.transX) + this.transX;
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- }
- }
- }
- //fire function if text changed
- if (this.changed) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
- //suppress unwanted browser shortcuts. e.g. in Opera or Mozilla
- evt.preventDefault();
- }
- //this part is only because the Adobe viewer doesn't return certain keys "onkeypress"
- if (evt.type == "keydown") {
- this.specialCharacters(evt);
- }
-}
-
-textbox.prototype.specialCharacters = function(evt) {
- if (evt.keyCode) {
- var charCode = evt.keyCode;
- }
- else {
- var charCode = evt.charCode;
- }
- var keyCode = parseInt(charCode);
- var charCode = undefined;
-
- //backspace key
- if (keyCode == 8) {
- //only do it if there is still text and cursor is not at start position
- if (this.textVal.length > 0 && this.cursorPosition > -2) {
- //first deal with text content, delete chars according to cursor position
- if (this.shiftDown && this.selectionRectVisible) {
- var tempText = this.textVal.substring(0,this.startSelection) + this.textVal.substring(this.endSelection,this.textVal.length);
- this.textVal = tempText;
- this.cursorPosition = this.startSelection - 1;
- this.releaseShift();
- }
- else {
- if (this.cursorPosition == this.textVal.length - 1) {
- //cursor is at the end of textVal
- this.textVal=this.textVal.substring(0,this.textVal.length-1);
- }
- else {
- //cursor is in between
- var tempText = this.textVal.substring(0,(this.cursorPosition)) + this.textVal.substring((this.cursorPosition + 1),(this.textVal.length));
- this.textVal = tempText;
- }
- //decrease cursor position
- if (this.cursorPosition > -1) {
- this.cursorPosition--;
- }
- }
- this.textboxTextContent.nodeValue=this.textVal;
- this.setCursorPos();
- if (this.cursorPosition > 0) {
- //retransform text element when cursor is at the left side of the box
- if (this.supportsCharGeom) {
- var cursorX = this.textboxText.getStartPositionOfChar(this.cursorPosition).x;
- }
- else {
- var bbox = this.textboxText.getBBox();
- var cursorX = bbox.x + bbox.width;
- }
- if ((cursorX + this.transX) < (this.x + this.textStyles["font-size"] / 3)) {
- this.transX += (this.x + this.textStyles["font-size"] / 3) - (cursorX + this.transX);
- if (this.transX * -1 < (this.boxWidth - this.textStyles["font-size"])) {
- this.transX = 0;
- }
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- }
- this.changed = true;
- }
- }
- //the two enter keys
- else if (keyCode == 10 || keyCode == 13) { // press return (enter)
- this.release();
- }
- //end key
- else if (keyCode == 35 && !(charCode)) {
- if (evt.shiftKey) {
- if (this.shiftDown == false) {
- this.startOrigSelection = this.cursorPosition + 1;
- this.startSelection = this.cursorPosition + 1;
- this.shiftDown = true;
- }
- }
- this.cursorPosition = this.textVal.length - 1;
- this.setCursorPos();
- //if text string is too long
- var cursorX = parseInt(this.textboxCursor.getAttributeNS(null,"x1"));
- if ((cursorX + this.transX) > (this.x + this.boxWidth - this.textStyles["font-size"] / 3)) {
- this.transX = (this.x + this.boxWidth - this.textStyles["font-size"] / 3) - cursorX;
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- this.setCursorPos();
- if (evt.shiftKey) {
- if (this.shiftDown == false) {
- this.startOrigSelection = this.cursorPosition;
- this.startSelection = this.cursorPosition;
- this.shiftDown = true;
- }
- this.endSelection = this.cursorPosition + 1;
- this.selectionRect.setAttributeNS(null,"display","inherit");
- this.selectionRectVisible = true;
- if (this.supportsCharGeom) {
- var rectX = this.textboxText.getStartPositionOfChar(this.startSelection).x;
- var width = (this.textboxText.getEndPositionOfChar(this.endSelection - 1).x - rectX);
- }
- else {
- var bbox = this.textboxText.getBBox();
- var rectX = this.x + this.textStyles["font-size"] / 3;
- var width = this.x + bbox.width + this.textStyles["font-size"] / 3;
- }
- this.selectionRect.setAttributeNS(null,"x",rectX);
- this.selectionRect.setAttributeNS(null,"width",width);
- }
- if (this.shiftDown && evt.shiftKey == false) {
- this.releaseShift();
- }
- }
- //home key
- else if (keyCode == 36 && !(charCode)) {
- if (evt.shiftKey) {
- if (this.shiftDown == false) {
- this.startOrigSelection = this.cursorPosition + 1;
- this.startSelection = this.cursorPosition + 1;
- this.shiftDown = true;
- }
- }
- this.cursorPosition = -1;
- this.textboxText.setAttributeNS(null,"x",(this.x + this.textStyles["font-size"] / 3));
- this.textboxTextGroup.setAttributeNS(null,"transform","translate(0,0)");
- this.transX = 0;
- this.setCursorPos();
- if (evt.shiftKey) {
- if (this.shiftDown == false) {
- this.startOrigSelection = this.cursorPosition;
- this.startSelection = this.cursorPosition;
- this.shiftDown = true;
- }
- this.endSelection = this.startSelection;
- this.startSelection = 0;
- this.selectionRect.setAttributeNS(null,"display","inherit");
- this.selectionRectVisible = true;
- if (this.supportsCharGeom) {
- var rectX = this.textboxText.getStartPositionOfChar(this.startSelection).x;
- var width = (this.textboxText.getEndPositionOfChar(this.endSelection - 1).x - rectX);
- }
- else {
- var bbox = this.textboxText.getBBox();
- var rectX = this.x + this.textStyles["font-size"] / 3;
- var width = this.x + bbox.width + this.textStyles["font-size"] / 3;
- }
- this.selectionRect.setAttributeNS(null,"x",rectX);
- this.selectionRect.setAttributeNS(null,"width",width);
- }
- if (this.shiftDown && evt.shiftKey == false) {
- this.releaseShift();
- }
- }
- //left key
- else if (keyCode == 37 && !(charCode)) {
- if (this.cursorPosition > -1) {
- this.cursorPosition--;
- this.setCursorPos();
- var cursorX = parseInt(this.textboxCursor.getAttributeNS(null,"x1"));
- if ((cursorX + this.transX) < (this.x + this.textStyles["font-size"] / 3)) {
- this.transX += (this.x + this.textStyles["font-size"] / 3) - (cursorX + this.transX);
- if (this.transX * -1 < (this.boxWidth - this.textStyles["font-size"])) {
- this.transX = 0;
- }
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- //do selection if shift key is pressed
- if (evt.shiftKey && this.supportsCharGeom) {
- if (this.shiftDown == false) {
- this.startOrigSelection = this.cursorPosition + 2;
- this.startSelection = this.cursorPosition + 2;
- this.shiftDown = true;
- }
- this.endSelection = this.startOrigSelection;
- this.startSelection = this.cursorPosition + 1;
- this.selectionRect.setAttributeNS(null,"display","inherit");
- this.selectionRectVisible = true;
- var rectX = this.textboxText.getStartPositionOfChar(this.startSelection).x
- this.selectionRect.setAttributeNS(null,"x",rectX);
- this.selectionRect.setAttributeNS(null,"width",(this.textboxText.getEndPositionOfChar(this.endSelection - 1).x - rectX));
- }
- else {
- if (this.shiftDown) {
- this.releaseShift();
- }
- }
- }
- }
- //right key
- else if (keyCode == 39 && !(charCode)) {
- if (this.cursorPosition < this.textVal.length - 1) {
- this.cursorPosition++;
- this.setCursorPos();
- var cursorX = parseInt(this.textboxCursor.getAttributeNS(null,"x1"));
- if ((cursorX + this.transX) > (this.x + this.boxWidth - this.textStyles["font-size"] / 3)) {
- this.transX = (this.x + this.boxWidth - this.textStyles["font-size"] / 3) - cursorX;
- this.textboxTextGroup.setAttributeNS(null,"transform","translate("+this.transX+",0)");
- }
- //do selection if shift key is pressed
- if (evt.shiftKey && this.supportsCharGeom) {
- if (this.shiftDown == false) {
- this.startOrigSelection = this.cursorPosition;
- this.startSelection = this.cursorPosition;
- this.shiftDown = true;
- }
- this.endSelection = this.cursorPosition + 1;
- this.selectionRect.setAttributeNS(null,"display","inherit");
- this.selectionRectVisible = true;
- var rectX = this.textboxText.getStartPositionOfChar(this.startSelection).x
- this.selectionRect.setAttributeNS(null,"x",rectX);
- this.selectionRect.setAttributeNS(null,"width",(this.textboxText.getEndPositionOfChar(this.endSelection - 1).x - rectX));
- }
- else {
- if (this.shiftDown) {
- this.releaseShift();
- }
- }
- }
- }
- //delete key
- else if ((keyCode == 127 || keyCode == 12 || keyCode == 46) && !(charCode)) {
- if ((this.textVal.length > 0) && (this.cursorPosition < (this.textVal.length))) {
- var tempText = null;
- if (this.shiftDown && evt.shiftKey == false && this.startSelection < this.textVal.length) {
- //we need to delete selected text
- var tempText = this.textVal.substring(0,this.startSelection) + this.textVal.substring(this.endSelection,this.textVal.length);
- this.cursorPosition = this.startSelection - 1;
- this.releaseShift();
- this.changed = true;
- }
- else {
- if (this.cursorPosition < (this.textVal.length - 1)) {
- //we need to delete the next character, if cursor is not at the end of the textstring
- var tempText = this.textVal.substring(0,(this.cursorPosition + 1)) + this.textVal.substring((this.cursorPosition + 2),(this.textVal.length));
- this.changed = true;
- }
- }
- if (this.changed) {
- if(tempText != null) {
- this.textVal = tempText;
- this.textboxTextContent.nodeValue=this.textVal;
- this.setCursorPos();
- }
- }
- }
- }
- //fire function if text changed
- if (myMapApp.navigator == "Adobe") {
- if (this.changed) {
- this.timer.setTimeout("fireFunction",this.timerMs);
- }
- }
-}
-
-textbox.prototype.setCursorPos = function() {
- //cursor is not at first position
- if (this.cursorPosition > -1) {
- if (this.supportsCharGeom) {
- if (this.textVal.length > 0) {
- var cursorPos = this.textboxText.getEndPositionOfChar(this.cursorPosition).x;
- }
- else {
- var cursorPos = (this.x + this.textStyles["font-size"] / 3);
- }
- this.textboxCursor.setAttributeNS(null,"x1",cursorPos);
- this.textboxCursor.setAttributeNS(null,"x2",cursorPos);
- }
- else {
- //case MozillaSVG 1.5 or other SVG viewers not implementing .getEndPositionOfChar
- var bbox = this.textboxText.getBBox();
- this.textboxCursor.setAttributeNS(null,"x1",(bbox.x + bbox.width + this.textStyles["font-size"] / 3));
- this.textboxCursor.setAttributeNS(null,"x2",(bbox.x + bbox.width + this.textStyles["font-size"] / 3));
- }
- }
- else {
- //cursor is at first position
- //reset transformations
- this.textboxText.setAttributeNS(null,"x",(this.x + this.textStyles["font-size"] / 3));
- this.textboxTextGroup.setAttributeNS(null,"transform","translate(0,0)");
- this.transX = 0;
- if (this.supportsCharGeom) {
- if (this.textboxTextContent.length > 0) {
- var cursorPos = this.textboxText.getStartPositionOfChar(0).x;
- }
- else {
- var cursorPos = this.x + this.textStyles["font-size"] / 3;
- }
- }
- else {
- var cursorPos = this.x + this.textStyles["font-size"] / 3;
- }
- this.textboxCursor.setAttributeNS(null,"x1",cursorPos);
- this.textboxCursor.setAttributeNS(null,"x2",cursorPos);
- }
-}
-
-textbox.prototype.fireFunction = function() {
- var changeType = "change";
- if (this.textboxStatus == 0) {
- changeType = "release";
- }
- if (this.textboxStatus == 5) {
- this.textboxStatus = 0;
- changeType = "set";
- }
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,this.textVal,changeType);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.textboxChanged(this.id,this.textVal,changeType);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-textbox.prototype.getValue = function() {
- return this.textVal;
-}
-
-textbox.prototype.setValue = function(value,fireFunction) {
- this.textVal = value.toString();
- this.textboxTextContent.nodeValue=this.textVal;
- //set the cursor to beginning and remove previous transforms
- this.cursorPosition = -1;
- this.setCursorPos();
- if (fireFunction == true) {
- this.textboxStatus = 5; //5 means is set by setValue
- this.fireFunction();
- }
-}
-
-textbox.prototype.release = function() {
- // set textbox status
- this.textboxStatus = 0;
- // remove event listeners
- document.documentElement.removeEventListener("keypress",this,false);
- if (myMapApp.navigator == "Adobe") {
- document.documentElement.removeEventListener("keydown",this,false);
- }
- document.documentElement.removeEventListener("mousedown",this,false);
- document.documentElement.removeEventListener("mousemove",this,false);
- document.documentElement.removeEventListener("mouseup",this,false);
- //set cursor and text selection to invisible
- this.textboxCursor.setAttributeNS(null,"visibility","hidden");
- this.releaseShift();
- this.timer.setTimeout("fireFunction",this.timerMs);
-}
-
-textbox.prototype.releaseShift = function() {
- this.selectionRect.setAttributeNS(null,"display","none");
- this.selectionRectVisible = false;
- this.shiftDown = false;
-}
-
-textbox.prototype.calcCursorPosFromMouseEvt = function(evt) {
- //determine cursor position of mouse event
- var myCoords = myMapApp.calcCoord(evt,this.textboxText);
- //create an SVG Point object
- var mySVGPoint = document.documentElement.createSVGPoint();
- mySVGPoint.x = myCoords.x;
- mySVGPoint.y = myCoords.y;
- //set new cursor position
- if (this.textboxTextContent.length > 0) {
- if (this.supportsCharGeom) {
- //for regular SVG viewers that support .getCharNumAtPosition
- this.cursorPosition = this.textboxText.getCharNumAtPosition(mySVGPoint);
- if (this.cursorPosition > this.textVal.length - 1) {
- this.cursorPosition = this.textVal.length - 1;
- }
- //in this case the user did not correctly touch the text element
- if (this.cursorPosition == -1) {
- //first check if we can fix the position by moving the y-coordinate
- mySVGPoint.y = (this.textboxText.getBBox().y + this.textStyles["font-size"] * 0.5);
- this.cursorPosition = this.textboxText.getCharNumAtPosition(mySVGPoint);
- //check if cursor is to the right of the end of the text
- if (this.cursorPosition == -1) {
- if (mySVGPoint.x > (this.textboxText.getBBox().x + this.textboxText.getBBox().width)) {
- this.cursorPosition = this.textVal.length - 1;
- }
- }
- }
- }
- else {
- //workaround for firefox 1.5/2.0 and other viewers not supporting .getCharNumAtPosition
- var bbox = this.textboxText.getBBox();
- var diffLeft = Math.abs(mySVGPoint.x - bbox.x);
- var diffRight = Math.abs(mySVGPoint.x - (bbox.x + bbox.width));
- if (diffLeft < diffRight) {
- this.cursorPosition = -1;
- }
- else {
- this.cursorPosition = this.textVal.length - 1;
- }
- }
- }
- else {
- //in case the text is empty
- this.cursorPosition = -1;
- }
-}
-
-textbox.prototype.moveTo = function(moveX,moveY) {
- this.x = moveX;
- this.y = moveY;
- //reposition textbox
- this.textboxRect.setAttributeNS(null,"x",this.x);
- this.textboxRect.setAttributeNS(null,"y",this.y);
- //reposition svg element
- this.svg.setAttributeNS(null,"x",this.x + this.textStyles["font-size"] / 4);
- this.svg.setAttributeNS(null,"y",this.y + this.boxHeight * 0.02);
- this.svg.setAttributeNS(null,"viewBox",(this.x + this.textStyles["font-size"] / 4)+" "+(this.y + this.boxHeight * 0.02)+" "+(this.boxWidth - (this.textStyles["font-size"]) / 2)+" "+(this.boxHeight * 0.96));
- //reposition text element
- this.textboxText.setAttributeNS(null,"x",(this.x + this.textStyles["font-size"] / 3));
- this.textboxText.setAttributeNS(null,"y",(this.y + this.textYOffset));
- //reposition selection element
- this.selectionRect.setAttributeNS(null,"x",(this.x + this.textStyles["font-size"] / 3));
- this.selectionRect.setAttributeNS(null,"y",(this.y + this.textYOffset - this.textStyles["font-size"] * 0.9));
- //reposition cursor
- this.textboxCursor.setAttributeNS(null,"x1",this.x);
- this.textboxCursor.setAttributeNS(null,"y1",(this.y + this.textYOffset + this.textStyles["font-size"] * 0.2));
- this.textboxCursor.setAttributeNS(null,"x2",this.x);
- this.textboxCursor.setAttributeNS(null,"y2",(this.y + this.textYOffset - this.textStyles["font-size"] * 0.9));
- //set the cursor to beginning and remove previous transforms
- this.cursorPosition = -1;
- this.setCursorPos();
-}
-
-textbox.prototype.resize = function(newWidth) {
- this.boxWidth = newWidth;
- //resize textbox rectangle
- this.textboxRect.setAttributeNS(null,"width",this.boxWidth);
- //resize svg element
- this.svg.setAttributeNS(null,"width",this.boxWidth - (this.textStyles["font-size"]) / 2);
- this.svg.setAttributeNS(null,"viewBox",(this.x + this.textStyles["font-size"] / 4)+" "+(this.y + this.boxHeight * 0.02)+" "+(this.boxWidth - (this.textStyles["font-size"]) / 2)+" "+(this.boxHeight * 0.96));
- //set the cursor to beginning and remove previous transforms
- this.cursorPosition = -1;
- this.setCursorPos();
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/timer.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/timer.js
deleted file mode 100644
index 837e7a93..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/timer.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// source/credits: "Algorithm": http://www.codingforums.com/showthread.php?s=&threadid=10531
-// The constructor should be called with
-// the parent object (optional, defaults to window).
-
-function Timer(){
- this.obj = (arguments.length)?arguments[0]:window;
- return this;
-}
-
-// The set functions should be called with:
-// - The name of the object method (as a string) (required)
-// - The millisecond delay (required)
-// - Any number of extra arguments, which will all be
-// passed to the method when it is evaluated.
-
-Timer.prototype.setInterval = function(func, msec){
- var i = Timer.getNew();
- var t = Timer.buildCall(this.obj, i, arguments);
- Timer.set[i].timer = window.setInterval(t,msec);
- return i;
-}
-Timer.prototype.setTimeout = function(func, msec){
- var i = Timer.getNew();
- Timer.buildCall(this.obj, i, arguments);
- Timer.set[i].timer = window.setTimeout("Timer.callOnce("+i+");",msec);
- return i;
-}
-
-// The clear functions should be called with
-// the return value from the equivalent set function.
-
-Timer.prototype.clearInterval = function(i){
- if(!Timer.set[i]) return;
- window.clearInterval(Timer.set[i].timer);
- Timer.set[i] = null;
-}
-Timer.prototype.clearTimeout = function(i){
- if(!Timer.set[i]) return;
- window.clearTimeout(Timer.set[i].timer);
- Timer.set[i] = null;
-}
-
-// Private data
-
-Timer.set = new Array();
-Timer.buildCall = function(obj, i, args){
- var t = "";
- Timer.set[i] = new Array();
- if(obj != window){
- Timer.set[i].obj = obj;
- t = "Timer.set["+i+"].obj.";
- }
- t += args[0]+"(";
- if(args.length > 2){
- Timer.set[i][0] = args[2];
- t += "Timer.set["+i+"][0]";
- for(var j=1; (j+2)<args.length; j++){
- Timer.set[i][j] = args[j+2];
- t += ", Timer.set["+i+"]["+j+"]";
- }}
- t += ");";
- Timer.set[i].call = t;
- return t;
-}
-Timer.callOnce = function(i){
- if(!Timer.set[i]) return;
- eval(Timer.set[i].call);
- Timer.set[i] = null;
-}
-Timer.getNew = function(){
- var i = 0;
- while(Timer.set[i]) i++;
- return i;
-} \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/resources/window.js b/webkit/data/layout_tests/pending/svg/carto.net/resources/window.js
deleted file mode 100644
index 4ff3b8f..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/resources/window.js
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
-Scripts to create interactive Windows in SVG using ECMA script
-Copyright (C) <2006> <Andreas Neumann>
-Version 1.2, 2006-08-22
-neumann@karto.baug.ethz.ch
-http://www.carto.net/
-http://www.carto.net/neumann/
-
-Credits:
-* none so far
-
-----
-
-Documentation: http://www.carto.net/papers/svg/gui/Window/
-
-----
-
-current version: 1.2
-
-version history:
-1.0 (2006-02-09)
-initial version
-
-1.0.1 (2006-03-11)
-changed parameters of constructor (styling system): now an array of literals containing presentation attributes. This allows for more flexibility in Styling. Added check for number of arguments.
-
-1.1 (2006-03-13)
-added additional parameter for .appendContent() and .insertContent(), added a .resize(method)
-
-1.1.1 (2006-06-15)
-added parameter fireFunction (of type boolean) to all methods that change the window state in order to allow script controlled changes without fireing the callback function
-
-1.1.2 (2006-06-16)
-renamed this.parentId to this.parentNode; this.parentNode can now also be of type node reference (g or svg element)
-
-1.2 (2006-08-22)
-added additional event types: "moveStart", "moveEnd" and "created", added method ".addWindowDecoration()", improved documentation.
-
--------
-
-
-This ECMA script library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library (lesser_gpl.txt); if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-----
-
-original document site: http://www.carto.net/papers/svg/gui/Window/
-Please contact the author in case you want to use code or ideas commercially.
-If you use this code, please include this copyright header, the included full
-LGPL 2.1 text and read the terms provided in the LGPL 2.1 license
-(http://www.gnu.org/copyleft/lesser.txt)
-
--------------------------------
-
-Please report bugs and send improvements to neumann@karto.baug.ethz.ch
-If you use this control, please link to the original (http://www.carto.net/papers/svg/gui/Window/)
-somewhere in the source-code-comment or the "about" of your project and give credits, thanks!
-
-*/
-
-function Window(id,parentNode,width,height,transX,transY,moveable,constrXmin,constrYmin,constrXmax,constrYmax,showContent,placeholderStyles,windowStyles,margin,titleBarVisible,statusBarVisible,titleText,statusText,closeButton,minimizeButton,maximizeButton,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,functionToCall) {
- var nrArguments = 30;
- var createWindow= true;
- if (arguments.length == nrArguments) {
- this.id = id;
- this.parentNode = parentNode; //can be of type string (id) or node reference (svg or g node)
- this.width = width;
- this.height = height;
- this.transX = transX;
- this.transY = transY;
- this.constrXmin = constrXmin;
- this.constrYmin = constrYmin;
- this.constrXmax = constrXmax;
- this.constrYmax = constrYmax;
- this.showContent = showContent;
- this.placeholderStyles = placeholderStyles;
- this.moveable = moveable;
- this.windowStyles = windowStyles;
- this.margin = margin;
- this.titleBarVisible = titleBarVisible;
- this.statusBarVisible = statusBarVisible;
- this.titleText = titleText;
- this.statusText = statusText;
- this.closeButton = closeButton;
- this.minimizeButton = minimizeButton;
- this.maximizeButton = maximizeButton;
- this.titlebarStyles = titlebarStyles;
- this.titlebarHeight = titlebarHeight;
- this.statusbarStyles = statusbarStyles;
- this.statusbarHeight = statusbarHeight;
- this.titletextStyles = titletextStyles;
- if (!this.titletextStyles["font-size"]) {
- this.titletextStyles["font-size"] = 12;
- }
- this.statustextStyles = statustextStyles;
- if (!this.statustextStyles["font-size"]) {
- this.statustextStyles["font-size"] = 12;
- }
- this.buttonStyles = buttonStyles;
- if (!this.buttonStyles["fill"]) {
- this.buttonStyles["fill"] = "gainsboro";
- }
- if (!this.buttonStyles["stroke"]) {
- this.buttonStyles["stroke"] = "dimgray";
- }
- if (!this.buttonStyles["stroke-width"]) {
- this.buttonStyles["stroke-width"] = 1;
- }
- this.functionToCall = functionToCall;
- //now status and reference variables
- this.windowGroup = null; //later a reference to the window group
- this.parentGroup = null; //later a reference to the parent group of the window
- this.windowTitlebarGroup = null; //later a reference to the group containing the title bar elements of the group
- this.titleBar = null; //later a reference to the titleBar rectangle
- this.windowMainGroup = null; //later a reference to the group containing the window background and the content
- this.windowContentGroup = null; //later a reference to the content of the window
- this.shadowRect = null; //later a reference to a shadow rectangle
- this.shadowTitleRect = null; //later a reference to a shadow rectangle of the titlebar
- this.backgroundRect = null; //later a reference to the window background rectangle
- this.closeButtonInstance = null; //later a reference to the close button
- this.maximizeButtonInstance = null; //later a reference to the maximize button
- this.minimizeButtonInstance = null; //later a reference to the minimize button
- this.statusbar = null; //later a reference to the statusbar
- this.statusTextElement = null; //later a reference to the status text element
- this.statusTextNode = null; //later a reference to the text child node of the statusbar
- this.titleTextNode = null; //later a reference to the text child node of the titlebar
- this.panStatus = 0; //0 means not active, 1 means mousedown and initialized 2 means currently panning
- this.minimized = false; //status to indicate if window is minimized
- this.closed = false; //status to indicate if window is closed
- this.removed = false; //status to indicate if window is removed/available
- this.decorationGroup = null; //later a potential reference to the group containing a window decoration
- this.decorationGroupMinimized = null; //later a potential reference to the group containing the window decoration geometry that is set to display="none" when minimized
- }
- else {
- createWindow = false;
- alert("Error ("+id+"): wrong nr of arguments! You have to pass over "+nrArguments+" parameters.");
- }
- if (createWindow) {
- this.timer = new Timer(this); //a Timer instance for calling the functionToCall
- this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms
- this.createWindow();
- }
- else {
- alert("Could not create Window with id '"+id+"' due to errors in the constructor parameters");
- }
-}
-
-//create a new window
-Window.prototype.createWindow = function() {
- var result = this.testParent();
- if (result) {
- //main group of the window
- this.windowGroup = document.createElementNS(svgNS,"g");
- this.windowGroup.setAttributeNS(null,"id",this.id);
- this.windowGroup.setAttributeNS(null,"transform","translate("+this.transX+","+this.transY+")");
- //create shadowRect to represent window if showContent variable is false
- this.shadowRect = document.createElementNS(svgNS,"rect");
- this.shadowRect.setAttributeNS(null,"width",this.width);
- this.shadowRect.setAttributeNS(null,"height",this.height);
- for (var attrib in this.placeholderStyles) {
- this.shadowRect.setAttributeNS(null,attrib,this.placeholderStyles[attrib]);
- }
- this.shadowRect.setAttributeNS(null,"display","none");
- this.windowGroup.appendChild(this.shadowRect);
- //create shadowRect to represent window if showContent variable is false
- this.shadowTitleRect = document.createElementNS(svgNS,"rect");
- this.shadowTitleRect.setAttributeNS(null,"width",this.width);
- this.shadowTitleRect.setAttributeNS(null,"height",this.titlebarHeight);
- for (var attrib in this.placeholderStyles) {
- this.shadowTitleRect.setAttributeNS(null,attrib,this.placeholderStyles[attrib]);
- }
- this.shadowTitleRect.setAttributeNS(null,"display","none");
- this.windowGroup.appendChild(this.shadowTitleRect);
- //group of the window titlebar
- this.windowTitlebarGroup = document.createElementNS(svgNS,"g");
- this.windowTitlebarGroup.setAttributeNS(null,"id","windowTitlebarGroup"+this.id);
- //group containing background and content
- this.windowMainGroup = document.createElementNS(svgNS,"g");
- this.windowMainGroup.setAttributeNS(null,"id","windowMainGroup"+this.id);
- //group later containing window content
- this.windowContentGroup = document.createElementNS(svgNS,"g");
- //create backgroundRect
- this.backgroundRect = document.createElementNS(svgNS,"rect");
- this.backgroundRect.setAttributeNS(null,"width",this.width);
- this.backgroundRect.setAttributeNS(null,"height",this.height);
- for (var attrib in this.windowStyles) {
- this.backgroundRect.setAttributeNS(null,attrib,this.windowStyles[attrib]);
- }
- this.windowMainGroup.appendChild(this.backgroundRect);
- this.windowMainGroup.appendChild(this.windowContentGroup);
- this.windowGroup.appendChild(this.windowMainGroup);
- //create titlebar
- if (this.titleBarVisible) {
- this.titlebar = document.createElementNS(svgNS,"rect");
- this.titlebar.setAttributeNS(null,"width",this.width);
- this.titlebar.setAttributeNS(null,"height",this.titlebarHeight);
- for (var attrib in this.titlebarStyles) {
- this.titlebar.setAttributeNS(null,attrib,this.titlebarStyles[attrib]);
- }
- this.titlebar.setAttributeNS(null,"id","titleBar"+this.id);
- this.titlebar.setAttributeNS(null,"cursor","pointer");
- this.titlebar.addEventListener("click",this,false);
- this.titlebar.addEventListener("mousedown",this,false);
- this.windowTitlebarGroup.appendChild(this.titlebar);
- var titletext = document.createElementNS(svgNS,"text");
- titletext.setAttributeNS(null,"x",this.margin);
- titletext.setAttributeNS(null,"y",this.titlebarHeight - (this.titlebarHeight - this.titletextStyles["font-size"]));
- var value = "";
- for (var attrib in this.titletextStyles) {
- value = this.titletextStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- titletext.setAttributeNS(null,attrib,value);
- }
- titletext.setAttributeNS(null,"pointer-events","none");
- if (this.titleText.length > 0) {
- this.titleTextNode = document.createTextNode(this.titleText);
- }
- else {
- this.titleTextNode = document.createTextNode(" ");
- }
- titletext.appendChild(this.titleTextNode);
- this.windowTitlebarGroup.appendChild(titletext);
- }
- //test if defs section exists or create a new one
- var defsSection = document.getElementsByTagName("defs").item(0);
- if (!defsSection) {
- defsSection = document.createElementNS(svgNS,"defs");
- document.documentElement.appendChild(defsSection);
- }
- //now create buttons
- var buttonPosition = this.width - this.margin - this.titlebarHeight * 0.5;
- var buttonWidth = this.titlebarHeight - this.margin * 2;
- //create close button
- if (this.closeButton) {
- //test if id closeButton exists in defs section or create a new closeButton symbol
- var closeButtonSymbol = document.getElementById("closeButton");
- if (!closeButtonSymbol) {
- var closeButtonSymbol = document.createElementNS(svgNS,"symbol");
- closeButtonSymbol.setAttributeNS(null,"id","closeButton");
- closeButtonSymbol.setAttributeNS(null,"overflow","visible");
- //create background rect
- var buttonRect = document.createElementNS(svgNS,"rect");
- buttonRect.setAttributeNS(null,"x",(buttonWidth / 2 * -1));
- buttonRect.setAttributeNS(null,"y",(buttonWidth / 2 * -1));
- buttonRect.setAttributeNS(null,"width",buttonWidth);
- buttonRect.setAttributeNS(null,"height",buttonWidth);
- buttonRect.setAttributeNS(null,"fill",this.buttonStyles["fill"]);
- buttonRect.setAttributeNS(null,"pointer-events","fill");
- closeButtonSymbol.appendChild(buttonRect);
- var buttonLine = document.createElementNS(svgNS,"line");
- buttonLine.setAttributeNS(null,"x1",(buttonWidth / 2 * -1));
- buttonLine.setAttributeNS(null,"x2",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"y1",(buttonWidth / 2 * -1));
- buttonLine.setAttributeNS(null,"y2",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"stroke",this.buttonStyles["stroke"]);
- buttonLine.setAttributeNS(null,"stroke-width",this.buttonStyles["stroke-width"]);
- buttonLine.setAttributeNS(null,"pointer-events","none");
- closeButtonSymbol.appendChild(buttonLine);
- var buttonLine = document.createElementNS(svgNS,"line");
- buttonLine.setAttributeNS(null,"x1",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"x2",(buttonWidth / 2 * -1));
- buttonLine.setAttributeNS(null,"y1",(buttonWidth / 2 * -1));
- buttonLine.setAttributeNS(null,"y2",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"stroke",this.buttonStyles["stroke"]);
- buttonLine.setAttributeNS(null,"stroke-width",this.buttonStyles["stroke-width"]);
- buttonLine.setAttributeNS(null,"pointer-events","none");
- closeButtonSymbol.appendChild(buttonLine);
- defsSection.appendChild(closeButtonSymbol);
- }
- this.closeButtonInstance = document.createElementNS(svgNS,"use");
- this.closeButtonInstance.setAttributeNS(null,"x",buttonPosition);
- this.closeButtonInstance.setAttributeNS(null,"y",this.titlebarHeight * 0.5);
- this.closeButtonInstance.setAttributeNS(null,"cursor","pointer");
- this.closeButtonInstance.setAttributeNS(null,"id","closeButton"+this.id);
- this.closeButtonInstance.setAttributeNS(xlinkNS,"href","#closeButton");
- this.closeButtonInstance.addEventListener("click",this,false);
- this.windowTitlebarGroup.appendChild(this.closeButtonInstance);
- buttonPosition -= this.titlebarHeight;
- }
-
- //create maximize button
- if (this.maximizeButton) {
- //test if id maximizeButton exists in defs section or create a new maximizeButton symbol
- var maximizeButtonSymbol = document.getElementById("maximizeButton");
- if (!maximizeButtonSymbol) {
- var maximizeButtonSymbol = document.createElementNS(svgNS,"symbol");
- maximizeButtonSymbol.setAttributeNS(null,"id","maximizeButton");
- maximizeButtonSymbol.setAttributeNS(null,"overflow","visible");
- //create background rect
- var buttonRect = document.createElementNS(svgNS,"rect");
- buttonRect.setAttributeNS(null,"x",(buttonWidth / 2 * -1));
- buttonRect.setAttributeNS(null,"y",(buttonWidth / 2 * -1));
- buttonRect.setAttributeNS(null,"width",buttonWidth);
- buttonRect.setAttributeNS(null,"height",buttonWidth);
- for (var attrib in this.buttonStyles) {
- buttonRect.setAttributeNS(null,attrib,this.buttonStyles[attrib]);
- }
- buttonRect.setAttributeNS(null,"pointer-events","fill");
- maximizeButtonSymbol.appendChild(buttonRect);
- defsSection.appendChild(maximizeButtonSymbol);
- }
- this.maximizeButtonInstance = document.createElementNS(svgNS,"use");
- this.maximizeButtonInstance.setAttributeNS(null,"x",buttonPosition);
- this.maximizeButtonInstance.setAttributeNS(null,"y",this.titlebarHeight * 0.5);
- this.maximizeButtonInstance.setAttributeNS(null,"cursor","pointer");
- this.maximizeButtonInstance.setAttributeNS(null,"id","maximizeButton"+this.id);
- this.maximizeButtonInstance.setAttributeNS(xlinkNS,"href","#maximizeButton");
- this.maximizeButtonInstance.addEventListener("click",this,false);
- this.windowTitlebarGroup.appendChild(this.maximizeButtonInstance);
- buttonPosition -= this.titlebarHeight;
- }
-
- //create minimize button
- if (this.minimizeButton) {
- //test if id minimizeButton exists in defs section or create a new minimizeButton symbol
- var minimizeButtonSymbol = document.getElementById("minimizeButton");
- if (!minimizeButtonSymbol) {
- var minimizeButtonSymbol = document.createElementNS(svgNS,"symbol");
- minimizeButtonSymbol.setAttributeNS(null,"id","minimizeButton");
- minimizeButtonSymbol.setAttributeNS(null,"overflow","visible");
- //create background rect
- var buttonRect = document.createElementNS(svgNS,"rect");
- buttonRect.setAttributeNS(null,"x",(buttonWidth / 2 * -1));
- buttonRect.setAttributeNS(null,"y",(buttonWidth / 2 * -1));
- buttonRect.setAttributeNS(null,"width",buttonWidth);
- buttonRect.setAttributeNS(null,"height",buttonWidth);
- buttonRect.setAttributeNS(null,"fill",this.buttonStyles["fill"]);
- buttonRect.setAttributeNS(null,"pointer-events","fill");
- minimizeButtonSymbol.appendChild(buttonRect);
- //create line
- var buttonLine = document.createElementNS(svgNS,"line");
- buttonLine.setAttributeNS(null,"x1",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"x2",(buttonWidth / 2 * -1));
- buttonLine.setAttributeNS(null,"y1",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"y2",(buttonWidth / 2));
- buttonLine.setAttributeNS(null,"stroke",this.buttonStyles["stroke"]);
- buttonLine.setAttributeNS(null,"stroke-width",this.buttonStyles["stroke-width"]);
- minimizeButtonSymbol.appendChild(buttonLine);
- defsSection.appendChild(minimizeButtonSymbol);
- }
- this.minimizeButtonInstance = document.createElementNS(svgNS,"use");
- this.minimizeButtonInstance.setAttributeNS(null,"x",buttonPosition);
- this.minimizeButtonInstance.setAttributeNS(null,"y",this.titlebarHeight * 0.5);
- this.minimizeButtonInstance.setAttributeNS(null,"cursor","pointer");
- this.minimizeButtonInstance.setAttributeNS(null,"id","minimizeButton"+this.id);
- this.minimizeButtonInstance.setAttributeNS(xlinkNS,"href","#minimizeButton");
- this.minimizeButtonInstance.addEventListener("click",this,false);
- this.windowTitlebarGroup.appendChild(this.minimizeButtonInstance);
- buttonPosition -= this.titlebarHeight;
- }
-
- if (this.statusBarVisible) {
- this.statusbar = document.createElementNS(svgNS,"rect");
- this.statusbar.setAttributeNS(null,"y",(this.height - this.statusbarHeight));
- this.statusbar.setAttributeNS(null,"width",this.width);
- this.statusbar.setAttributeNS(null,"height",this.statusbarHeight);
- for (var attrib in this.statusbarStyles) {
- this.statusbar.setAttributeNS(null,attrib,this.statusbarStyles[attrib]);
- }
- this.windowMainGroup.appendChild(this.statusbar);
- this.statusTextElement = document.createElementNS(svgNS,"text");
- this.statusTextElement.setAttributeNS(null,"x",this.margin);
- this.statusTextElement.setAttributeNS(null,"y",this.height - (this.statusbarHeight - this.statustextStyles["font-size"]));
- var value = "";
- for (var attrib in this.statustextStyles) {
- value = this.statustextStyles[attrib];
- if (attrib == "font-size") {
- value += "px";
- }
- this.statusTextElement.setAttributeNS(null,attrib,value);
- }
- this.statusTextElement.setAttributeNS(null,"pointer-events","none");
- if (this.statusText.length > 0) {
- this.statusTextNode = document.createTextNode(this.statusText);
- }
- else {
- this.statusTextNode = document.createTextNode(" ");
- }
- this.statusTextElement.appendChild(this.statusTextNode);
- this.windowMainGroup.appendChild(this.statusTextElement);
- }
-
- //append titlebar group to window group
- this.windowGroup.appendChild(this.windowTitlebarGroup);
-
- //finally append group to windows group
- this.parentGroup.appendChild(this.windowGroup);
-
- //issue event that window was created
- this.timer.setTimeout("fireFunction",this.timerMs,"created");
- }
- else {
- alert("could not create or reference 'parentNode' of window with id '"+this.id+"'");
- }
-}
-
-//test if window group exists or create a new group at the end of the file
-Window.prototype.testParent = function() {
- //test if of type object
- var nodeValid = false;
- if (typeof(this.parentNode) == "object") {
- if (this.parentNode.nodeName == "svg" || this.parentNode.nodeName == "g") {
- this.parentGroup = this.parentNode;
- nodeValid = true;
- }
- }
- else if (typeof(this.parentNode) == "string") {
- //first test if Windows group exists
- if (!document.getElementById(this.parentNode)) {
- this.parentGroup = document.createElementNS(svgNS,"g");
- this.parentGroup.setAttributeNS(null,"id",this.parentNode);
- document.documentElement.appendChild(this.parentGroup);
- nodeValid = true;
- }
- else {
- this.parentGroup = document.getElementById(this.parentNode);
- nodeValid = true;
- }
- }
- return nodeValid;
-}
-
-//central mouse-event handling
-Window.prototype.handleEvent = function(evt) {
- if (evt.type == "click") {
- var elId = evt.currentTarget.getAttributeNS(null,"id");
- if (elId == "closeButton"+this.id) {
- this.close(true);
- }
- if (elId == "maximizeButton"+this.id) {
- this.maximize(true);
- }
- if (elId == "minimizeButton"+this.id) {
- this.minimize(true);
- }
- if (elId == "titleBar"+this.id || elId == "decoGroup"+this.id) {
- if (evt.detail == 2) {
- if (this.minimized) {
- this.maximize(true);
- }
- else {
- this.minimize(true);
- }
- }
- }
- }
- if (evt.type == "mousedown") {
- var elId = evt.currentTarget.getAttributeNS(null,"id");
- if (elId == "titleBar"+this.id || elId == "decoGroup"+this.id) {
- //put it to the front
- this.parentGroup.appendChild(this.windowGroup);
- if (this.moveable) {
- this.panStatus = 1;
- //var coords = myMapApp.calcCoord(evt,document.documentElement);
- var coords = myMapApp.calcCoord(evt,this.parentGroup);
- this.panCoords = coords;
- document.documentElement.addEventListener("mousemove",this,false);
- document.documentElement.addEventListener("mouseup",this,false);
- if (!this.showContent) {
- this.windowTitlebarGroup.setAttributeNS(null,"display","none");
- this.windowMainGroup.setAttributeNS(null,"display","none");
- if (this.minimized) {
- this.shadowTitleRect.setAttributeNS(null,"display","inherit");
- }
- else {
- this.shadowRect.setAttributeNS(null,"display","inherit");
- }
- }
- else {
- if (this.titleBarVisible) {
- this.titlebar.setAttributeNS(null,"cursor","move");
- }
- if (this.decorationGroup) {
- this.decorationGroup.setAttributeNS(null,"cursor","move");
- }
- }
- this.windowGroup.setAttributeNS(batikNS,"static","true");
- this.fireFunction("moveStart");
- }
- }
- }
- if (evt.type == "mousemove") {
- if (this.panStatus == 1) {
- //var coords = myMapApp.calcCoord(evt,document.documentElement);
- var coords = myMapApp.calcCoord(evt,this.parentGroup);
- if (coords.x < this.constrXmin || coords.x > this.constrXmax || coords.y < this.constrYmin || coords.y > this.constrYmax) {
- this.stopDrag();
- }
- else {
- this.transX += coords.x - this.panCoords.x;
- this.transY += coords.y - this.panCoords.y;
- //check constraints
- if (this.transX < this.constrXmin) {
- this.transX = this.constrXmin;
- }
- if (this.transY < this.constrYmin) {
- this.transY = this.constrYmin;
- }
- if ((this.transX + this.width) > (this.constrXmax)) {
- this.transX = this.constrXmax - this.width;
- }
- if (this.minimized) {
- if ((this.transY + this.titlebarHeight) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.titlebarHeight;
- }
- }
- else {
- if ((this.transY + this.height) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.height;
- }
- }
- this.windowGroup.setAttributeNS(null,"transform","translate("+this.transX+","+this.transY+")");
- this.panCoords = coords;
- this.timer.setTimeout("fireFunction",this.timerMs,"moved");
- }
- }
- }
- if (evt.type == "mouseup") {
- if (this.panStatus == 1) {
- this.stopDrag();
- }
- }
-}
-
-Window.prototype.fireFunction = function(evtType) {
- if (typeof(this.functionToCall) == "function") {
- this.functionToCall(this.id,evtType);
- }
- if (typeof(this.functionToCall) == "object") {
- this.functionToCall.windowStatusChanged(this.id,evtType);
- }
- if (typeof(this.functionToCall) == undefined) {
- return;
- }
-}
-
-//helper method to stop the dragging mode
-Window.prototype.stopDrag = function() {
- this.windowGroup.removeAttributeNS(batikNS,"static");
- document.documentElement.removeEventListener("mousemove",this,false);
- document.documentElement.removeEventListener("mouseup",this,false);
- if (!this.showContent) {
- this.windowTitlebarGroup.setAttributeNS(null,"display","inherit");
- if (this.minimized) {
- this.shadowTitleRect.setAttributeNS(null,"display","none");
- }
- else {
- this.shadowRect.setAttributeNS(null,"display","none");
- this.windowMainGroup.setAttributeNS(null,"display","inherit");
- }
- }
- else {
- if (this.titleBarVisible) {
- this.titlebar.setAttributeNS(null,"cursor","pointer");
- }
- if (this.decorationGroup) {
- this.decorationGroup.setAttributeNS(null,"cursor","pointer");
- }
- }
- this.timer.setTimeout("fireFunction",this.timerMs,"moveEnd");
- this.panStatus = 0;
-}
-
-//minimize a window
-Window.prototype.minimize = function(fireFunction) {
- this.windowMainGroup.setAttributeNS(null,"display","none");
- if (this.decorationGroupMinimized) {
- this.decorationGroupMinimized.setAttributeNS(null,"display","none");
- }
- this.minimized = true;
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,"minimized");
- }
-}
-
-//maximize a window
-Window.prototype.maximize = function(fireFunction) {
- this.windowMainGroup.setAttributeNS(null,"display","inherit");
- if (this.decorationGroupMinimized) {
- this.decorationGroupMinimized.setAttributeNS(null,"display","inherit");
- }
- if ((this.transY + this.height) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.height;
- this.windowGroup.setAttributeNS(null,"transform","translate("+this.transX+","+this.transY+")");
- }
- this.minimized = false;
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,"maximized");
- }
-}
-
-//open a closed window
-Window.prototype.close = function(fireFunction) {
- this.windowGroup.setAttributeNS(null,"display","none");
- this.closed = true;
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,"closed");
- }
-}
-
-//close window, after closing the window is still in its previous state and can be re-opened
-Window.prototype.open = function(fireFunction) {
- if (!this.removed) {
- this.windowGroup.setAttributeNS(null,"display","inherit");
- this.closed = false;
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,"opened");
- }
- }
- else {
- alert("window " + this.id + " is already removed");
- }
-}
-
-//resize window and reposition it into constrained coords
-Window.prototype.resize = function(width,height,fireFunction) {
- this.width = width;
- this.height = height;
- //adopt shadow rect
- this.shadowRect.setAttributeNS(null,"width",this.width);
- this.shadowRect.setAttributeNS(null,"height",this.height);
- this.shadowTitleRect.setAttributeNS(null,"width",this.width);
- //adopt background rect
- this.backgroundRect.setAttributeNS(null,"width",this.width);
- this.backgroundRect.setAttributeNS(null,"height",this.height);
- //adopt titlebar
- if (this.titleBarVisible) {
- this.titlebar.setAttributeNS(null,"width",this.width);
- }
- var buttonPosition = this.width - this.margin - this.titlebarHeight * 0.5;
- if (this.closeButton) {
- this.closeButtonInstance.setAttributeNS(null,"x",buttonPosition);
- buttonPosition -= this.titlebarHeight;
- }
- if (this.maximizeButton) {
- this.maximizeButtonInstance.setAttributeNS(null,"x",buttonPosition);
- buttonPosition -= this.titlebarHeight;
- }
- if (this.minimizeButton) {
- this.minimizeButtonInstance.setAttributeNS(null,"x",buttonPosition);
- }
- if (this.statusBarVisible) {
- this.statusbar.setAttributeNS(null,"y",(this.height - this.statusbarHeight));
- this.statusbar.setAttributeNS(null,"width",this.width);
- this.statusTextElement.setAttributeNS(null,"y",this.height - (this.statusbarHeight - this.statustextStyles["font-size"]));
- }
- //check constraints
- if (this.transX < this.constrXmin) {
- this.transX = this.constrXmin;
- }
- if (this.transY < this.constrYmin) {
- this.transY = this.constrYmin;
- }
- if ((this.transX + this.width) > (this.constrXmax)) {
- this.transX = this.constrXmax - this.width;
- }
- if (this.minimized) {
- if ((this.transY + this.titlebarHeight) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.titlebarHeight;
- }
- }
- else {
- if ((this.transY + this.height) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.height;
- }
- }
- this.windowGroup.setAttributeNS(null,"transform","translate("+this.transX+","+this.transY+")");
- if (fireFunction) {
- this.fireFunction("resized");
- }
-}
-
-//remove window
-Window.prototype.remove = function(fireFunction) {
- if (!this.removed) {
- this.windowGroup.parentGroup.removeChild(this.windowGroup);
- this.removed = true;
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,"removed");
- }
- }
-}
-
-//change content of statusBar
-Window.prototype.setStatusText = function(statusText) {
- if (this.statusBarVisible) {
- this.statusText = statusText;
- if (this.statusText.length > 0) {
- this.statusTextNode.nodeValue = this.statusText;
- }
- else {
- this.statusTextNode.nodeValue = " ";
- }
-
- }
- else {
- alert("there is no statusbar available");
- }
-}
-
-//change content of statusBar
-Window.prototype.setTitleText = function(titleText) {
- this.titleText = titleText;
- if (titleText.length > 0) {
- this.titleTextNode.nodeValue = titleText;
- }
- else {
- this.titleTextNode.nodeValue = " ";
- }
-}
-
-//move a window to a certain position (upper left corner)
-Window.prototype.moveTo = function(coordx,coordy,fireFunction) {
- this.transX = coordx;
- this.transY = coordy;
- //check constraints
- if (this.transX < this.constrXmin) {
- this.transX = this.constrXmin;
- }
- if (this.transY < this.constrYmin) {
- this.transY = this.constrYmin;
- }
- if ((this.transX + this.width) > (this.constrXmax)) {
- this.transX = this.constrXmax - this.width;
- }
- if (this.minimized) {
- if ((this.transY + this.titlebarHeight) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.titlebarHeight;
- }
- }
- else {
- if ((this.transY + this.height) > (this.constrYmax)) {
- this.transY = this.constrYmax - this.height;
- }
- }
- this.windowGroup.setAttributeNS(null,"transform","translate("+this.transX+","+this.transY+")");
- if (fireFunction) {
- this.timer.setTimeout("fireFunction",this.timerMs,"movedTo");
- }
-}
-
-//append new content to the window main group
-Window.prototype.appendContent = function(node,inheritDisplay) {
- if (typeof(node) == "string") {
- node = document.getElementById(node);
- }
- if (inheritDisplay) {
- node.setAttributeNS(null,"display","inherit");
- }
- this.windowContentGroup.appendChild(node);
-}
-
-//remove new content from the window main group
-Window.prototype.removeContent = function(node) {
- if (typeof(node) == "string") {
- node = document.getElementById(node);
- }
- this.windowContentGroup.removeChild(node);
-}
-
-//remove new content from the window main group
-Window.prototype.insertContentBefore = function(node,referenceNode,inheritDisplay) {
- if (typeof(node) == "string") {
- node = document.getElementById(node);
- }
- if (typeof(referenceNode) == "string") {
- referenceNode = document.getElementById(referenceNode);
- }
- if (inheritDisplay) {
- node.setAttributeNS(null,"display","inherit");
- }
- this.windowContentGroup.insertBefore(node,referenceNode);
-}
-
-//hide content of Window
-Window.prototype.hideContents = function() {
- this.windowContentGroup.setAttributeNS(null,"display","none");
-}
-
-//show content of Window
-Window.prototype.showContents = function() {
- this.windowContentGroup.setAttributeNS(null,"display","inherit");
-}
-
-//add window decoration
-Window.prototype.addWindowDecoration = function(node,mayTriggerMoving,topOrBottom) {
- if (typeof(node) == "string") {
- node = document.getElementById(node);
- }
- if (this.decorationGroup) {
- var parent = this.decorationGroup.parentNode;
- parent.removeChild(this.decorationGroup);
- }
- if (topOrBottom == "bottom") {
- this.decorationGroup = this.windowGroup.insertBefore(node,this.windowGroup.firstChild);
- }
- else if (topOrBottom == "top") {
- this.decorationGroup = this.windowTitlebarGroup.insertBefore(node,this.windowTitlebarGroup.firstChild);
- }
- else {
- alert("Error in window with id '"+this.id+"': you have to specify 'top' or 'bottom' for the variable 'topOrBottom'.");
- }
- if (mayTriggerMoving) {
- this.decorationGroup.setAttributeNS(null,"id","decoGroup"+this.id);
- this.decorationGroup.setAttributeNS(null,"cursor","pointer");
- this.decorationGroup.addEventListener("click",this,false);
- this.decorationGroup.addEventListener("mousedown",this,false);
- }
- //see if there is a sub group/element that should be hidden when minimized
- try {
- this.decorationGroupMinimized = document.getElementById("decoGroupMinimized"+this.id);
- if (this.minimized) {
- this.decorationGroupMinimized.setAttributeNS(null,"display","none");
- }
- }
- catch(er) {
- this.decorationGroupMinimized = null;
- }
-}
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/window-expected.checksum b/webkit/data/layout_tests/pending/svg/carto.net/window-expected.checksum
deleted file mode 100644
index a348e93..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/window-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-72a505e459db791e297dbb48920024cd \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/window-expected.png b/webkit/data/layout_tests/pending/svg/carto.net/window-expected.png
deleted file mode 100644
index 71180e2..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/window-expected.png
+++ /dev/null
Binary files differ
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/window-expected.txt b/webkit/data/layout_tests/pending/svg/carto.net/window-expected.txt
deleted file mode 100644
index 02fcfba..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/window-expected.txt
+++ /dev/null
@@ -1,278 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (-3906.25,-3879.69) size 11718.75x11718.75
- RenderSVGHiddenContainer {defs} at (0,0) size 0x0
- RenderPath {rect} at (-3906.25,-3879.69) size 11718.75x11718.75 [fill={[type=SOLID] [color=#D3D3D3]}] [data="M-5000.00,-5000.00L10000.00,-5000.00L10000.00,10000.00L-5000.00,10000.00"]
- RenderPath {rect} at (-3906.25,26.56) size 11718.75x62.50 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M-5000.00,0.00L10000.00,0.00L10000.00,80.00L-5000.00,80.00"]
- RenderPath {rect} at (-3906.25,-3879.69) size 3906.25x11718.75 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M-5000.00,-5000.00L0.00,-5000.00L0.00,10000.00L-5000.00,10000.00"]
- RenderPath {rect} at (800,-3879.69) size 3906.25x11718.75 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M1024.00,-5000.00L6024.00,-5000.00L6024.00,10000.00L1024.00,10000.00"]
- RenderPath {rect} at (-3906.25,573.44) size 11718.75x3906.25 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M-5000.00,700.00L10000.00,700.00L10000.00,5700.00L-5000.00,5700.00"]
- RenderSVGText {text} at (10,30) size 322x22 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-18) size 322x22
- chunk 1 text run 1 at (10.00,30.00) startOffset 0 endOffset 34 width 322.00: "Demonstration of the Window object"
- RenderSVGText {text} at (10,50) size 63x16 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 63x16
- chunk 1 text run 1 at (10.00,50.00) startOffset 0 endOffset 10 width 63.00: "Statustext"
- RenderSVGContainer {use} at (319.92,33.98) size 110.16x16.41
- RenderSVGContainer {g} at (319.92,33.98) size 110.16x16.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(480.00,20.00)}]
- RenderSVGViewportContainer {svg} at (319.92,33.98) size 110.16x16.41
- RenderPath {rect} at (319.92,33.98) size 110.16x16.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M-70.00,-10.00L70.00,-10.00L70.00,10.00L-70.00,10.00"]
- RenderSVGText {text} at (418,25) size 124x12 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-10) size 124x12
- chunk 1 (middle anchor) text run 1 at (418.50,25.00) startOffset 0 endOffset 23 width 123.00: "Close Navigation Window"
- RenderSVGContainer {use} at (437.11,33.98) size 110.16x16.41
- RenderSVGContainer {g} at (437.11,33.98) size 110.16x16.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(630.00,20.00)}]
- RenderSVGViewportContainer {svg} at (437.11,33.98) size 110.16x16.41
- RenderPath {rect} at (437.11,33.98) size 110.16x16.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M-70.00,-10.00L70.00,-10.00L70.00,10.00L-70.00,10.00"]
- RenderSVGText {text} at (586,25) size 88x12 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-10) size 88x12
- chunk 1 (middle anchor) text run 1 at (586.50,25.00) startOffset 0 endOffset 16 width 87.00: "Close Big Window"
- RenderSVGContainer {use} at (554.30,33.98) size 110.16x16.41
- RenderSVGContainer {g} at (554.30,33.98) size 110.16x16.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(780.00,20.00)}]
- RenderSVGViewportContainer {svg} at (554.30,33.98) size 110.16x16.41
- RenderPath {rect} at (554.30,33.98) size 110.16x16.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M-70.00,-10.00L70.00,-10.00L70.00,10.00L-70.00,10.00"]
- RenderSVGText {text} at (718,25) size 124x12 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-10) size 124x12
- chunk 1 (middle anchor) text run 1 at (718.50,25.00) startOffset 0 endOffset 23 width 123.00: "Close Middlesize Window"
- RenderSVGContainer {use} at (671.48,33.98) size 110.16x16.41
- RenderSVGContainer {g} at (671.48,33.98) size 110.16x16.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(930.00,20.00)}]
- RenderSVGViewportContainer {svg} at (671.48,33.98) size 110.16x16.41
- RenderPath {rect} at (671.48,33.98) size 110.16x16.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M-70.00,-10.00L70.00,-10.00L70.00,10.00L-70.00,10.00"]
- RenderSVGText {text} at (881,25) size 98x12 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-10) size 98x12
- chunk 1 (middle anchor) text run 1 at (881.50,25.00) startOffset 0 endOffset 19 width 97.00: "Close Colour Picker"
- RenderSVGContainer {use} at (671.48,57.42) size 110.16x16.41
- RenderSVGContainer {g} at (671.48,57.42) size 110.16x16.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(930.00,50.00)}]
- RenderSVGViewportContainer {svg} at (671.48,57.42) size 110.16x16.41
- RenderPath {rect} at (671.48,57.42) size 110.16x16.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M-70.00,-10.00L70.00,-10.00L70.00,10.00L-70.00,10.00"]
- RenderSVGText {text} at (881,55) size 98x12 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-10) size 98x12
- chunk 1 (middle anchor) text run 1 at (881.00,55.00) startOffset 0 endOffset 18 width 98.00: "Close Small Window"
- RenderSVGContainer {use} at (319.92,57.42) size 110.16x16.41
- RenderSVGContainer {g} at (319.92,57.42) size 110.16x16.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(480.00,50.00)}]
- RenderSVGViewportContainer {svg} at (319.92,57.42) size 110.16x16.41
- RenderPath {rect} at (319.92,57.42) size 110.16x16.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M-70.00,-10.00L70.00,-10.00L70.00,10.00L-70.00,10.00"]
- RenderSVGText {text} at (415,55) size 130x12 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-10) size 130x12
- chunk 1 (middle anchor) text run 1 at (415.50,55.00) startOffset 0 endOffset 24 width 129.00: "Resize Navigation Window"
- RenderSVGContainer {g} at (38.67,81.25) size 758.98x453.52
- RenderSVGContainer {g} at (613.28,81.25) size 184.38x168.36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(800.00,85.00)}]
- RenderSVGContainer {g} at (624.61,92.58) size 172.66x157.03
- RenderPath {rect} at (624.61,92.58) size 172.66x157.03 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L220.00,0.00L220.00,200.00L0.00,200.00"]
- RenderSVGContainer {g} at (632.81,102.34) size 161.72x96.88
- RenderSVGText {text} at (10,25) size 207x124 contains 7 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 124x16
- chunk 1 text run 1 at (10.00,25.00) startOffset 0 endOffset 18 width 124.00: "This window should"
- RenderSVGTSpan {tspan} at (0,0) size 149x16
- RenderSVGInlineText {#text} at (0,3) size 149x16
- chunk 2 text run 1 at (10.00,41.00) startOffset 0 endOffset 24 width 149.00: "contain navigation tools"
- RenderSVGTSpan {tspan} at (0,0) size 94x16
- RenderSVGInlineText {#text} at (0,25) size 94x16
- chunk 3 text run 1 at (10.00,63.00) startOffset 0 endOffset 15 width 94.00: "Click on button"
- RenderSVGTSpan {tspan} at (0,0) size 207x16
- RenderSVGInlineText {#text} at (0,41) size 207x16
- chunk 4 text run 1 at (10.00,79.00) startOffset 0 endOffset 32 width 207.00: "'Resize Navigation Window' for a"
- RenderSVGTSpan {tspan} at (0,0) size 187x16
- RenderSVGInlineText {#text} at (0,57) size 187x16
- chunk 5 text run 1 at (10.00,95.00) startOffset 0 endOffset 28 width 187.00: "random resize of this Window"
- RenderSVGTSpan {tspan} at (0,0) size 165x16
- RenderSVGInlineText {#text} at (0,79) size 165x16
- chunk 6 text run 1 at (10.00,117.00) startOffset 0 endOffset 26 width 165.00: "Note that this window also"
- RenderSVGTSpan {tspan} at (0,0) size 186x16
- RenderSVGInlineText {#text} at (0,95) size 186x16
- chunk 7 text run 1 at (10.00,133.00) startOffset 0 endOffset 28 width 186.00: "features a window decoration"
- RenderPath {rect} at (624.61,238.67) size 172.66x10.94 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,187.00L220.00,187.00L220.00,200.00L0.00,200.00"]
- RenderSVGText {text} at (3,197) size 45x11 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-9) size 45x11
- chunk 1 text run 1 at (3.00,197.00) startOffset 0 endOffset 9 width 45.00: "Statusbar"
- RenderSVGContainer {g} at (613.28,81.25) size 184.38x157.81
- RenderSVGContainer {g} at (613.28,81.25) size 184.38x157.81
- RenderPath {rect} at (613.28,81.25) size 15.63x157.81 [fill={[type=SOLID] [color=#B0C4DE]}] [data="M-15.00,-15.00L5.00,-15.00L5.00,187.00L-15.00,187.00"]
- RenderPath {rect} at (613.28,81.25) size 184.38x15.63 [fill={[type=SOLID] [color=#B0C4DE]}] [data="M-15.00,-15.00L221.00,-15.00L221.00,5.00L-15.00,5.00"]
- RenderSVGText {text} at (0,180) size 106x14 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-11) size 106x14
- chunk 1 text run 1 at (0.00,180.00) startOffset 0 endOffset 17 width 106.00: "Navigation Window"
- RenderSVGContainer {use} at (616.52,84.49) size 9.15x9.15
- RenderSVGContainer {g} at (616.52,84.49) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-5.00,-5.00)}]
- RenderSVGViewportContainer {svg} at (616.52,84.49) size 9.15x9.15
- RenderPath {rect} at (616.80,84.77) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (616.52,84.49) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
- RenderPath {line} at (616.52,84.49) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (616.41,100) size 9.38x9.38
- RenderSVGContainer {g} at (616.41,100) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-5.00,15.00)}]
- RenderSVGViewportContainer {svg} at (616.41,100) size 9.38x9.38
- RenderPath {rect} at (616.41,100) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (616.80,116.02) size 8.59x8.98
- RenderSVGContainer {g} at (616.80,116.02) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-5.00,35.00)}]
- RenderSVGViewportContainer {svg} at (616.80,116.02) size 8.59x8.98
- RenderPath {rect} at (616.80,116.02) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (616.80,124.22) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {g} at (38.67,143.36) size 547.66x391.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,150.00)}]
- RenderSVGContainer {g} at (38.67,143.36) size 547.66x391.41
- RenderPath {rect} at (38.67,143.36) size 547.66x391.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L700.00,0.00L700.00,500.00L0.00,500.00"]
- RenderSVGContainer {g} at (39.06,143.75) size 0x0
- RenderPath {rect} at (38.67,523.83) size 547.66x10.94 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,487.00L700.00,487.00L700.00,500.00L0.00,500.00"]
- RenderSVGText {text} at (3,497) size 134x11 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-9) size 134x11
- chunk 1 text run 1 at (3.00,497.00) startOffset 0 endOffset 28 width 134.00: "This is a big movable window"
- RenderSVGContainer {g} at (77.73,182.42) size 313.28x235.16 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,50.00)}]
- RenderSVGContainer {g} at (77.73,182.42) size 313.28x235.16
- RenderPath {rect} at (77.73,182.42) size 313.28x235.16 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L400.00,0.00L400.00,300.00L0.00,300.00"]
- RenderSVGContainer {g} at (78.13,182.81) size 0x0
- RenderPath {rect} at (77.73,406.64) size 313.28x10.94 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,287.00L400.00,287.00L400.00,300.00L0.00,300.00"]
- RenderSVGText {text} at (3,297) size 167x11 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-9) size 167x11
- chunk 1 text run 1 at (3.00,297.00) startOffset 0 endOffset 34 width 167.00: "This window contains other windows"
- RenderSVGContainer {g} at (77.73,195.70) size 172.66x141.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,17.00)}]
- RenderSVGContainer {g} at (77.73,195.70) size 172.66x141.41
- RenderPath {rect} at (77.73,195.70) size 172.66x141.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L220.00,0.00L220.00,180.00L0.00,180.00"]
- RenderSVGContainer {g} at (78.13,196.09) size 0x0
- RenderPath {rect} at (77.73,326.17) size 172.66x10.94 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,167.00L220.00,167.00L220.00,180.00L0.00,180.00"]
- RenderSVGText {text} at (3,177) size 186x11 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-9) size 186x11
- chunk 1 text run 1 at (3.00,177.00) startOffset 0 endOffset 36 width 186.00: "Changing a colour changes background"
- RenderSVGContainer {g} at (77.73,195.70) size 172.66x14.06
- RenderPath {rect} at (77.73,195.70) size 172.66x14.06 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M0.00,0.00L220.00,0.00L220.00,17.00L0.00,17.00"]
- RenderSVGText {text} at (3,14) size 85x16 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 85x16
- chunk 1 text run 1 at (3.00,14.00) startOffset 0 endOffset 13 width 85.00: "Colour Picker"
- RenderSVGContainer {use} at (236.44,198.16) size 9.15x9.15
- RenderSVGContainer {g} at (236.44,198.16) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(208.50,8.50)}]
- RenderSVGViewportContainer {svg} at (236.44,198.16) size 9.15x9.15
- RenderPath {rect} at (236.72,198.44) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (236.44,198.16) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
- RenderPath {line} at (236.44,198.16) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (223.05,198.05) size 9.38x9.38
- RenderSVGContainer {g} at (223.05,198.05) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(191.50,8.50)}]
- RenderSVGViewportContainer {svg} at (223.05,198.05) size 9.38x9.38
- RenderPath {rect} at (223.05,198.05) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (210.16,198.44) size 8.59x8.98
- RenderSVGContainer {g} at (210.16,198.44) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(174.50,8.50)}]
- RenderSVGViewportContainer {svg} at (210.16,198.44) size 8.59x8.98
- RenderPath {rect} at (210.16,198.44) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (210.16,206.64) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {g} at (249.61,344.14) size 141.41x63.28 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,207.00)}]
- RenderSVGContainer {g} at (249.61,344.14) size 141.41x63.28
- RenderPath {rect} at (249.61,344.14) size 141.41x63.28 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L180.00,0.00L180.00,80.00L0.00,80.00"]
- RenderSVGContainer {g} at (257.81,365.63) size 121.88x37.50
- RenderSVGText {text} at (10,40) size 156x48 contains 3 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 156x16
- chunk 1 text run 1 at (10.00,40.00) startOffset 0 endOffset 23 width 156.00: "This is a none-moveable"
- RenderSVGTSpan {tspan} at (0,0) size 139x16
- RenderSVGInlineText {#text} at (0,3) size 139x16
- chunk 2 text run 1 at (10.00,56.00) startOffset 0 endOffset 21 width 139.00: "none-closeable status"
- RenderSVGTSpan {tspan} at (0,0) size 47x16
- RenderSVGInlineText {#text} at (0,19) size 47x16
- chunk 3 text run 1 at (10.00,72.00) startOffset 0 endOffset 6 width 47.00: "window"
- RenderSVGContainer {g} at (249.61,344.14) size 141.41x14.06
- RenderPath {rect} at (249.61,344.14) size 141.41x14.06 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M0.00,0.00L180.00,0.00L180.00,17.00L0.00,17.00"]
- RenderSVGText {text} at (3,14) size 94x16 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 94x16
- chunk 1 text run 1 at (3.00,14.00) startOffset 0 endOffset 13 width 94.00: "Status Window"
- RenderSVGContainer {use} at (376.95,346.48) size 9.38x9.38
- RenderSVGContainer {g} at (376.95,346.48) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(168.50,8.50)}]
- RenderSVGViewportContainer {svg} at (376.95,346.48) size 9.38x9.38
- RenderPath {rect} at (376.95,346.48) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (364.06,346.88) size 8.59x8.98
- RenderSVGContainer {g} at (364.06,346.88) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(151.50,8.50)}]
- RenderSVGViewportContainer {svg} at (364.06,346.88) size 8.59x8.98
- RenderPath {rect} at (364.06,346.88) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (364.06,355.08) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {g} at (77.73,182.42) size 313.28x14.06
- RenderPath {rect} at (77.73,182.42) size 313.28x14.06 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M0.00,0.00L400.00,0.00L400.00,17.00L0.00,17.00"]
- RenderSVGText {text} at (3,14) size 170x16 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 170x16
- chunk 1 text run 1 at (3.00,14.00) startOffset 0 endOffset 24 width 170.00: "Nested middlesize Window"
- RenderSVGContainer {use} at (377.07,184.88) size 9.15x9.15
- RenderSVGContainer {g} at (377.07,184.88) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(388.50,8.50)}]
- RenderSVGViewportContainer {svg} at (377.07,184.88) size 9.15x9.15
- RenderPath {rect} at (377.34,185.16) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (377.07,184.88) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
- RenderPath {line} at (377.07,184.88) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (363.67,184.77) size 9.38x9.38
- RenderSVGContainer {g} at (363.67,184.77) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(371.50,8.50)}]
- RenderSVGViewportContainer {svg} at (363.67,184.77) size 9.38x9.38
- RenderPath {rect} at (363.67,184.77) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (350.78,185.16) size 8.59x8.98
- RenderSVGContainer {g} at (350.78,185.16) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(354.50,8.50)}]
- RenderSVGViewportContainer {svg} at (350.78,185.16) size 8.59x8.98
- RenderPath {rect} at (350.78,185.16) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (350.78,193.36) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {g} at (312.11,377.73) size 157.03x141.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(350.00,300.00)}]
- RenderSVGContainer {g} at (312.11,377.73) size 157.03x141.41
- RenderPath {rect} at (312.11,377.73) size 157.03x141.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L200.00,0.00L200.00,180.00L0.00,180.00"]
- RenderSVGContainer {g} at (320.31,399.22) size 137.50x62.50
- RenderSVGText {text} at (10,40) size 176x80 contains 5 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 172x16
- chunk 1 text run 1 at (10.00,40.00) startOffset 0 endOffset 26 width 172.00: "This window has a callback"
- RenderSVGTSpan {tspan} at (0,0) size 161x16
- RenderSVGInlineText {#text} at (0,3) size 161x16
- chunk 2 text run 1 at (10.00,56.00) startOffset 0 endOffset 25 width 161.00: "function indicating mouse"
- RenderSVGTSpan {tspan} at (0,0) size 176x16
- RenderSVGInlineText {#text} at (0,19) size 176x16
- chunk 3 text run 1 at (10.00,72.00) startOffset 0 endOffset 26 width 176.00: "movements in the statusbar"
- RenderSVGTSpan {tspan} at (0,0) size 126x16
- RenderSVGInlineText {#text} at (0,35) size 126x16
- chunk 4 text run 1 at (10.00,88.00) startOffset 0 endOffset 19 width 126.00: "and alerting window"
- RenderSVGTSpan {tspan} at (0,0) size 42x16
- RenderSVGInlineText {#text} at (0,51) size 42x16
- chunk 5 text run 1 at (10.00,104.00) startOffset 0 endOffset 6 width 42.00: "events"
- RenderPath {rect} at (312.11,508.20) size 157.03x10.94 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,167.00L200.00,167.00L200.00,180.00L0.00,180.00"]
- RenderSVGText {text} at (3,177) size 119x11 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-9) size 119x11
- chunk 1 text run 1 at (3.00,177.00) startOffset 0 endOffset 27 width 119.00: "Callback function is active"
- RenderSVGContainer {g} at (312.11,377.73) size 157.03x14.06
- RenderPath {rect} at (312.11,377.73) size 157.03x14.06 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M0.00,0.00L200.00,0.00L200.00,17.00L0.00,17.00"]
- RenderSVGText {text} at (3,14) size 89x16 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 89x16
- chunk 1 text run 1 at (3.00,14.00) startOffset 0 endOffset 12 width 89.00: "Small Window"
- RenderSVGContainer {use} at (455.19,380.19) size 9.15x9.15
- RenderSVGContainer {g} at (455.19,380.19) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(188.50,8.50)}]
- RenderSVGViewportContainer {svg} at (455.19,380.19) size 9.15x9.15
- RenderPath {rect} at (455.47,380.47) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (455.19,380.19) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
- RenderPath {line} at (455.19,380.19) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (441.80,380.08) size 9.38x9.38
- RenderSVGContainer {g} at (441.80,380.08) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(171.50,8.50)}]
- RenderSVGViewportContainer {svg} at (441.80,380.08) size 9.38x9.38
- RenderPath {rect} at (441.80,380.08) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (428.91,380.47) size 8.59x8.98
- RenderSVGContainer {g} at (428.91,380.47) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(154.50,8.50)}]
- RenderSVGViewportContainer {svg} at (428.91,380.47) size 8.59x8.98
- RenderPath {rect} at (428.91,380.47) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (428.91,388.67) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {g} at (39.45,476.17) size 117.97x47.66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(1.00,426.00)}]
- RenderSVGContainer {g} at (39.45,476.17) size 117.97x47.66
- RenderPath {rect} at (39.45,476.17) size 117.97x47.66 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L150.00,0.00L150.00,60.00L0.00,60.00"]
- RenderSVGContainer {g} at (43.75,480.47) size 112.50x35.94
- RenderSVGText {text} at (5,16) size 144x46 contains 3 chunk(s)
- RenderSVGInlineText {#text} at (0,-11) size 136x14
- chunk 1 text run 1 at (5.00,16.00) startOffset 0 endOffset 24 width 136.00: "This is a minimal window"
- RenderSVGTSpan {tspan} at (0,0) size 144x14
- RenderSVGInlineText {#text} at (0,5) size 144x14
- chunk 2 text run 1 at (5.00,32.00) startOffset 0 endOffset 29 width 144.00: "without title and status bar."
- RenderSVGTSpan {tspan} at (0,0) size 121x14
- RenderSVGInlineText {#text} at (0,21) size 121x14
- chunk 3 text run 1 at (5.00,48.00) startOffset 0 endOffset 23 width 121.00: "it is also not moveable"
- RenderSVGContainer {g} at (39.84,476.56) size 0x0
- RenderSVGContainer {g} at (38.67,143.36) size 547.66x14.06
- RenderPath {rect} at (38.67,143.36) size 547.66x14.06 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M0.00,0.00L700.00,0.00L700.00,17.00L0.00,17.00"]
- RenderSVGText {text} at (3,14) size 74x16 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,-13) size 74x16
- chunk 1 text run 1 at (3.00,14.00) startOffset 0 endOffset 10 width 74.00: "Big Window"
- RenderSVGContainer {use} at (572.38,145.82) size 9.15x9.15
- RenderSVGContainer {g} at (572.38,145.82) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(688.50,8.50)}]
- RenderSVGViewportContainer {svg} at (572.38,145.82) size 9.15x9.15
- RenderPath {rect} at (572.66,146.09) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (572.38,145.82) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
- RenderPath {line} at (572.38,145.82) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (558.98,145.70) size 9.38x9.38
- RenderSVGContainer {g} at (558.98,145.70) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(671.50,8.50)}]
- RenderSVGViewportContainer {svg} at (558.98,145.70) size 9.38x9.38
- RenderPath {rect} at (558.98,145.70) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderSVGContainer {use} at (546.09,146.09) size 8.59x8.98
- RenderSVGContainer {g} at (546.09,146.09) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(654.50,8.50)}]
- RenderSVGViewportContainer {svg} at (546.09,146.09) size 8.59x8.98
- RenderPath {rect} at (546.09,146.09) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
- RenderPath {line} at (546.09,154.30) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"] \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/svg/carto.net/window.svg b/webkit/data/layout_tests/pending/svg/carto.net/window.svg
deleted file mode 100644
index 8e0923e..0000000
--- a/webkit/data/layout_tests/pending/svg/carto.net/window.svg
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ATTLIST svg
- xmlns:attrib CDATA #IMPLIED
- xmlns:batik CDATA #IMPLIED
- >
- <!ATTLIST text
- attrib:buttonText CDATA #IMPLIED
- >
-]>
-<?AdobeSVGViewer save="snapshot"?>
-<svg width="100%" height="100%" viewBox="0 0 1024 700" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:attrib="http://www.carto.net/attrib" xmlns:batik="http://xml.apache.org/batik/ext" onload="init(evt)">
- <script type="text/ecmascript" xlink:href="resources/helper_functions.js"/>
- <script type="text/ecmascript" xlink:href="resources/mapApp.js"/>
- <script type="text/ecmascript" xlink:href="resources/timer.js"/>
- <script type="text/ecmascript" xlink:href="resources/window.js"/>
- <script type="text/ecmascript"><![CDATA[
- // Do not terminate before all create functions have been called.
- if (window.layoutTestController)
- layoutTestController.waitUntilDone();
-
- var numberOfWindows = 7;
- var createCalls = 0;
-
- function createCalled() {
- if (++createCalls == numberOfWindows && window.layoutTestController)
- layoutTestController.notifyDone();
- }
-
- //global variables for map application and navigation
- var myMapApp = new mapApp(false,undefined);
- function init(evt) {
- //start a new window array in myMapApp
- myMapApp.Windows = new Array();
- //first a few styles
- var winPlaceholderStyles = {"fill":"none","stroke":"dimgray","stroke-width":1.5};
- var windowStyles = {"fill":"aliceblue","stroke":"dimgray","stroke-width":1};
- var titlebarStyles = {"fill":"gainsboro","stroke":"dimgray","stroke-width":1};
- var statusbarStyles = {"fill":"aliceblue","stroke":"dimgray","stroke-width":1};
- var titletextStyles = {"font-family":"Arial,Helvetica","font-size":14,"fill":"dimgray"};
- var statustextStyles = {"font-family":"Arial,Helvetica","font-size":10,"fill":"dimgray"};
- var buttonStyles = {"fill":"none","stroke":"dimgray","stroke-width":1};
- var titlebarHeight = 17;
- var statusbarHeight = 13;
- //create new window instance and add it to the Windows array with the windowId as a key
- myMapApp.Windows["navWindow"] = new Window("navWindow","Windows",220,200,800,85,true,0,80,1024,700,true,winPlaceholderStyles,windowStyles,3,false,true,"Navigation Window","Statusbar",true,true,true,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,buttonTextChange);
- myMapApp.Windows["bigWindow"] = new Window("bigWindow","Windows",700,500,50,150,true,0,80,1024,700,false,winPlaceholderStyles,windowStyles,3,true,true,"Big Window","This is a big movable window",true,true,true,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,buttonTextChange);
- myMapApp.Windows["nestedWindow"] = new Window("nestedWindow","windowMainGroupbigWindow",400,300,50,50,true,0,17,700,487,false,winPlaceholderStyles,windowStyles,3,true,true,"Nested middlesize Window","This window contains other windows",true,true,true,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,buttonTextChange);
- myMapApp.Windows["smallWindow"] = new Window("smallWindow","windowMainGroupbigWindow",200,180,350,300,true,0,17,700,487,true,winPlaceholderStyles,windowStyles,3,true,true,"Small Window","Callback function is active",true,true,true,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,windowEvents);
- myMapApp.Windows["colourPickerWindow"] = new Window("colourPickerWindow","windowMainGroupnestedWindow",220,180,0,17,true,0,17,400,287,true,winPlaceholderStyles,windowStyles,3,true,true,"Colour Picker","Changing a colour changes background",true,true,true,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,buttonTextChange);
- myMapApp.Windows["statusWindow"] = new Window("statusWindow","windowMainGroupnestedWindow",180,80,220,207,false,0,17,400,287,true,winPlaceholderStyles,windowStyles,3,true,false,"Status Window","This window is non-moveable",false,true,true,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,createCalled);
- myMapApp.Windows["minimalWindow"] = new Window("minimalWindow","windowMainGroupbigWindow",150,60,1,426,false,0,0,700,500,true,winPlaceholderStyles,windowStyles,3,false,false,"","",false,false,false,titlebarStyles,titlebarHeight,statusbarStyles,statusbarHeight,titletextStyles,statustextStyles,buttonStyles,createCalled);
- myMapApp.Windows["navWindow"].appendContent("textNavWindow",true);
- myMapApp.Windows["statusWindow"].appendContent("textStatusWindow",true);
- myMapApp.Windows["smallWindow"].appendContent("textSmallWindow",true);
- myMapApp.Windows["minimalWindow"].appendContent("textMinimalWindow",true);
- }
-
- function windowEvents(id,evtType) {
- if (evtType == "removed") {
- alert("window with id " + id + " was removed");
- }
- if (evtType == "closed") {
- buttonTextChange(id,evtType);
- alert("window with id " + id + " was closed");
- }
- if (evtType == "opened") {
- buttonTextChange(id,evtType);
- alert("window with id " + id + " was opened");
- }
- if (evtType == "minimized") {
- alert("window with id " + id + " was minimized");
- }
- if (evtType == "maximized") {
- alert("window with id " + id + " was maximized");
- }
- if (evtType == "movedTo") {
- alert("window with id " + id + " was moved to a new position");
- }
- if (evtType == "moved") {
- statusChange("window with id " + id + " was moved to "+Math.round(myMapApp.Windows[id].transX) + ", " + Math.round(myMapApp.Windows[id].transY));
- }
- if (evtType == "moveStart") {
- statusChange("window with id " + id + " just started movement");
- }
- if (evtType == "moveEnd") {
- statusChange("window with id " + id + " just stopped movement");
- }
- if (evtType == "created") {
- createCalled();
- }
- }
- function openCloseWindow(id) {
- if (myMapApp.Windows[id].closed) {
- myMapApp.Windows[id].open(true);
- }
- else {
- myMapApp.Windows[id].close(true);
- }
- }
- function buttonTextChange(id,status) {
- if (status == "closed" || status == "opened") {
- var buttonText = document.getElementById("buttonText"+id);
- butText = buttonText.getAttributeNS(attribNS,"buttonText");
- if (myMapApp.Windows[id].closed) {
- buttonText.firstChild.nodeValue = "Open " + butText;
- }
- else {
- buttonText.firstChild.nodeValue = "Close " + butText;
- }
- }
- if (id == "navWindow") {
- if (status == "created" || status == "resized") {
- addOrUpdateWindowDecoration(id);
- }
- }
- if (status == "created") {
- createCalled();
- }
- }
- function resizeNavWindow() {
- var width = 220 + Math.round(Math.random() * 100);
- var height = 220 + Math.round(Math.random() * 100);
- myMapApp.Windows["navWindow"].resize(width,height,true);
- }
- function addOrUpdateWindowDecoration(id) {
- var myWindow = myMapApp.Windows[id];
- var group = document.createElementNS(svgNS,"g");
- var rect1 = document.createElementNS(svgNS,"rect");
- rect1.setAttributeNS(null,"x",-15);
- rect1.setAttributeNS(null,"y",-15);
- rect1.setAttributeNS(null,"width",20);
- rect1.setAttributeNS(null,"height",(myWindow.height+2));
- rect1.setAttributeNS(null,"fill","lightsteelblue");
- rect1.setAttributeNS(null,"stroke","none");
- group.appendChild(rect1);
- var rect2 = document.createElementNS(svgNS,"rect");
- rect2.setAttributeNS(null,"x",-15);
- rect2.setAttributeNS(null,"y",-15);
- rect2.setAttributeNS(null,"width",(myWindow.width + 16));
- rect2.setAttributeNS(null,"height",20);
- rect2.setAttributeNS(null,"fill","lightsteelblue");
- rect2.setAttributeNS(null,"stroke","none");
- rect2.setAttributeNS(null,"id","decoGroupMinimized"+myWindow.id);
- group.appendChild(rect2);
- var text = document.createElementNS(svgNS,"text");
- text.setAttributeNS(null,"x",0);
- text.setAttributeNS(null,"y",myWindow.height-20);
- text.setAttributeNS(null,"font-family","Arial,Helvetica");
- text.setAttributeNS(null,"font-size",12);
- text.setAttributeNS(null,"fill","dimgray");
- text.setAttributeNS(null,"transform","rotate(-90,0,"+(myWindow.height-20)+")");
- text.setAttributeNS(null,"pointer-events","none");
- var textNode = document.createTextNode(myWindow.titleText);
- text.appendChild(textNode);
- group.appendChild(text);
- //move buttons
- var x = -5;
- var curY = -5;
- if (myWindow.closeButton) {
- myWindow.closeButtonInstance.setAttributeNS(null,"x",x);
- myWindow.closeButtonInstance.setAttributeNS(null,"y",curY);
- curY += 20;
- }
- if (myWindow.maximizeButton) {
- myWindow.maximizeButtonInstance.setAttributeNS(null,"x",x);
- myWindow.maximizeButtonInstance.setAttributeNS(null,"y",curY);
- curY += 20;
- }
- if (myWindow.minimizeButton) {
- myWindow.minimizeButtonInstance.setAttributeNS(null,"x",x);
- myWindow.minimizeButtonInstance.setAttributeNS(null,"y",curY);
- }
- myWindow.addWindowDecoration(group,true,"top");
- }
- ]]></script>
- <defs>
- <!-- this symbol is used for the primitive button widgets -->
- <symbol id="buttonRect" overflow="visible">
- <rect x="-70" y="-10" width="140" height="20" fill="gainsboro" stroke="dimgray" stroke-width="1" />
- </symbol>
- </defs>
- <rect id="background" fill="lightgray" stroke="none" x="-5000" y="-5000" width="15000" height="15000" />
- <rect id="titlerect" fill="white" stroke="none" x="-5000" y="0" width="15000" height="80" />
- <!-- rects for indicating boundaries -->
- <rect fill="white" stroke="none" x="-5000" y="-5000" width="5000" height="15000" />
- <rect fill="white" stroke="none" x="1024" y="-5000" width="5000" height="15000" />
- <rect fill="white" stroke="none" x="-5000" y="700" width="15000" height="5000" />
- <text id="titleText" font-family="Arial,Helvetica" fill="dimgray" font-size="20px" x="10" y="30">Demonstration of the Window object</text>
- <text id="statusText" font-family="Arial,Helvetica" fill="dimgray" font-size="14px" x="10" y="50">Statustext</text>
- <text id="textNavWindow" x="10" y="25" font-family="Arial,Helvetica" fill="dimgray" font-size="14px" pointer-events="none" display="none">This window should<tspan x="10" dy="16">contain navigation tools</tspan><tspan x="10" dy="22">Click on button</tspan><tspan x="10" dy="16">'Resize Navigation Window' for a</tspan><tspan x="10" dy="16">random resize of this Window</tspan><tspan x="10" dy="22">Note that this window also</tspan><tspan x="10" dy="16">features a window decoration</tspan></text>
- <text id="textStatusWindow" x="10" y="40" font-family="Arial,Helvetica" fill="dimgray" font-size="14px" pointer-events="none" display="none">This is a none-moveable<tspan x="10" dy="16">none-closeable status</tspan><tspan x="10" dy="16">window</tspan></text>
- <text id="textSmallWindow" x="10" y="40" font-family="Arial,Helvetica" fill="dimgray" font-size="14px" pointer-events="none" display="none">This window has a callback<tspan x="10" dy="16">function indicating mouse</tspan><tspan x="10" dy="16">movements in the statusbar</tspan><tspan x="10" dy="16">and alerting window</tspan><tspan x="10" dy="16">events</tspan></text>
- <text id="textMinimalWindow" x="5" y="16" font-family="Arial,Helvetica" fill="dimgray" font-size="12px" pointer-events="none" display="none">This is a minimal window<tspan x="5" dy="16">without title and status bar.</tspan><tspan x="5" dy="16">it is also not moveable</tspan></text>
- <!-- primitive buttons for opening and closing windows -->
- <use x="480" y="20" xlink:href="#buttonRect" onclick="openCloseWindow('navWindow')"/>
- <text id="buttonTextnavWindow" font-family="Arial,Helvetica" fill="dimgray" text-anchor="middle" font-size="11px" attrib:buttonText="Navigation Window" x="480" y="25" pointer-events="none">Close Navigation Window</text>
- <use x="630" y="20" xlink:href="#buttonRect" onclick="openCloseWindow('bigWindow')"/>
- <text id="buttonTextbigWindow" font-family="Arial,Helvetica" fill="dimgray" text-anchor="middle" font-size="11px" attrib:buttonText="Big Window" x="630" y="25" pointer-events="none">Close Big Window</text>
- <use x="780" y="20" xlink:href="#buttonRect" onclick="openCloseWindow('nestedWindow')"/>
- <text id="buttonTextnestedWindow" font-family="Arial,Helvetica" fill="dimgray" text-anchor="middle" font-size="11px" attrib:buttonText="Middlesize Window" x="780" y="25" pointer-events="none">Close Middlesize Window</text>
- <use x="930" y="20" xlink:href="#buttonRect" onclick="openCloseWindow('colourPickerWindow')"/>
- <text id="buttonTextcolourPickerWindow" font-family="Arial,Helvetica" fill="dimgray" text-anchor="middle" font-size="11px" attrib:buttonText="Colour Picker" x="930" y="25" pointer-events="none">Close Colour Picker</text>
- <use x="930" y="50" xlink:href="#buttonRect" onclick="openCloseWindow('smallWindow')"/>
- <text id="buttonTextsmallWindow" font-family="Arial,Helvetica" fill="dimgray" text-anchor="middle" font-size="11px" attrib:buttonText="Small Window" x="930" y="55" pointer-events="none">Close Small Window</text>
- <use x="480" y="50" xlink:href="#buttonRect" onclick="resizeNavWindow()"/>
- <text id="buttonTextResizeNavWindow" font-family="Arial,Helvetica" fill="dimgray" text-anchor="middle" font-size="11px" attrib:buttonText="Resize Navigation Window" x="480" y="55" pointer-events="none">Resize Navigation Window</text>
-</svg>