From 95d0d3719663ffad44a78caaeffc54a412fe0109 Mon Sep 17 00:00:00 2001 From: "yokoyama%netscape.com" Date: Wed, 24 Jul 2002 04:48:34 +0000 Subject: [PATCH] bug 156979 supporting marquee tag. few new files are added and makefile.xxx are modified. /r=timeless, dveditz /sr=jst, /a=jaime git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@125676 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mac/build_scripts/MozillaBuildList.pm | 1 + mozilla/embedding/config/embed-jar.mn | 5 + mozilla/embedding/config/makefile.win | 2 + mozilla/layout/html/document/src/Makefile.in | 2 + mozilla/layout/html/document/src/html.css | 12 + mozilla/layout/html/document/src/makefile.win | 2 + .../html/document/src/xbl-marquee/Makefile.in | 48 +++ .../document/src/xbl-marquee/makefile.win | 42 +++ .../src/xbl-marquee/resources/Makefile.in | 46 +++ .../resources/content/contents.rdf | 15 + .../resources/content/xbl-marquee.xml | 311 ++++++++++++++++++ .../document/src/xbl-marquee/resources/jar.mn | 3 + .../src/xbl-marquee/resources/makefile.win | 39 +++ .../defaults/chrome/userContent-example.css | 7 + mozilla/xpinstall/packager/mac/browser.jst | 1 + mozilla/xpinstall/packager/unix/browser.jst | 1 + .../xpinstall/packager/windows/browser.jst | 1 + 17 files changed, 538 insertions(+) create mode 100644 mozilla/layout/html/document/src/xbl-marquee/Makefile.in create mode 100644 mozilla/layout/html/document/src/xbl-marquee/makefile.win create mode 100644 mozilla/layout/html/document/src/xbl-marquee/resources/Makefile.in create mode 100644 mozilla/layout/html/document/src/xbl-marquee/resources/content/contents.rdf create mode 100644 mozilla/layout/html/document/src/xbl-marquee/resources/content/xbl-marquee.xml create mode 100644 mozilla/layout/html/document/src/xbl-marquee/resources/jar.mn create mode 100644 mozilla/layout/html/document/src/xbl-marquee/resources/makefile.win diff --git a/mozilla/build/mac/build_scripts/MozillaBuildList.pm b/mozilla/build/mac/build_scripts/MozillaBuildList.pm index ab9614ec1fc..0ab50be1fc0 100644 --- a/mozilla/build/mac/build_scripts/MozillaBuildList.pm +++ b/mozilla/build/mac/build_scripts/MozillaBuildList.pm @@ -583,6 +583,7 @@ sub ProcessJarManifests() CreateJarFromManifest(":mozilla:intl:uconv:src:jar.mn", $chrome_dir, \%jars); CreateJarFromManifest(":mozilla:htmlparser:src:jar.mn", $chrome_dir, \%jars); CreateJarFromManifest(":mozilla:layout:html:forms:resources:jar.mn", $chrome_dir, \%jars); + CreateJarFromManifest(":mozilla:layout:html:document:src:xbl-marquee:resources:jar.mn", $chrome_dir, \%jars); CreateJarFromManifest(":mozilla:layout:html:forms:src:jar.mn", $chrome_dir, \%jars); CreateJarFromManifest(":mozilla:layout:html:base:src:jar.mn", $chrome_dir, \%jars); CreateJarFromManifest(":mozilla:mailnews:jar.mn", $chrome_dir, \%jars); diff --git a/mozilla/embedding/config/embed-jar.mn b/mozilla/embedding/config/embed-jar.mn index e155a5807c7..7fb9a5e57d7 100644 --- a/mozilla/embedding/config/embed-jar.mn +++ b/mozilla/embedding/config/embed-jar.mn @@ -45,3 +45,8 @@ locale/XXXX/pippki, XXXX/locale/XXXX/pippki # Wallet stuff locale/XXXX/communicator/wallet, XXXX/locale/XXXX/communicator/wallet + +# Marquee stuff +content/xbl-marquee, comm/content/xbl-marquee + + diff --git a/mozilla/embedding/config/makefile.win b/mozilla/embedding/config/makefile.win index e808f77cc26..b8f9cbd68aa 100644 --- a/mozilla/embedding/config/makefile.win +++ b/mozilla/embedding/config/makefile.win @@ -45,6 +45,8 @@ embed_chrome: embed-jar.mn unzip -d $(DIST)\Embed\tmpchrome\en-unix $(DIST)\bin\chrome\en-unix.jar nsinstall -D $(DIST)\Embed\tmpchrome\en-win unzip -d $(DIST)\Embed\tmpchrome\en-win $(DIST)\bin\chrome\en-win.jar + nsinstall -D $(DIST)\Embed\tmpchrome\comm + unzip -d $(DIST)\Embed\tmpchrome\comm $(DIST)\bin\chrome\comm.jar !if !defined(DISABLE_MAILNEWS) nsinstall -D $(DIST)\Embed\tmpchrome\messenger unzip -d $(DIST)\Embed\tmpchrome\messenger $(DIST)\bin\chrome\messenger.jar diff --git a/mozilla/layout/html/document/src/Makefile.in b/mozilla/layout/html/document/src/Makefile.in index 25d91fd2333..d7e35ece365 100644 --- a/mozilla/layout/html/document/src/Makefile.in +++ b/mozilla/layout/html/document/src/Makefile.in @@ -26,6 +26,8 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk +DIRS = xbl-marquee + MODULE = layout LIBRARY_NAME = gkhtmldoc_s REQUIRES = xpcom \ diff --git a/mozilla/layout/html/document/src/html.css b/mozilla/layout/html/document/src/html.css index 2af56d1df6e..1bc25e15784 100644 --- a/mozilla/layout/html/document/src/html.css +++ b/mozilla/layout/html/document/src/html.css @@ -557,3 +557,15 @@ noembed, noscript, param { } } +/* emulation of non-standard HTML tag */ +marquee { + -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal'); +} + +marquee[direction="up"], marquee[direction="down"] { + -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-vertical'); +} + +@media print { + marquee { -moz-binding: none; } +} diff --git a/mozilla/layout/html/document/src/makefile.win b/mozilla/layout/html/document/src/makefile.win index b9ef02d3f2f..0f78e2d2dff 100644 --- a/mozilla/layout/html/document/src/makefile.win +++ b/mozilla/layout/html/document/src/makefile.win @@ -21,6 +21,8 @@ DEPTH=..\..\..\.. +DIRS = xbl-marquee + LIBRARY_NAME=layouthtmldoc_s MODULE=layout REQUIRES = xpcom \ diff --git a/mozilla/layout/html/document/src/xbl-marquee/Makefile.in b/mozilla/layout/html/document/src/xbl-marquee/Makefile.in new file mode 100644 index 00000000000..ade4425eecb --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/Makefile.in @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is Netscape's XBL Marquee Emulation code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + + +DEPTH = ../../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +DIRS = resources + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/layout/html/document/src/xbl-marquee/makefile.win b/mozilla/layout/html/document/src/xbl-marquee/makefile.win new file mode 100644 index 00000000000..bec80833e9d --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/makefile.win @@ -0,0 +1,42 @@ +#!nmake +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is Netscape's XBL Marquee Emulation code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH=..\..\..\..\.. + +DIRS = resources + +include <$(DEPTH)/config/rules.mak> diff --git a/mozilla/layout/html/document/src/xbl-marquee/resources/Makefile.in b/mozilla/layout/html/document/src/xbl-marquee/resources/Makefile.in new file mode 100644 index 00000000000..c7531f5a8e9 --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/resources/Makefile.in @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is Netscape's XBL Marquee Emulation code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + + +DEPTH = ../../../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/layout/html/document/src/xbl-marquee/resources/content/contents.rdf b/mozilla/layout/html/document/src/xbl-marquee/resources/content/contents.rdf new file mode 100644 index 00000000000..e56516bca36 --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/resources/content/contents.rdf @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/mozilla/layout/html/document/src/xbl-marquee/resources/content/xbl-marquee.xml b/mozilla/layout/html/document/src/xbl-marquee/resources/content/xbl-marquee.xml new file mode 100644 index 00000000000..248bf75fdd9 --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/resources/content/xbl-marquee.xml @@ -0,0 +1,311 @@ + + + + + + + + + + + + + if (this.hasAttribute("scrollamount")) + return this.getAttribute("scrollamount"); + return 6; //default value is 6 pixels + + + this.setAttribute("scrollamount", val); + + + + + + + + + + + + if (this.hasAttribute("direction")) + return this.getAttribute("direction"); + return "left"; //default value is "left" + + + + + + if (this.hasAttribute("behavior")) + return this.getAttribute("behavior"); + return "scroll"; //default value is "scroll" + + + + 1 + 0 + 0 + 0 + 0 + + 0 + + + + + + + + 0) + return this.parentNode.offsetWidth; + else if (this.parentNode.parentNode.offsetWidth > 0) + return this.parentNode.parentNode.offsetWidth; + else + return 1; + ]]> + + + + + "0.9.6" + + + + this.stopAt) || + (this.dirsign == -1 && this.newPosition < this.stopAt)) + { + if (this.behavior == "alternate") + { + this.dirsign = -1 * this.dirsign; + var temp = this.stopAt; + this.stopAt = this.startAt; + this.startAt = temp; + } + else + { + this.newPosition = this.startAt; + } + } + + switch(this.direction) + { + case "up": + case "down": + this.outerDiv.scrollTop = this.newPosition; + break; + + case "left": + case "right": + default: + this.outerDiv.scrollLeft = this.newPosition; + break; + } + + var myThis = this; + var myTimeOut = function myTimeOutFunction(){myThis.start();} + + this.runId = window.setTimeout(myTimeOut, this.scrollDelay); + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/layout/html/document/src/xbl-marquee/resources/jar.mn b/mozilla/layout/html/document/src/xbl-marquee/resources/jar.mn new file mode 100644 index 00000000000..fe43e58f2b8 --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/resources/jar.mn @@ -0,0 +1,3 @@ +comm.jar: + content/xbl-marquee/contents.rdf (content/contents.rdf) + content/xbl-marquee/xbl-marquee.xml (content/xbl-marquee.xml) diff --git a/mozilla/layout/html/document/src/xbl-marquee/resources/makefile.win b/mozilla/layout/html/document/src/xbl-marquee/resources/makefile.win new file mode 100644 index 00000000000..6d223cab9dd --- /dev/null +++ b/mozilla/layout/html/document/src/xbl-marquee/resources/makefile.win @@ -0,0 +1,39 @@ +#!nmake +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is Netscape's XBL Marquee Emulation code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +DEPTH=..\..\..\..\..\.. + +include <$(DEPTH)/config/rules.mak> diff --git a/mozilla/profile/defaults/chrome/userContent-example.css b/mozilla/profile/defaults/chrome/userContent-example.css index 56023d085fd..bd796919f9e 100644 --- a/mozilla/profile/defaults/chrome/userContent-example.css +++ b/mozilla/profile/defaults/chrome/userContent-example.css @@ -22,6 +22,13 @@ * table { border: 2px solid; } */ +/* + * example: turn off "marquee" element + * + * marquee { -moz-binding: none; } + * + */ + /* * For more examples see http://www.mozilla.org/unix/customizing.html */ diff --git a/mozilla/xpinstall/packager/mac/browser.jst b/mozilla/xpinstall/packager/mac/browser.jst index df0abf94ad3..a6f6de6d68a 100644 --- a/mozilla/xpinstall/packager/mac/browser.jst +++ b/mozilla/xpinstall/packager/mac/browser.jst @@ -70,6 +70,7 @@ if (verifyDiskSpace(fProgram, srDest)) registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"help.jar"),"content/help/"); registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"pippki.jar"), "content/pippki/"); registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"pipnss.jar"), "content/pipnss/"); + registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"comm.jar"),"content/xbl-marquee/"); // make an alias to the browser on the desktop var desktopFolder = getFolder("Mac Desktop"); diff --git a/mozilla/xpinstall/packager/unix/browser.jst b/mozilla/xpinstall/packager/unix/browser.jst index 8cdedb90ef9..f32f70a363d 100644 --- a/mozilla/xpinstall/packager/unix/browser.jst +++ b/mozilla/xpinstall/packager/unix/browser.jst @@ -73,6 +73,7 @@ if (verifyDiskSpace(communicatorFolder, srDest)) registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/messenger/"); registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/navigator/"); registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"help.jar"),"content/help/"); + registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"comm.jar"),"content/xbl-marquee/"); if (err==SUCCESS) { diff --git a/mozilla/xpinstall/packager/windows/browser.jst b/mozilla/xpinstall/packager/windows/browser.jst index d8c9fa60072..28385cfc4a3 100644 --- a/mozilla/xpinstall/packager/windows/browser.jst +++ b/mozilla/xpinstall/packager/windows/browser.jst @@ -487,6 +487,7 @@ if(verifyDiskSpace(fProgram, srDest)) registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome","modern.jar"),"skin/modern/messenger/"); registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome","modern.jar"),"skin/modern/navigator/"); registerChrome(CONTENT | DELAYED_CHROME, getFolder("Chrome","help.jar"),"content/help/"); + registerChrome(CONTENT | DELAYED_CHROME, getFolder("Chrome","comm.jar"),"content/xbl-marquee/"); /* Log files that are created after the installer is done, so they can be uninstalled */ logComment("Installing: " + fProgram + "Xpcs Registry.dat");