Skip to content

Commit

Permalink
Merge branch 'master' into frame-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
gleneivey committed Apr 26, 2010
2 parents d421bd0 + b188b5e commit d3fa0a7
Show file tree
Hide file tree
Showing 22 changed files with 864 additions and 270 deletions.
93 changes: 43 additions & 50 deletions build.xml
Expand Up @@ -257,8 +257,6 @@
<fileset dir="${SRC_DIR}" includes="dom/document.js" />
<fileset dir="${SRC_DIR}" includes="dom/domparser.js" />
<fileset dir="${SRC_DIR}" includes="dom/xmlserializer.js" />
<fileset dir="${SRC_DIR}" includes="dom/xmlparser.js" />
<fileset dir="${SRC_DIR}" includes="dom/location.js" />
<fileset dir="${SRC_DIR}" includes="common/outro.js" />
</concat>
<echo message="Finished Building ${DOM_DIST}"/>
Expand Down Expand Up @@ -392,7 +390,6 @@
<fileset dir="${SRC_DIR}" includes="html/input-elements.js" />
<!-- in alpha order, EXCEPT for dependencies -->
<fileset dir="${SRC_DIR}" includes="html/a.js" />
<fileset dir="${SRC_DIR}" includes="html/anchor.js" />
<fileset dir="${SRC_DIR}" includes="html/area.js" />
<fileset dir="${SRC_DIR}" includes="html/base.js" />
<fileset dir="${SRC_DIR}" includes="html/blockquote-q.js" />
Expand All @@ -414,7 +411,6 @@
<fileset dir="${SRC_DIR}" includes="html/hr.js" />
<fileset dir="${SRC_DIR}" includes="html/html.js" />
<fileset dir="${SRC_DIR}" includes="html/iframe.js" />
<fileset dir="${SRC_DIR}" includes="html/image.js" />
<fileset dir="${SRC_DIR}" includes="html/img.js" />
<fileset dir="${SRC_DIR}" includes="html/input.js" />
<fileset dir="${SRC_DIR}" includes="html/label.js" />
Expand Down Expand Up @@ -462,6 +458,49 @@
<echo message=""/>
</target>

<!-- BUILD CSS IMPLEMENTATIOM -->
<target name="css" depends="env-platforms">
<mkdir dir="${DIST_DIR}" />
<echo message=""/>
<echo message="Building ${CSS_DIST}" />
<concat destfile="${CSS_DIST}">
<filterchain>
<replacetokens>
<token key="VERSION" value="css.${BUILD_VERSION}"/>
<token key="BUILD_VERSION" value="${BUILD_VERSION}"/>
</replacetokens>
</filterchain>
<fileset dir="${SRC_DIR}" includes="css/__global__.js" />
<fileset dir="${SRC_DIR}" includes="common/intro.js" />
<fileset dir="${SRC_DIR}" includes="common/__extend__.js" />
<fileset dir="${SRC_DIR}" includes="common/__setArray__.js" />
<fileset dir="${SRC_DIR}" includes="common/__trim__.js" />
<fileset dir="${SRC_DIR}" includes="css/document.js" />
<fileset dir="${SRC_DIR}" includes="css/properties.js" />
<fileset dir="${SRC_DIR}" includes="css/rule.js" />
<fileset dir="${SRC_DIR}" includes="css/stylesheet.js" />
<fileset dir="${SRC_DIR}" includes="css/htmlelement.js" />
<fileset dir="${SRC_DIR}" includes="common/outro.js" />
</concat>
<echo message="Finished Building ${CSS_DIST}"/>
<echo message=""/>
</target>

<!-- TEST CSS SPECIFICATION -->
<target name='css-spec'
depends='css'
description='Test CSS Specs'>
<echo message=""/>
<echo message="Executing CSS Spec"/>
<java fork="true"
jar="${RHINO_JAR}"
failonerror="true">
<arg value="${TEST_DIR}/css/boot.js"/>
<jvmarg value="-Dfile.encoding=utf-8"/>
<jvmarg value="-Xmx256m"/>
</java>
<echo message=""/>
</target>

