Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

7/11 master -> stable #49

Merged
merged 9 commits into from
Jul 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/node_modules

npm-debug.log
/custom-elements.min.js
/custom-elements.min.source-map.js
/docs
10 changes: 10 additions & 0 deletions build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
"src/sidetable.js",
"MutationObservers/MutationObserver.js",
"src/CustomElements.js",
"src/MutationObserver.js",
"src/Observer.js",
"src/HTMLElementElement.js",
"src/Parser.js",
"src/boot.js"
]
164 changes: 79 additions & 85 deletions conf/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,86 +1,80 @@
// Sample Karma configuration file, that contain pretty much all the available options
// It's used for running client tests on Travis (http://travis-ci.org/#!/karma-runner/karma)
// Most of the options can be overriden by cli arguments (see karma --help)
//
// For all available config options and default values, see:
// https://github.com/karma-runner/karma/blob/stable/lib/config.js#L54


// base path, that will be used to resolve files and exclude
basePath = '../';

// list of files / patterns to load in the browser
files = [
'conf/mocha.conf.js',
'node_modules/chai/chai.js',
'test/*.js',
'custom-elements.js',
{pattern: 'src/*', included: false},
{pattern: 'tools/**/*.js', included: false}
];

// list of files to exclude
exclude = [];

frameworks = ['mocha'];

// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress', 'junit', 'teamcity'
// CLI --reporters progress
reporters = ['progress'];

// web server port
// CLI --port 9876
port = 9876;

// cli runner port
// CLI --runner-port 9100
runnerPort = 9100;

// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors = true;

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
// CLI --log-level debug
logLevel = LOG_INFO;

// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch = true;

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers = ['ChromeCanary'];

// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
captureTimeout = 50000;

// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun = true;

// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan = 500;

// compile coffee scripts
preprocessors = {
module.exports = function(karma) {
karma.configure({
// base path, that will be used to resolve files and exclude
basePath: '../',

// list of files / patterns to load in the browser
files: [
'tools/test/mocha-htmltest.js',
'conf/mocha.conf.js',
'node_modules/chai/chai.js',
'custom-elements.js',
'test/js/*.js',
{pattern: 'src/*', included: false},
{pattern: 'test/html/*.html', included: false},
{pattern: 'tools/**/*.js', included: false}
],

// list of files to exclude
exclude: [],

frameworks: ['mocha'],

// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress', 'junit', 'teamcity'
// CLI --reporters progress
reporters: ['progress'],

// web server port
// CLI --port 9876
port: 9876,

// cli runner port
// CLI --runner-port 9100
runnerPort: 9100,

// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors: true,

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
// CLI --log-level debug
logLevel: karma.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: true,

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers: ['ChromeCanary'],

// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
captureTimeout: 50000,

// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,

// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan: 500,

plugins: [
'karma-mocha',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-script-launcher',
'karma-crbot-reporter'
]
});
};

plugins = [
'karma-mocha',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-script-launcher',
'karma-crbot-reporter'
]
5 changes: 4 additions & 1 deletion conf/mocha.conf.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
mocha.setup({ui:'tdd'});
mocha.setup({
ui:'tdd',
htmlbase: '/base/test/'
});
16 changes: 4 additions & 12 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ module.exports = function(grunt) {
if (os.type() === 'Windows_NT') {
browsers.push('IE');
}
CustomElements = [
'src/sidetable.js',
'MutationObservers/MutationObserver.js',
'src/CustomElements.js',
'src/HTMLElementElement.js',
'src/Parser.js',
'src/boot.js'
];
CustomElements = grunt.file.readJSON('build.json');
// karma setup
var browsers;
(function() {
Expand Down Expand Up @@ -58,11 +51,10 @@ module.exports = function(grunt) {
},
uglify: {
CustomElements: {
/*
options: {
sourceMap: 'custom-elements.min.source-map.js'
// sourceMap: 'custom-elements.min.source-map.js'
banner: grunt.file.read('LICENSE')
},
*/
files: {
'custom-elements.min.js': CustomElements
}
Expand Down Expand Up @@ -90,7 +82,7 @@ module.exports = function(grunt) {
// plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-karma-0.9.1');
grunt.loadNpmTasks('grunt-karma');

// tasks
grunt.registerTask('default', ['uglify']);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"grunt": "*",
"grunt-contrib-uglify": "*",
"grunt-contrib-yuidoc": "~0.4.0",
"grunt-karma-0.9.1": "~0.4.3",
"grunt-karma": "~0.5.0",
"karma-mocha": "*",
"karma-script-launcher": "*",
"karma-crbot-reporter": "*"
Expand Down
8 changes: 4 additions & 4 deletions src/HTMLElementElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

(function(){

var HTMLElementElement = function(inElement) {
inElement.register = HTMLElementElement.prototype.register;
parseElementElement(inElement);
Expand Down Expand Up @@ -49,7 +49,7 @@ function parseElementElement(inElement) {
// install options
inElement.options = options;
// locate user script
var script = inElement.querySelector('script,scripts');
var script = inElement.querySelector('script:not([type]),script[type="text/javascript"],scripts');
if (script) {
// execute user script in 'inElement' context
executeComponentScript(script.textContent, inElement, options.name);
Expand All @@ -63,7 +63,7 @@ function parseElementElement(inElement) {
window[refName] = ctor;
}
}

// each property in inDictionary takes a value
// from the matching attribute in inElement, if any
function takeAttributes(inElement, inDictionary) {
Expand All @@ -81,7 +81,7 @@ function executeComponentScript(inScript, inContext, inName) {
context = inContext;
// source location
var owner = context.ownerDocument;
var url = (owner._URL || owner.URL || owner.impl
var url = (owner._URL || owner.URL || owner.impl
&& (owner.impl._URL || owner.impl.URL));
// ensure the component has a unique source map so it can be debugged
// if the name matches the filename part of the owning document's url,
Expand Down
2 changes: 1 addition & 1 deletion src/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function bootstrap() {
// synchronous upgrades
CustomElements.ready = true;
// capture blunt profiling data
CustomElements.readyTime = new Date().getTime();
CustomElements.readyTime = Date.now();
if (window.HTMLImports) {
CustomElements.elapsed = CustomElements.readyTime - HTMLImports.readyTime;
}
Expand Down