<commit_before>'use strict';

import { core, object } from 'metal';
import metalData from './metalData';
import DomDelegatedEventHandle from './DomDelegatedEventHandle';
import DomEventHandle from './DomEventHandle';

const NEXT_TARGET = '__metal_next_target__';
const USE_CAPTURE = {
	blur: true,
	focus: true,
	scroll: true
};

class dom {
	/**
	 * Adds the requested CSS classes to an element.
	 * @param {!Element} element The element to add CSS classes to.
	 * @param {string} classes CSS classes to add.
	 */
	static addClasses(element, classes) {
		if (!core.isObject(element) || !core.isString(classes)) {
			return;
		}

		if ('classList' in element) {
			dom.addClassesWithNative_(element, classes);
		} else {
			dom.addClassesWithoutNative_(element, classes);
		}
	}

	/**<commit_msg>Adds "load" and "error" events to be delegated on capture<commit_after>'use strict';

import { core, object } from 'metal';
import metalData from './metalData';
import DomDelegatedEventHandle from './DomDelegatedEventHandle';
import DomEventHandle from './DomEventHandle';

const NEXT_TARGET = '__metal_next_target__';
const USE_CAPTURE = {
	blur: true,
	error: true,
	focus: true,
	load: true,
	scroll: true
};

class dom {
	/**
	 * Adds the requested CSS classes to an element.
	 * @param {!Element} element The element to add CSS classes to.
	 * @param {string} classes CSS classes to add.
	 */
	static addClasses(element, classes) {
		if (!core.isObject(element) || !core.isString(classes)) {
			return;
		}

		if ('classList' in element) {
			dom.addClassesWithNative_(element, classes);
		} else {
			dom.addClassesWithoutNative_(element, classes);
		}
	}

	/**
{'fraction_non_alphanumeric': 0.12507516536380037, 'fraction_numerical': 0.0, 'mean_word_length': 4.2993630573248405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '441974', 'n_tokens_mistral': 562, 'n_tokens_neox': 521, 'n_words': 159}