<!-- BUILD PARSER IMPLEMENTATIOM -->
<target name="parser" depends="env-platforms">
Expand Down Expand Up @@ -552,51 +591,6 @@
<echo message=""/>
</target>

<!-- BUILD CSS IMPLEMENTATIOM -->
<target name="css" depends="env-platforms">
<mkdir dir="${DIST_DIR}" />
<echo message=""/>
<echo message="Building ${CSS_DIST}" />
<concat destfile="${CSS_DIST}">
<filterchain>
<replacetokens>
<token key="VERSION" value="css.${BUILD_VERSION}"/>
<token key="BUILD_VERSION" value="${BUILD_VERSION}"/>
</replacetokens>
</filterchain>
<fileset dir="${SRC_DIR}" includes="css/__global__.js" />
<fileset dir="${SRC_DIR}" includes="common/intro.js" />
<fileset dir="${SRC_DIR}" includes="common/__extend__.js" />
<fileset dir="${SRC_DIR}" includes="common/__setArray__.js" />
<fileset dir="${SRC_DIR}" includes="common/__trim__.js" />
<fileset dir="${SRC_DIR}" includes="css/document.js" />
<fileset dir="${SRC_DIR}" includes="css/properties.js" />
<fileset dir="${SRC_DIR}" includes="css/rule.js" />
<fileset dir="${SRC_DIR}" includes="css/stylesheet.js" />
<fileset dir="${SRC_DIR}" includes="css/htmlelement.js" />
<fileset dir="${SRC_DIR}" includes="common/outro.js" />
</concat>
<echo message="Finished Building ${CSS_DIST}"/>
<echo message=""/>
</target>

<!-- TEST CSS SPECIFICATION -->
<target name='css-spec'
depends='css'
description='Test CSS Specs'>
<echo message=""/>
<echo message="Executing CSS Spec"/>
<java fork="true"
jar="${RHINO_JAR}"
failonerror="true">
<arg value="${TEST_DIR}/css/boot.js"/>
<jvmarg value="-Dfile.encoding=utf-8"/>
<jvmarg value="-Xmx256m"/>
</java>
<echo message=""/>
</target>


<!-- BUILD WINDOW IMPLEMENTATIOM -->
<target name="window" depends="env-platforms">
<mkdir dir="${DIST_DIR}" />
Expand All @@ -612,7 +606,6 @@
<fileset dir="${SRC_DIR}" includes="window/__global__.js" />
<fileset dir="${SRC_DIR}" includes="common/intro.js" />
<fileset dir="${SRC_DIR}" includes="common/__extend__.js" />
<fileset dir="${SRC_DIR}" includes="common/__toArray__.js" />
<fileset dir="${SRC_DIR}" includes="window/frame.js" />
<fileset dir="${SRC_DIR}" includes="window/history.js" />
<fileset dir="${SRC_DIR}" includes="window/navigator.js" />
Expand Down
6 changes: 6 additions & 0 deletions htmlparser/gwt2/build.sh
Expand Up @@ -43,5 +43,11 @@ java \
# -draftCompile \
cp war/nu.validator.htmlparser.HtmlParser/nu.validator.htmlparser.HtmlParser.nocache.js ../../src/parser/htmlparser.js

#
# On innerhtml and some document-writes,some problems occurs when the
# parser being invoked with the wrong state. This patch just prevents
# the parser from dying and throwing an exception.
#
patch ../../src/parser/htmlparser.js patch1.diff
echo "DONE"

9 changes: 9 additions & 0 deletions htmlparser/gwt2/patch1.diff
@@ -0,0 +1,9 @@
2884a2885
> if (current) {
2885a2887
> }
10214c10216
< gwtOnLoad();})();
\ No newline at end of file
---
> gwtOnLoad();})();
80 changes: 80 additions & 0 deletions misc/build.py
@@ -0,0 +1,80 @@
#!/usr/bin/env python

#
# Fast "concatenator" for envjs.
# scans the ant build.xml file to find
# source files and glues then together
#
#
import re
import sys
import os.path

def getfilenames(base, platform):
target = re.compile('target name="([^"]+)"')
fileset = re.compile('fileset.*SRC_DIR.*includes="([^"]+)"')

# only support rhino right now
buildrhino = (platform == 'rhino')

files = []
isrhino = False
f = open(os.path.join(base, 'build.xml'))
for line in f:

# mini-sax... if we see a <target ...>
# check that it is not rhino stuff
# if so, we'll skip al the filesets
mo = target.search(line)
if mo:
fname = mo.group(1)
isrhino = (fname == 'rhino-env')
mo = fileset.search(line)
if mo and (buildrhino or not isrhino):
fname = mo.group(1)
files.append(fname)
f.close()
return files

def concat(base, src, outfile, atline=True, platform=None):
files = getfilenames(base, platform)
outfile = open(outfile, 'w')
for f in files:
fname = os.path.join(base, src, f)
data = open(fname, 'r')
if atline:
if f != 'common/outro.js' and f != 'common/intro.js':
outfile.write('\n//@line 1 "' + f + '"\n')
outfile.write(data.read())
else:
outfile.write(data.read())
data.close()

if __name__ == '__main__':
from optparse import OptionParser

parser = OptionParser()
parser.add_option('-t', '--top', dest='top', default='.',
help="Location of env-js source tree")
parser.add_option('-s', '--src', dest='src', default='src',
help="Source directory, default is 'src'")
parser.add_option('-d', '--dist', dest='dist', default='dist',
help="Destination directory, default 'dist'")
parser.add_option('-p', '--platform', dest='platform', default='',
help="platform type, optional. Defaults to core platform. 'rhino' is the only value supported")
parser.add_option('-a', '--atline', dest='atline', action="store_true",
default=False,
help="platform type, optional. Defaults to core platform. 'rhino' is the only value supported")
(options, args) = parser.parse_args()

outname = 'env.js'
if options.platform == 'rhino':
outname = 'env.rhino.js'

outfile = os.path.join(options.top, options.dist, outname)
concat(os.path.expanduser(options.top),
os.path.expanduser(options.src),
os.path.expanduser(outfile),
atline=options.atline,
platform=options.platform)

18 changes: 0 additions & 18 deletions specs/dom/spec.js
Expand Up @@ -201,12 +201,6 @@ test('createAttribute', function(){
equals(attribute.value, 'abc123', '.value');
equals(attribute.name, 'envjs', '.name');
equals(attribute.toString(), '[object Attr]', '.toString');
try{
attribute.name = 'env';
ok(false, 'name property is only a getter');
}catch(e){
ok(true, 'name property is only a getter');
}
equals(xmlserializer.serializeToString(attribute), 'abc123', 'xmlserializer');

});
Expand Down Expand Up @@ -244,18 +238,6 @@ test('createAttributeNS', function(){
ok(attribute.prefix = 'y', 'set prefix');
equals(attribute.prefix, 'y', '.prefix');
equals(attribute.name, 'y:envjs', '.name');
try{
attribute.name = 'env';
ok(false, 'name property is only a getter');
}catch(e){
ok(true, 'name property is only a getter');
}
try{
attribute.localName = 'env';
ok(false, 'localName property is only a getter');
}catch(e){
ok(true, 'localName property is only a getter');
}
equals(attribute.toString(), '[object Attr]', '.toString');
equals(xmlserializer.serializeToString(attribute), 'abc123', 'xmlserializer');

Expand Down

0 comments on commit d3fa0a7

Please sign in to comment.