diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-04 13:31:30 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-04 13:31:30 +0100 |
commit | c5c44d12073791bb1150445ce48bc57fccbb544d (patch) | |
tree | 9d7704d17cb06f886b0943d1508c9ff08f4b9570 | |
parent | a63272b5303b7aef467e974c630f745146fb983a (diff) | |
parent | bbc2206a0fda053a6f5071b457bd209dab9ed268 (diff) | |
download | UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.gz UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.lz UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.xz UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.zip |
Merge branch 'master' into certexception-work
513 files changed, 9884 insertions, 26960 deletions
@@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Clobber for SpiderMonkey Update +Clobber for NSS Update diff --git a/Makefile.in b/Makefile.in index 4adf3ac9a..26cd688d4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -290,7 +290,7 @@ MAKE_SYM_STORE_PATH := $(DIST)/bin endif DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms endif -ifeq (,$(filter-out Linux,$(OS_ARCH))) +ifeq (,$(filter-out Linux SunOS,$(OS_ARCH))) MAKE_SYM_STORE_ARGS := -c --vcs-info DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms MAKE_SYM_STORE_PATH := $(DIST)/bin diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js index b3f83ea84..1e48fa067 100644 --- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -59,6 +59,7 @@ const nsIPropertyElement = Components.interfaces.nsIPropertyElement; const MAC = (navigator.platform.indexOf("Mac") != -1); const LINUX = (navigator.platform.indexOf("Linux") != -1); +const SOLARIS = (navigator.platform.indexOf("SunOS") != -1); const WIN = (navigator.platform.indexOf("Win") != -1); //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/tests/mochitest/elm/test_nsApplicationAcc.html b/accessible/tests/mochitest/elm/test_nsApplicationAcc.html index e23eb37bc..58763e437 100644 --- a/accessible/tests/mochitest/elm/test_nsApplicationAcc.html +++ b/accessible/tests/mochitest/elm/test_nsApplicationAcc.html @@ -32,7 +32,7 @@ // nsIAccessible::name var applicationName = ""; - if (LINUX) { + if (LINUX || SOLARIS) { applicationName = appInfo.name; } else { try { diff --git a/accessible/tests/mochitest/treeupdate/test_contextmenu.xul b/accessible/tests/mochitest/treeupdate/test_contextmenu.xul index 916b815eb..5b31e0136 100644 --- a/accessible/tests/mochitest/treeupdate/test_contextmenu.xul +++ b/accessible/tests/mochitest/treeupdate/test_contextmenu.xul @@ -130,7 +130,7 @@ */ function getMenuTree1() { - if (LINUX) { + if (LINUX || SOLARIS) { var tree = { role: ROLE_MENUPOPUP, children: [ @@ -190,7 +190,7 @@ function getMenuTree2() { var tree = getMenuTree1(); - if (LINUX) { + if (LINUX || SOLARIS) { var submenuTree = { name: "item2.0", @@ -232,7 +232,7 @@ children: [] }; - if (LINUX) + if (LINUX || SOLARIS) tree.children[2].children[0].children.push(subsubmenuTree); else tree.children[2].children[0].children[0].children[0].children.push(subsubmenuTree); diff --git a/accessible/tests/mochitest/treeupdate/test_menu.xul b/accessible/tests/mochitest/treeupdate/test_menu.xul index d62ac8c5d..abdea217e 100644 --- a/accessible/tests/mochitest/treeupdate/test_menu.xul +++ b/accessible/tests/mochitest/treeupdate/test_menu.xul @@ -32,7 +32,7 @@ this.invoke = function openMenu_invoke() { var tree; - if (LINUX) { + if (LINUX || SOLARIS) { tree = { PARENT_MENUITEM: [ ] }; @@ -51,7 +51,7 @@ this.finalCheck = function openMenu_finalCheck() { var tree; - if (LINUX) { + if (LINUX || SOLARIS) { tree = { PARENT_MENUITEM: [ { MENUITEM: [ ] }, diff --git a/application/basilisk/branding/official/pref/basilisk-branding.js b/application/basilisk/branding/official/pref/basilisk-branding.js index 190b84e78..946902f88 100644 --- a/application/basilisk/branding/official/pref/basilisk-branding.js +++ b/application/basilisk/branding/official/pref/basilisk-branding.js @@ -11,7 +11,7 @@ #define BRANDING_RELNOTESPATH releasenotes.shtml #define BRANDING_FIRSTRUNPATH firstrun/ #define BRANDING_APPUPDATEURL aus.@BRANDING_BASEURL@ -#define BRANDING_APPUPDATEPATH ?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL% +#define BRANDING_APPUPDATEPATH ?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&toolkit=%WIDGET_TOOLKIT%&buildid=%BUILD_ID%&channel=%CHANNEL% // Shared Branding Preferences // XXX: These should REALLY go back to application preferences diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in index bffab0f6e..d8f65bcfb 100644 --- a/application/basilisk/installer/package-manifest.in +++ b/application/basilisk/installer/package-manifest.in @@ -685,6 +685,13 @@ #ifndef MOZ_SYSTEM_NSS #if defined(XP_LINUX) && !defined(ANDROID) @BINPATH@/@DLL_PREFIX@freeblpriv3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC64) +@BINPATH@/@DLL_PREFIX@freebl_64fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_64int_3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC) +@BINPATH@/@DLL_PREFIX@freebl_32fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_32int64_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #else @BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #endif diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index d0e078eb7..df46ea4b6 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -160,7 +160,7 @@ pref("app.update.silent", false); pref("app.update.staging.enabled", true); // Update service URL: -pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL%"); +pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&toolkit=%WIDGET_TOOLKIT%&buildid=%BUILD_ID%&channel=%CHANNEL%"); // app.update.url.manual is in branding section // app.update.url.details is in branding section @@ -682,6 +682,15 @@ pref("plugins.update.notifyUser", false); //Enable tri-state option (Always/Never/Ask) pref("plugins.click_to_play", true); +// Platform pref is to enable all plugins by default. +// Uncomment this pref to default to click-to-play +// pref("plugin.default.state", 1); + +// Don't load plugin instances with no src declared. +// These prefs are documented in detail in all.js. +pref("plugins.favorfallback.mode", "follow-ctp"); +pref("plugins.favorfallback.rules", "nosrc"); + #ifdef XP_WIN pref("browser.preferences.instantApply", false); #else diff --git a/application/palemoon/branding/shared/pref/preferences.inc b/application/palemoon/branding/shared/pref/preferences.inc index 12803f285..fe1a2f003 100644 --- a/application/palemoon/branding/shared/pref/preferences.inc +++ b/application/palemoon/branding/shared/pref/preferences.inc @@ -12,8 +12,6 @@ pref("browser.identity.ssl_domain_display", 1); //show domain verified SSL (blue // ===| Application Update Service |=========================================== -pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL%"); - // The time interval between the downloading of mar file chunks in the // background (in seconds) pref("app.update.download.backgroundInterval", 600); diff --git a/application/palemoon/components/statusbar/Status.jsm b/application/palemoon/components/statusbar/Status.jsm index 19e12ddfd..dbdd1fc49 100644 --- a/application/palemoon/components/statusbar/Status.jsm +++ b/application/palemoon/components/statusbar/Status.jsm @@ -120,6 +120,57 @@ S4EStatusService.prototype = }, buildBinding: function() { + + // Object.prototype.watch() shim, based on Eli Grey's polyfill + // object.watch + if (!this._window.XULBrowserWindow.watch) { + Object.defineProperty(this._window.XULBrowserWindow, "watch", { + enumerable: false, + configurable: true, + writable: false, + value: function (prop, handler) { + var oldval = this[prop], + newval = oldval, + getter = function () { + return newval; + }, + setter = function (val) { + oldval = newval; + return newval = handler.call(this, prop, oldval, val); + } + ; + + try { + if (delete this[prop]) { // can't watch constants + Object.defineProperty(this, prop, { + get: getter, + set: setter, + enumerable: true, + configurable: true + }); + } + } catch(e) { + // This fails fatally on non-configurable props, so just + // ignore errors if it does. + } + } + }); + } + + // object.unwatch + if (!this._window.XULBrowserWindow.unwatch) { + Object.defineProperty(this._window.XULBrowserWindow, "unwatch", { + enumerable: false, + configurable: true, + writable: false, + value: function (prop) { + var val = this[prop]; + delete this[prop]; // remove accessors + this[prop] = val; + } + }); + } + let XULBWPropHandler = function(prop, oldval, newval) { CU.reportError("Attempt to modify XULBrowserWindow." + prop); return oldval; @@ -139,21 +190,6 @@ S4EStatusService.prototype = this._window.XULBrowserWindow[prop] = this[prop].bind(this); this._window.XULBrowserWindow.watch(prop, XULBWPropHandler); }, this); - - let XULBWHandler = function(prop, oldval, newval) { - if(!newval) - { - return newval; - } - CU.reportError("XULBrowserWindow changed. Updating S4E bindings."); - this._window.setTimeout(function(self) - { - self.buildBinding(); - }, 0, this); - return newval; - }; - - this._window.watch("XULBrowserWindow", XULBWHandler); }, destroy: function() diff --git a/application/palemoon/config/version.txt b/application/palemoon/config/version.txt index ff225a990..7ce3ee6a8 100644 --- a/application/palemoon/config/version.txt +++ b/application/palemoon/config/version.txt @@ -1 +1 @@ -28.7.0a1
\ No newline at end of file +28.8.0a1
\ No newline at end of file diff --git a/application/palemoon/installer/package-manifest.in b/application/palemoon/installer/package-manifest.in index f95f18f77..e24b605e8 100644 --- a/application/palemoon/installer/package-manifest.in +++ b/application/palemoon/installer/package-manifest.in @@ -296,6 +296,13 @@ #ifndef MOZ_SYSTEM_NSS #if defined(XP_LINUX) && !defined(ANDROID) @BINPATH@/@DLL_PREFIX@freeblpriv3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC64) +@BINPATH@/@DLL_PREFIX@freebl_64fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_64int_3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC) +@BINPATH@/@DLL_PREFIX@freebl_32fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_32int64_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #else @BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #endif diff --git a/application/palemoon/moz.configure b/application/palemoon/moz.configure index 72236254f..de9b10b16 100644 --- a/application/palemoon/moz.configure +++ b/application/palemoon/moz.configure @@ -5,3 +5,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. include('../../toolkit/moz.configure') + + diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4 index 82d0b43fc..77c2e85b5 100644 --- a/build/autoconf/compiler-opts.m4 +++ b/build/autoconf/compiler-opts.m4 @@ -176,8 +176,13 @@ if test "$GNU_CC"; then CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections" fi - CFLAGS="$CFLAGS -fno-math-errno -msse2 -mfpmath=sse" - CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -msse2 -mfpmath=sse" + CFLAGS="$CFLAGS -fno-math-errno" + CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno" + + if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" + CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse" + fi if test -z "$CLANG_CC"; then case "$CC_VERSION" in diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index 89c53c52c..d3cc3113d 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -35,7 +35,7 @@ if test -n "$USE_ICU"; then fi fi - version=`sed -n 's/^[[[:space:]]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"` + version=`${TOOLCHAIN_PREFIX}sed -n 's/^[[[:space:]]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"` if test x"$version" = x; then AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno]) fi diff --git a/build/gyp.mozbuild b/build/gyp.mozbuild index 545b888bd..fd8714ecf 100644 --- a/build/gyp.mozbuild +++ b/build/gyp.mozbuild @@ -89,6 +89,7 @@ flavors = { 'Android': 'android', 'Linux': 'linux', 'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios', + 'SunOS': 'solaris', 'GNU/kFreeBSD': 'freebsd', 'DragonFly': 'dragonfly', 'FreeBSD': 'freebsd', diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure index 7664591ad..a275957b7 100644 --- a/build/moz.configure/init.configure +++ b/build/moz.configure/init.configure @@ -336,6 +336,8 @@ def split_triplet(triplet): canonical_os = canonical_kernel = 'NetBSD' elif os.startswith('openbsd'): canonical_os = canonical_kernel = 'OpenBSD' + elif os.startswith('solaris'): + canonical_os = canonical_kernel = 'SunOS' else: die('Unknown OS: %s' % os) @@ -569,6 +571,28 @@ def target_is_linux(target): set_define('XP_LINUX', target_is_linux) +@depends(target) +def target_is_solaris(target): + if target.kernel == 'SunOS': + return True + +set_define('XP_SOLARIS', target_is_solaris) + +@depends(target) +def target_is_sparc(target): + if target.cpu == 'sparc': + return True + +set_define('SPARC', target_is_sparc) + +@depends(target) +def target_is_sparc64(target): + if target.cpu == 'sparc64': + return True + +set_define('SPARC64', target_is_sparc64) + + # The application/project to build # ============================================================== option('--enable-application', nargs=1, env='MOZ_BUILD_APP', diff --git a/build/moz.configure/memory.configure b/build/moz.configure/memory.configure index 398413b62..1292d7273 100644 --- a/build/moz.configure/memory.configure +++ b/build/moz.configure/memory.configure @@ -58,6 +58,9 @@ def jemalloc_os_define(jemalloc, target): return 'MOZ_MEMORY_DARWIN' if target.kernel in ('kFreeBSD', 'FreeBSD', 'NetBSD'): return 'MOZ_MEMORY_BSD' + if target.kernel == 'SunOS': + return 'MOZ_MEMORY_SOLARIS' + die('--enable-jemalloc is not supported on %s', target.kernel) set_define(jemalloc_os_define, '1') diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 326b2327e..552019a13 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -215,6 +215,7 @@ def old_configure_options(*options): '--enable-pref-extensions', '--enable-private-build', '--enable-pulseaudio', + '--enable-sndio', '--enable-raw', '--enable-readline', '--enable-reflow-perf', diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure index b9a3898a1..631049566 100644 --- a/build/moz.configure/windows.configure +++ b/build/moz.configure/windows.configure @@ -361,10 +361,10 @@ set_config('LIB', lib_path) option(env='MT', nargs=1, help='Path to the Microsoft Manifest Tool') -@depends_win(valid_windows_sdk_dir) +@depends_win(valid_windows_sdk_dir, valid_ucrt_sdk_dir) @imports(_from='os', _import='environ') @imports('platform') -def sdk_bin_path(valid_windows_sdk_dir): +def sdk_bin_path(valid_windows_sdk_dir, valid_ucrt_sdk_dir): if not valid_windows_sdk_dir: return @@ -373,13 +373,17 @@ def sdk_bin_path(valid_windows_sdk_dir): 'AMD64': 'x64', }.get(platform.machine()) + # From version 10.0.15063.0 onwards the bin path contains the version number. + versioned_bin = ('bin' if valid_ucrt_sdk_dir.version < '10.0.15063.0' + else os.path.join('bin', str(valid_ucrt_sdk_dir.version))) + result = [ environ['PATH'], - os.path.join(valid_windows_sdk_dir.path, 'bin', vc_host) + os.path.join(valid_windows_sdk_dir.path, versioned_bin, vc_host) ] if vc_host == 'x64': result.append( - os.path.join(valid_windows_sdk_dir.path, 'bin', 'x86')) + os.path.join(valid_windows_sdk_dir.path, versioned_bin, 'x86')) return result diff --git a/config/external/ffi/moz.build b/config/external/ffi/moz.build index e9ef07de3..01ccd0547 100644 --- a/config/external/ffi/moz.build +++ b/config/external/ffi/moz.build @@ -35,9 +35,17 @@ else: 'FFI_NO_RAW_API': True, 'HAVE_AS_ASCII_PSEUDO_OP': True, 'HAVE_AS_STRING_PSEUDO_OP': True, - 'HAVE_AS_X86_64_UNWIND_SECTION_TYPE': True, }) +# This should NEVER be true on 32-bit x86 systems. It's called x86_64 unwind +# section type for a reason. By rights the way it was before should have broken +# all 32-bit builds on x86. + + if CONFIG['FFI_TARGET'] == 'X86': + DEFINES['HAVE_AS_X86_64_UNWIND_SECTION_TYPE'] = False + else: + DEFINES['HAVE_AS_X86_64_UNWIND_SECTION_TYPE'] = True + if CONFIG['MOZ_DEBUG']: DEFINES['FFI_DEBUG'] = True if not CONFIG['MOZ_NO_DEBUG_RTL']: @@ -49,14 +57,28 @@ else: if CONFIG['OS_TARGET'] not in ('WINNT', 'Darwin'): DEFINES['HAVE_HIDDEN_VISIBILITY_ATTRIBUTE'] = True - if CONFIG['INTEL_ARCHITECTURE']: +# Solaris uses datarel encoding for x86. This causes a lot of really stupid +# problems, like the vast majority of x86 assembler not being considered PIC +# on Solaris. + + if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['OS_TARGET'] != 'SunOS': + DEFINES['HAVE_AS_X86_PCREL'] = True + +# Which is why they apparently don't do this anymore on amd64. + + if CONFIG['FFI_TARGET'] == 'X86_64' and CONFIG['OS_TARGET'] == 'SunOS': DEFINES['HAVE_AS_X86_PCREL'] = True # Don't bother setting EH_FRAME_FLAGS on Windows. # Quoted defines confuse msvcc.sh, and the value isn't used there. if CONFIG['OS_TARGET'] != 'WINNT': + # Solaris seems to require EH_FRAME to be writable even on x86. + # It works fine most of the time and there's no rule against it, + # but it causes a lot of weird problems. if CONFIG['FFI_TARGET'] == 'ARM': DEFINES['EH_FRAME_FLAGS'] = '"aw"' + elif CONFIG['FFI_TARGET'] == 'X86' and CONFIG['OS_TARGET'] == 'SunOS': + DEFINES['EH_FRAME_FLAGS'] = '"aw"' else: DEFINES['EH_FRAME_FLAGS'] = '"a"' diff --git a/config/external/icu/data/icudt58l.dat b/config/external/icu/data/icudt58l.dat Binary files differindex 528ff5ebe..0bded3ec6 100644 --- a/config/external/icu/data/icudt58l.dat +++ b/config/external/icu/data/icudt58l.dat diff --git a/config/external/nspr/pr/moz.build b/config/external/nspr/pr/moz.build index af710f850..1d2df3099 100644 --- a/config/external/nspr/pr/moz.build +++ b/config/external/nspr/pr/moz.build @@ -51,6 +51,20 @@ elif CONFIG['OS_TARGET'] == 'Darwin': ] if not CONFIG['MOZ_IOS']: DEFINES['HAVE_CRT_EXTERNS_H'] = True +elif CONFIG['OS_TARGET'] == 'SunOS': + DEFINES.update( + HAVE_FCNTL_FILE_LOCKING=True, + HAVE_SOCKLEN_T=True, + _PR_HAVE_OFF64_T=True, + _PR_INET6=True, + ) + DEFINES['SOLARIS'] = True + SOURCES += ['/nsprpub/pr/src/md/unix/solaris.c'] + if CONFIG['CPU_ARCH'] == 'x86_64': + SOURCES += ['/nsprpub/pr/src/md/unix/os_SunOS_x86_64.s'] + DEFINES['USE_64'] = True + elif CONFIG['CPU_ARCH'] == 'x86': + SOURCES += ['/nsprpub/pr/src/md/unix/os_SunOS_x86.s'] elif CONFIG['OS_TARGET'] == 'WINNT': OS_LIBS += [ 'advapi32', @@ -224,6 +238,7 @@ EXPORTS.nspr.md += [ '/nsprpub/pr/include/md/_linux.cfg', '/nsprpub/pr/include/md/_netbsd.cfg', '/nsprpub/pr/include/md/_openbsd.cfg', + '/nsprpub/pr/include/md/_solaris.cfg', '/nsprpub/pr/include/md/_win95.cfg', ] diff --git a/config/external/nspr/prcpucfg.h b/config/external/nspr/prcpucfg.h index 5f7962733..8769abeeb 100644 --- a/config/external/nspr/prcpucfg.h +++ b/config/external/nspr/prcpucfg.h @@ -22,6 +22,8 @@ #include "md/_openbsd.cfg" #elif defined(__linux__) #include "md/_linux.cfg" +#elif defined(__sun__) +#include "md/_solaris.cfg" #else #error "Unsupported platform!" #endif diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 2c266eb20..71954b403 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -43,6 +43,21 @@ endif # Default HAVE_FREEBL_LIBS = 1 +# SunOS SPARC + +ifeq ($(OS_ARCH), SunOS) +ifneq (86,$(findstring 86,$(OS_TEST))) +ifdef HAVE_64BIT_BUILD +HAVE_FREEBL_LIBS = +HAVE_FREEBL_LIBS_64 = 1 +else +HAVE_FREEBL_LIBS = +HAVE_FREEBL_LIBS_32FPU = 1 +HAVE_FREEBL_LIBS_32INT64 = 1 +endif +endif +endif + ifeq ($(OS_TARGET),Linux) HAVE_FREEBL_LIBS = HAVE_FREEBL_LIBS_PRIV = 1 @@ -317,6 +332,11 @@ NSS_DIST_DLL_DEST := $(DIST)/bin NSS_DIST_DLL_TARGET := target INSTALL_TARGETS += NSS_DIST_DLL +ifeq ($(OS_ARCH)_$(1), SunOS_softokn3) +# has to use copy mode on Solaris, see #665509 +$(DIST)/bin/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): INSTALL := $(NSINSTALL) -t +endif + NSS_SDK_LIB_FILES := \ $(addprefix $(DIST)/lib/$(LIB_PREFIX),$(addsuffix .$(LIB_SUFFIX),$(SDK_LIBS))) \ $(addprefix $(DIST)/bin/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(NSS_DLLS))) \ diff --git a/config/external/nss/nss.symbols b/config/external/nss/nss.symbols index 7a968b6c8..9172407b2 100644 --- a/config/external/nss/nss.symbols +++ b/config/external/nss/nss.symbols @@ -216,7 +216,9 @@ NSS_CMSSignedData_Create NSS_CMSSignedData_CreateCertsOnly NSS_CMSSignedData_Destroy NSS_CMSSignedData_GetContentInfo +NSS_CMSSignedData_GetDigestAlgs NSS_CMSSignedData_GetSignerInfo +NSS_CMSSignedData_HasDigests NSS_CMSSignedData_ImportCerts NSS_CMSSignedData_SetDigestValue NSS_CMSSignedData_SignerInfoCount diff --git a/config/milestone.txt b/config/milestone.txt index 67b4fdd4e..210727cac 100644 --- a/config/milestone.txt +++ b/config/milestone.txt @@ -10,4 +10,4 @@ # hardcoded milestones in the tree from these two files. #-------------------------------------------------------- -4.4.1
\ No newline at end of file +4.4.2
\ No newline at end of file diff --git a/config/system-headers b/config/system-headers index 683c9d337..b10324f0f 100644 --- a/config/system-headers +++ b/config/system-headers @@ -1,3 +1,4 @@ +atomic.h nspr.h plarena.h plarenas.h @@ -909,7 +910,9 @@ signal.h SimpleGameSound.h SIOUX.h size_t.h +#ifdef MOZ_SNDIO sndio.h +#endif someincludefile.h Sound.h soundcard.h diff --git a/devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js b/devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js index 0021a8cc1..b96dc0c8e 100644 --- a/devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js +++ b/devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js @@ -57,8 +57,8 @@ var consoleOpened = Task.async(function* (hud) { // 4 values, and the following properties: // __defineGetter__ __defineSetter__ __lookupGetter__ __lookupSetter__ // __proto__ hasOwnProperty isPrototypeOf propertyIsEnumerable - // toLocaleString toString toSource unwatch valueOf watch constructor. - is(popup.itemCount, 19, "popup.itemCount is correct"); + // toLocaleString toString toSource valueOfconstructor. + is(popup.itemCount, 17, "popup.itemCount is correct"); let sameItems = popup.getItems().reverse().map(function (e) { return e.label; @@ -82,36 +82,34 @@ var consoleOpened = Task.async(function* (hud) { "toLocaleString", "toSource", "toString", - "unwatch", "valueOf", - "watch", ][index] === prop; }), "getItems returns the items we expect"); - is(popup.selectedIndex, 18, + is(popup.selectedIndex, 16, "Index of the first item from bottom is selected."); EventUtils.synthesizeKey("VK_DOWN", {}); let prefix = jsterm.getInputValue().replace(/[\S]/g, " "); is(popup.selectedIndex, 0, "index 0 is selected"); - is(popup.selectedItem.label, "watch", "watch is selected"); - is(completeNode.value, prefix + "watch", - "completeNode.value holds watch"); + is(popup.selectedItem.label, "valueOf", "valueOf is selected"); + is(completeNode.value, prefix + "valueOf", + "completeNode.value holds valueOf"); EventUtils.synthesizeKey("VK_DOWN", {}); is(popup.selectedIndex, 1, "index 1 is selected"); - is(popup.selectedItem.label, "valueOf", "valueOf is selected"); - is(completeNode.value, prefix + "valueOf", - "completeNode.value holds valueOf"); + is(popup.selectedItem.label, "toString", "toString is selected"); + is(completeNode.value, prefix + "toString", + "completeNode.value holds toString"); EventUtils.synthesizeKey("VK_UP", {}); is(popup.selectedIndex, 0, "index 0 is selected"); - is(popup.selectedItem.label, "watch", "watch is selected"); - is(completeNode.value, prefix + "watch", - "completeNode.value holds watch"); + is(popup.selectedItem.label, "valueOf", "valueOf is selected"); + is(completeNode.value, prefix + "valueOf", + "completeNode.value holds valueOf"); let currentSelectionIndex = popup.selectedIndex; @@ -127,7 +125,7 @@ var consoleOpened = Task.async(function* (hud) { "Index is less after Page UP"); EventUtils.synthesizeKey("VK_END", {}); - is(popup.selectedIndex, 18, "index is last after End"); + is(popup.selectedIndex, 16, "index is last after End"); EventUtils.synthesizeKey("VK_HOME", {}); is(popup.selectedIndex, 0, "index is first after Home"); @@ -151,7 +149,7 @@ function popupHideAfterTab() { // At this point the completion suggestion should be accepted. ok(!popup.isOpen, "popup is not open"); - is(jsterm.getInputValue(), "window.foobarBug585991.watch", + is(jsterm.getInputValue(), "window.foobarBug585991.valueOf", "completion was successful after VK_TAB"); ok(!completeNode.value, "completeNode is empty"); @@ -159,17 +157,17 @@ function popupHideAfterTab() { popup.once("popup-opened", function onShown() { ok(popup.isOpen, "popup is open"); - is(popup.itemCount, 19, "popup.itemCount is correct"); + is(popup.itemCount, 17, "popup.itemCount is correct"); - is(popup.selectedIndex, 18, "First index from bottom is selected"); + is(popup.selectedIndex, 16, "First index from bottom is selected"); EventUtils.synthesizeKey("VK_DOWN", {}); let prefix = jsterm.getInputValue().replace(/[\S]/g, " "); is(popup.selectedIndex, 0, "index 0 is selected"); - is(popup.selectedItem.label, "watch", "watch is selected"); - is(completeNode.value, prefix + "watch", - "completeNode.value holds watch"); + is(popup.selectedItem.label, "valueOf", "valueOf is selected"); + is(completeNode.value, prefix + "valueOf", + "completeNode.value holds valueOf"); popup.once("popup-closed", function onHidden() { ok(!popup.isOpen, "popup is not open after VK_ESCAPE"); @@ -203,29 +201,29 @@ function testReturnKey() { popup.once("popup-opened", function onShown() { ok(popup.isOpen, "popup is open"); - is(popup.itemCount, 19, "popup.itemCount is correct"); + is(popup.itemCount, 17, "popup.itemCount is correct"); - is(popup.selectedIndex, 18, "First index from bottom is selected"); + is(popup.selectedIndex, 16, "First index from bottom is selected"); EventUtils.synthesizeKey("VK_DOWN", {}); let prefix = jsterm.getInputValue().replace(/[\S]/g, " "); is(popup.selectedIndex, 0, "index 0 is selected"); - is(popup.selectedItem.label, "watch", "watch is selected"); - is(completeNode.value, prefix + "watch", - "completeNode.value holds watch"); + is(popup.selectedItem.label, "valueOf", "valueOf is selected"); + is(completeNode.value, prefix + "valueOf", + "completeNode.value holds valueOf"); EventUtils.synthesizeKey("VK_DOWN", {}); is(popup.selectedIndex, 1, "index 1 is selected"); - is(popup.selectedItem.label, "valueOf", "valueOf is selected"); - is(completeNode.value, prefix + "valueOf", - "completeNode.value holds valueOf"); + is(popup.selectedItem.label, "toString", "toString is selected"); + is(completeNode.value, prefix + "toString", + "completeNode.value holds toString"); popup.once("popup-closed", function onHidden() { ok(!popup.isOpen, "popup is not open after VK_RETURN"); - is(jsterm.getInputValue(), "window.foobarBug585991.valueOf", + is(jsterm.getInputValue(), "window.foobarBug585991.toString", "completion was successful after VK_RETURN"); ok(!completeNode.value, "completeNode is empty"); diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 070167496..25d9e2d33 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -779,7 +779,8 @@ exports.CSS_PROPERTIES = { "column-gap" ], "supports": [ - 6 + 6, + 8 ], "values": [ "-moz-calc", @@ -5434,7 +5435,8 @@ exports.CSS_PROPERTIES = { "column-gap" ], "supports": [ - 6 + 6, + 8 ], "values": [ "-moz-calc", diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 299a8e859..606d67de9 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -9,10 +9,14 @@ #ifndef nsContentUtils_h___ #define nsContentUtils_h___ -#if defined(XP_WIN) +#ifdef XP_WIN #include <float.h> #endif +#ifdef XP_SOLARIS +#include <ieeefp.h> +#endif + #include "js/TypeDecls.h" #include "js/Value.h" #include "js/RootingAPI.h" diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp index 84b128b15..34eb6ed38 100644 --- a/dom/base/nsDocumentEncoder.cpp +++ b/dom/base/nsDocumentEncoder.cpp @@ -82,7 +82,9 @@ protected: nsAString& aStr, bool aDontSerializeRoot, uint32_t aMaxLength = 0); - nsresult SerializeNodeEnd(nsINode* aNode, nsAString& aStr); + nsresult SerializeNodeEnd(nsINode* aOriginalNode, + nsAString& aStr, + nsINode* aFixupNode = nullptr); // This serializes the content of aNode. nsresult SerializeToStringIterative(nsINode* aNode, nsAString& aStr); @@ -405,14 +407,37 @@ nsDocumentEncoder::SerializeNodeStart(nsINode* aNode, } nsresult -nsDocumentEncoder::SerializeNodeEnd(nsINode* aNode, - nsAString& aStr) +nsDocumentEncoder::SerializeNodeEnd(nsINode* aOriginalNode, + nsAString& aStr, + nsINode* aFixupNode) { - if (!IsVisibleNode(aNode)) + if (!IsVisibleNode(aOriginalNode)) return NS_OK; - if (aNode->IsElement()) { - mSerializer->AppendElementEnd(aNode->AsElement(), aStr); + nsINode* node = nullptr; + nsCOMPtr<nsINode> fixedNodeKungfuDeathGrip; + + // Caller didn't do fixup, so we'll do it ourselves + if (!aFixupNode) { + aFixupNode = aOriginalNode; + if (mNodeFixup) { + bool dummy; + nsCOMPtr<nsIDOMNode> domNodeIn = do_QueryInterface(aOriginalNode); + nsCOMPtr<nsIDOMNode> domNodeOut; + mNodeFixup->FixupNode(domNodeIn, &dummy, getter_AddRefs(domNodeOut)); + fixedNodeKungfuDeathGrip = do_QueryInterface(domNodeOut); + node = fixedNodeKungfuDeathGrip; + } + } + + // Fall back to original node if needed. + if (!node) + node = aOriginalNode; + + if (node->IsElement()) { + mSerializer->AppendElementEnd(node->AsElement(), + aOriginalNode->AsElement(), + aStr); } return NS_OK; } @@ -481,7 +506,7 @@ nsDocumentEncoder::SerializeToStringRecursive(nsINode* aNode, } if (!aDontSerializeRoot) { - rv = SerializeNodeEnd(maybeFixedNode, aStr); + rv = SerializeNodeEnd(aNode, aStr, maybeFixedNode); NS_ENSURE_SUCCESS(rv, rv); } diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index afaa24f09..1288b3435 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -1026,11 +1026,6 @@ public: return false; } - virtual bool watch(JSContext *cx, JS::Handle<JSObject*> proxy, - JS::Handle<jsid> id, JS::Handle<JSObject*> callable) const override; - virtual bool unwatch(JSContext *cx, JS::Handle<JSObject*> proxy, - JS::Handle<jsid> id) const override; - static void ObjectMoved(JSObject *obj, const JSObject *old); static const nsOuterWindowProxy singleton; @@ -1398,20 +1393,6 @@ nsOuterWindowProxy::AppendIndexedPropertyNames(JSContext *cx, JSObject *proxy, return true; } -bool -nsOuterWindowProxy::watch(JSContext *cx, JS::Handle<JSObject*> proxy, - JS::Handle<jsid> id, JS::Handle<JSObject*> callable) const -{ - return js::WatchGuts(cx, proxy, id, callable); -} - -bool -nsOuterWindowProxy::unwatch(JSContext *cx, JS::Handle<JSObject*> proxy, - JS::Handle<jsid> id) const -{ - return js::UnwatchGuts(cx, proxy, id); -} - void nsOuterWindowProxy::ObjectMoved(JSObject *obj, const JSObject *old) { @@ -3224,6 +3205,12 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument, newInnerWindow->mLocalStorage = nullptr; newInnerWindow->mSessionStorage = nullptr; + newInnerWindow->mPerformance = nullptr; + + // This must be called after nulling the internal objects because + // we might recreate them here by calling the getter methods, and + // store them into the JS slots. If we null them after, the slot + // values and the objects will be out of sync. newInnerWindow->ClearDocumentDependentSlots(cx); } } else { @@ -3364,10 +3351,16 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument) } mDoc = aDocument; - ClearDocumentDependentSlots(aCx); mFocusedNode = nullptr; mLocalStorage = nullptr; mSessionStorage = nullptr; + mPerformance = nullptr; + + // This must be called after nulling the internal objects because we might + // recreate them here by calling the getter methods, and store them into the JS + // slots. If we null them after, the slot values and the objects will be + // out of sync. + ClearDocumentDependentSlots(aCx); #ifdef DEBUG mLastOpenedURI = aDocument->GetDocumentURI(); diff --git a/dom/base/nsHTMLContentSerializer.cpp b/dom/base/nsHTMLContentSerializer.cpp index ab8b4f2b2..c135c4cf8 100644 --- a/dom/base/nsHTMLContentSerializer.cpp +++ b/dom/base/nsHTMLContentSerializer.cpp @@ -301,6 +301,7 @@ nsHTMLContentSerializer::AppendElementStart(Element* aElement, NS_IMETHODIMP nsHTMLContentSerializer::AppendElementEnd(Element* aElement, + Element* aOriginalElement /* unused */, nsAString& aStr) { NS_ENSURE_ARG(aElement); diff --git a/dom/base/nsHTMLContentSerializer.h b/dom/base/nsHTMLContentSerializer.h index 6f3500e01..8e23d54ca 100644 --- a/dom/base/nsHTMLContentSerializer.h +++ b/dom/base/nsHTMLContentSerializer.h @@ -31,6 +31,7 @@ class nsHTMLContentSerializer final : public nsXHTMLContentSerializer { nsAString& aStr) override; NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement, + mozilla::dom::Element* aOriginalElement, nsAString& aStr) override; NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument, diff --git a/dom/base/nsIContentSerializer.h b/dom/base/nsIContentSerializer.h index f023cbc90..35014bd2c 100644 --- a/dom/base/nsIContentSerializer.h +++ b/dom/base/nsIContentSerializer.h @@ -55,6 +55,7 @@ class nsIContentSerializer : public nsISupports { nsAString& aStr) = 0; NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement, + mozilla::dom::Element* aOriginalElement, nsAString& aStr) = 0; NS_IMETHOD Flush(nsAString& aStr) = 0; diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 3c850c4cd..4978744e8 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -718,9 +718,9 @@ nsObjectLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent) if (mType == eType_Plugin) { nsIDocument* doc = thisContent->GetComposedDoc(); if (doc && doc->IsActive()) { - nsCOMPtr<nsIRunnable> ev = new nsSimplePluginEvent(doc, - NS_LITERAL_STRING("PluginRemoved")); - NS_DispatchToCurrentThread(ev); + nsCOMPtr<nsIRunnable> ev = new nsSimplePluginEvent(doc, + NS_LITERAL_STRING("PluginRemoved")); + NS_DispatchToCurrentThread(ev); } } } @@ -3628,6 +3628,14 @@ nsObjectLoadingContent::HasGoodFallback() { } } + // RULE "nosrc": + // Use fallback content if the object has not specified a src URI. + if (rulesList[i].EqualsLiteral("nosrc")) { + if (!mOriginalURI) { + return true; + } + } + // RULE "adobelink": // Don't use fallback content when it has a link to adobe's website. if (rulesList[i].EqualsLiteral("adobelink")) { diff --git a/dom/base/nsPlainTextSerializer.cpp b/dom/base/nsPlainTextSerializer.cpp index ef6bdcac7..8097c4ec8 100644 --- a/dom/base/nsPlainTextSerializer.cpp +++ b/dom/base/nsPlainTextSerializer.cpp @@ -390,6 +390,7 @@ nsPlainTextSerializer::AppendElementStart(Element* aElement, NS_IMETHODIMP nsPlainTextSerializer::AppendElementEnd(Element* aElement, + Element* aOriginalElement /* unused */, nsAString& aStr) { NS_ENSURE_ARG(aElement); diff --git a/dom/base/nsPlainTextSerializer.h b/dom/base/nsPlainTextSerializer.h index 95cf5590c..5055c75a0 100644 --- a/dom/base/nsPlainTextSerializer.h +++ b/dom/base/nsPlainTextSerializer.h @@ -61,6 +61,7 @@ public: mozilla::dom::Element* aOriginalElement, nsAString& aStr) override; NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement, + mozilla::dom::Element* aOriginalElement, nsAString& aStr) override; NS_IMETHOD Flush(nsAString& aStr) override; diff --git a/dom/base/nsXHTMLContentSerializer.cpp b/dom/base/nsXHTMLContentSerializer.cpp index 111ed46c7..0a39ef663 100755 --- a/dom/base/nsXHTMLContentSerializer.cpp +++ b/dom/base/nsXHTMLContentSerializer.cpp @@ -514,6 +514,7 @@ nsXHTMLContentSerializer::CheckElementStart(nsIContent * aContent, bool nsXHTMLContentSerializer::CheckElementEnd(mozilla::dom::Element* aElement, + mozilla::dom::Element* aOriginalElement, bool& aForceFormat, nsAString& aStr) { @@ -532,7 +533,7 @@ nsXHTMLContentSerializer::CheckElementEnd(mozilla::dom::Element* aElement, } bool dummyFormat; - return nsXMLContentSerializer::CheckElementEnd(aElement, dummyFormat, aStr); + return nsXMLContentSerializer::CheckElementEnd(aElement, aOriginalElement, dummyFormat, aStr); } bool diff --git a/dom/base/nsXHTMLContentSerializer.h b/dom/base/nsXHTMLContentSerializer.h index 7473ba074..79ecf28f1 100644 --- a/dom/base/nsXHTMLContentSerializer.h +++ b/dom/base/nsXHTMLContentSerializer.h @@ -53,6 +53,7 @@ class nsXHTMLContentSerializer : public nsXMLContentSerializer { nsAString& aStr) override; virtual bool CheckElementEnd(mozilla::dom::Element* aContent, + mozilla::dom::Element* aOriginalElement, bool& aForceFormat, nsAString& aStr) override; diff --git a/dom/base/nsXMLContentSerializer.cpp b/dom/base/nsXMLContentSerializer.cpp index 54fadaa94..f12bb8fdc 100644 --- a/dom/base/nsXMLContentSerializer.cpp +++ b/dom/base/nsXMLContentSerializer.cpp @@ -1028,6 +1028,7 @@ nsXMLContentSerializer::AppendEndOfElementStart(Element* aElement, NS_IMETHODIMP nsXMLContentSerializer::AppendElementEnd(Element* aElement, + Element* aOriginalElement, nsAString& aStr) { NS_ENSURE_ARG(aElement); @@ -1035,7 +1036,7 @@ nsXMLContentSerializer::AppendElementEnd(Element* aElement, nsIContent* content = aElement; bool forceFormat = false, outputElementEnd; - outputElementEnd = CheckElementEnd(aElement, forceFormat, aStr); + outputElementEnd = CheckElementEnd(aElement, aOriginalElement, forceFormat, aStr); nsIAtom *name = content->NodeInfo()->NameAtom(); @@ -1161,16 +1162,14 @@ nsXMLContentSerializer::CheckElementStart(nsIContent * aContent, bool nsXMLContentSerializer::CheckElementEnd(Element* aElement, + Element* aOriginalElement, bool& aForceFormat, nsAString& aStr) { // We don't output a separate end tag for empty element aForceFormat = false; - // XXXbz this is a bit messed up, but by now we don't have our fixed-up - // version of aElement anymore. Let's hope fixup never changes the localName - // or namespace... - return ElementNeedsSeparateEndTag(aElement, aElement); + return ElementNeedsSeparateEndTag(aElement, aOriginalElement); } bool diff --git a/dom/base/nsXMLContentSerializer.h b/dom/base/nsXMLContentSerializer.h index 941acb179..2f76b0892 100644 --- a/dom/base/nsXMLContentSerializer.h +++ b/dom/base/nsXMLContentSerializer.h @@ -59,6 +59,7 @@ class nsXMLContentSerializer : public nsIContentSerializer { nsAString& aStr) override; NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement, + mozilla::dom::Element* aOriginalElement, nsAString& aStr) override; NS_IMETHOD Flush(nsAString& aStr) override { return NS_OK; } @@ -263,6 +264,7 @@ class nsXMLContentSerializer : public nsIContentSerializer { * @return boolean true if the element can be output */ virtual bool CheckElementEnd(mozilla::dom::Element* aElement, + mozilla::dom::Element* aOriginalElement, bool& aForceFormat, nsAString& aStr); diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index a26fc4422..6e0db29b1 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -1968,8 +1968,6 @@ const js::ObjectOps sInterfaceObjectClassObjectOps = { nullptr, /* setProperty */ nullptr, /* getOwnPropertyDescriptor */ nullptr, /* deleteProperty */ - nullptr, /* watch */ - nullptr, /* unwatch */ nullptr, /* getElements */ nullptr, /* enumerate */ InterfaceObjectToString, /* funToString */ diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index d7d700a96..924241aa0 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -13169,9 +13169,9 @@ class CGDictionary(CGThing): # continues to match the list in test_Object.prototype_props.html if (member.identifier.name in ["constructor", "toSource", "toString", "toLocaleString", "valueOf", - "watch", "unwatch", "hasOwnProperty", "isPrototypeOf", - "propertyIsEnumerable", "__defineGetter__", "__defineSetter__", - "__lookupGetter__", "__lookupSetter__", "__proto__"]): + "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", + "__defineGetter__", "__defineSetter__", "__lookupGetter__", + "__lookupSetter__", "__proto__"]): raise TypeError("'%s' member of %s dictionary shadows " "a property of Object.prototype, and Xrays to " "Object can't handle that.\n" diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 23f0abd88..49281c1c2 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -275,19 +275,6 @@ DOMProxyHandler::delete_(JSContext* cx, JS::Handle<JSObject*> proxy, } bool -BaseDOMProxyHandler::watch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::Handle<JSObject*> callable) const -{ - return js::WatchGuts(cx, proxy, id, callable); -} - -bool -BaseDOMProxyHandler::unwatch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id) const -{ - return js::UnwatchGuts(cx, proxy, id); -} - -bool BaseDOMProxyHandler::ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy, JS::AutoIdVector& props) const diff --git a/dom/bindings/DOMJSProxyHandler.h b/dom/bindings/DOMJSProxyHandler.h index 1781649cc..e3e151b7a 100644 --- a/dom/bindings/DOMJSProxyHandler.h +++ b/dom/bindings/DOMJSProxyHandler.h @@ -72,11 +72,6 @@ public: virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy, JS::AutoIdVector &props) const override; - bool watch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, - JS::Handle<JSObject*> callable) const override; - bool unwatch(JSContext* cx, JS::Handle<JSObject*> proxy, - JS::Handle<jsid> id) const override; - protected: // Hook for subclasses to implement shared ownPropertyKeys()/keys() // functionality. The "flags" argument is either JSITER_OWNONLY (for keys()) diff --git a/dom/bindings/test/test_Object.prototype_props.html b/dom/bindings/test/test_Object.prototype_props.html index 03147eb03..3ab27c5e4 100644 --- a/dom/bindings/test/test_Object.prototype_props.html +++ b/dom/bindings/test/test_Object.prototype_props.html @@ -11,9 +11,9 @@ test(function() { // Codegen.py's CGDictionary.getMemberDefinition method. var expected = [ "constructor", "toSource", "toString", "toLocaleString", "valueOf", - "watch", "unwatch", "hasOwnProperty", "isPrototypeOf", - "propertyIsEnumerable", "__defineGetter__", "__defineSetter__", - "__lookupGetter__", "__lookupSetter__", "__proto__" + "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", + "__defineGetter__", "__defineSetter__", "__lookupGetter__", + "__lookupSetter__", "__proto__" ]; assert_array_equals(props.sort(), expected.sort()); }, "Own properties of Object.prototype"); diff --git a/dom/canvas/WebGLContextBuffers.cpp b/dom/canvas/WebGLContextBuffers.cpp index af506c01c..f53f9d7d7 100644 --- a/dom/canvas/WebGLContextBuffers.cpp +++ b/dom/canvas/WebGLContextBuffers.cpp @@ -9,6 +9,8 @@ #include "WebGLBuffer.h" #include "WebGLVertexArray.h" +#include "mozilla/CheckedInt.h" + namespace mozilla { WebGLRefPtr<WebGLBuffer>* @@ -345,6 +347,16 @@ WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage) //// + const auto checkedSize = CheckedInt<size_t>(size); + if (!checkedSize.isValid()) + return ErrorOutOfMemory("%s: Size too large for platform.", funcName); + +#if defined(XP_MACOSX) + if (gl->WorkAroundDriverBugs() && size > 1200000000) { + return ErrorOutOfMemory("Allocations larger than 1200000000 fail on MacOS."); + } +#endif + const UniqueBuffer zeroBuffer(calloc(size, 1)); if (!zeroBuffer) return ErrorOutOfMemory("%s: Failed to allocate zeros.", funcName); diff --git a/dom/grid/GridLines.cpp b/dom/grid/GridLines.cpp index fac645c64..898885346 100644 --- a/dom/grid/GridLines.cpp +++ b/dom/grid/GridLines.cpp @@ -90,7 +90,9 @@ GridLines::SetLineInfo(const ComputedGridTrackInfo* aTrackInfo, for (uint32_t i = aTrackInfo->mStartFragmentTrack; i < aTrackInfo->mEndFragmentTrack + 1; i++) { - uint32_t line1Index = i + 1; + // Since line indexes are 1-based, calculate a 1-based value + // for this track to simplify some calculations. + const uint32_t line1Index = i + 1; startOfNextTrack = (i < aTrackInfo->mEndFragmentTrack) ? aTrackInfo->mPositions[i] : @@ -127,7 +129,8 @@ GridLines::SetLineInfo(const ComputedGridTrackInfo* aTrackInfo, } } - if (i >= aTrackInfo->mRepeatFirstTrack && + if (i >= (aTrackInfo->mRepeatFirstTrack + + aTrackInfo->mNumLeadingImplicitTracks) && repeatIndex < numRepeatTracks) { numAddedLines += AppendRemovedAutoFits(aTrackInfo, aLineInfo, @@ -139,23 +142,30 @@ GridLines::SetLineInfo(const ComputedGridTrackInfo* aTrackInfo, RefPtr<GridLine> line = new GridLine(this); mLines.AppendElement(line); + MOZ_ASSERT(line1Index > 0, "line1Index must be positive."); + bool isBeforeFirstExplicit = + (line1Index <= aTrackInfo->mNumLeadingImplicitTracks); + // Calculate an actionable line number for this line, that could be used + // in a css grid property to align a grid item or area at that line. + // For implicit lines that appear before line 1, report a number of 0. + // We can't report negative indexes, because those have a different + // meaning in the css grid spec (negative indexes are negative-1-based + // from the end of the grid decreasing towards the front). + uint32_t lineNumber = isBeforeFirstExplicit ? 0 : + (line1Index - aTrackInfo->mNumLeadingImplicitTracks + numAddedLines); + GridDeclaration lineType = + (isBeforeFirstExplicit || + line1Index > (aTrackInfo->mNumLeadingImplicitTracks + + aTrackInfo->mNumExplicitTracks + 1)) + ? GridDeclaration::Implicit + : GridDeclaration::Explicit; line->SetLineValues( lineNames, nsPresContext::AppUnitsToDoubleCSSPixels(lastTrackEdge), nsPresContext::AppUnitsToDoubleCSSPixels(startOfNextTrack - lastTrackEdge), - line1Index + numAddedLines, - ( - // Implicit if there are no explicit tracks, or if the index - // is before the first explicit track, or after - // a track beyond the last explicit track. - (aTrackInfo->mNumExplicitTracks == 0) || - (i < aTrackInfo->mNumLeadingImplicitTracks) || - (i > aTrackInfo->mNumLeadingImplicitTracks + - aTrackInfo->mNumExplicitTracks) ? - GridDeclaration::Implicit : - GridDeclaration::Explicit - ) + lineNumber, + lineType ); if (i < aTrackInfo->mEndFragmentTrack) { @@ -215,11 +225,13 @@ GridLines::AppendRemovedAutoFits(const ComputedGridTrackInfo* aTrackInfo, RefPtr<GridLine> line = new GridLine(this); mLines.AppendElement(line); + uint32_t lineNumber = aTrackInfo->mRepeatFirstTrack + + aRepeatIndex + 1; line->SetLineValues( aLineNames, nsPresContext::AppUnitsToDoubleCSSPixels(aLastTrackEdge), nsPresContext::AppUnitsToDoubleCSSPixels(0), - aTrackInfo->mRepeatFirstTrack + aRepeatIndex + 1, + lineNumber, GridDeclaration::Explicit ); diff --git a/dom/grid/test/chrome.ini b/dom/grid/test/chrome.ini index 2241cf9eb..169fa9b89 100644 --- a/dom/grid/test/chrome.ini +++ b/dom/grid/test/chrome.ini @@ -2,6 +2,7 @@ [chrome/test_grid_fragmentation.html] [chrome/test_grid_implicit.html] [chrome/test_grid_lines.html] +[chrome/test_grid_line_numbers.html] [chrome/test_grid_object.html] [chrome/test_grid_repeats.html] [chrome/test_grid_tracks.html] diff --git a/dom/grid/test/chrome/test_grid_implicit.html b/dom/grid/test/chrome/test_grid_implicit.html index c7782e0e5..1f7142658 100644 --- a/dom/grid/test/chrome/test_grid_implicit.html +++ b/dom/grid/test/chrome/test_grid_implicit.html @@ -33,6 +33,11 @@ body { grid-template-rows: [areaA-end areaB-start areaC-end] 50px [areaA-start areaB-end areaC-start]; } +.template4 { + grid-template-columns: 100px 50px 100px; + grid-template-rows: 50px; +} + .box { background-color: #444; color: #fff; @@ -50,6 +55,9 @@ body { .d { grid-area: areaD; } +.e { + grid-column: -7 / 5; +} </style> <script> @@ -78,9 +86,12 @@ function runTests() { is(grid.cols.lines[4].type, "implicit", "Grid column line 5 is implicit."); is(grid.cols.lines[5].type, "implicit", "Grid column line 6 is implicit."); - is(grid.rows.lines[0].type, "implicit", "Grid row line 1 is implicit."); - is(grid.rows.lines[1].type, "explicit", "Grid row line 2 is explicit."); - is(grid.rows.lines[3].type, "explicit", "Grid row line 4 is explicit."); + is(grid.rows.lines[0].type, "implicit", "Grid row line 0 is implicit."); + is(grid.rows.lines[0].number, 0, "Grid row line 0 has correct number."); + is(grid.rows.lines[1].type, "explicit", "Grid row line 1 is explicit."); + is(grid.rows.lines[1].number, 1, "Grid row line 1 has correct number."); + is(grid.rows.lines[3].type, "explicit", "Grid row line 3 is explicit."); + is(grid.rows.lines[3].number, 3, "Grid row line 3 has correct number."); // test that row line 1 gets the name forced on it by placement of item B todo_isnot(grid.rows.lines[0].names.indexOf("got-this-name-implicitly"), -1, @@ -221,6 +232,48 @@ function runTests() { } } + // test the fourth grid wrapper + wrapper = document.getElementById("wrapper4"); + grid = wrapper.getGridFragments()[0]; + + // test column and row line counts + is(grid.cols.lines.length, 8, + "Grid.cols.lines property expands properly with implicit columns on both sides." + ); + is(grid.rows.lines.length, 2, + "Grid.rows.lines property is as expected" + ); + + if (grid.cols.lines.length == 8) { + // check that all the lines get correct implict/explicit type and number + let expectedType = [ + "implicit", + "implicit", + "implicit", + "explicit", + "explicit", + "explicit", + "explicit", + "implicit", + ]; + let expectedNumber = [ + 0, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + ]; + + for (let i = 0; i < grid.cols.lines.length; i++) { + let line = grid.cols.lines[i]; + is(line.type, expectedType[i], "Line index " + i + " has expected type."); + is(line.number, expectedNumber[i], "Line index " + i + " has expected number."); + } + } + SimpleTest.finish(); } </script> @@ -246,5 +299,9 @@ function runTests() { <div id="boxC" class="box c">C</div> </div> + <div id="wrapper4" class="wrapper template4"> + <div id="boxE" class="box e">E</div> + </div> + </body> </html> diff --git a/dom/grid/test/chrome/test_grid_line_numbers.html b/dom/grid/test/chrome/test_grid_line_numbers.html new file mode 100644 index 000000000..c8e5226b6 --- /dev/null +++ b/dom/grid/test/chrome/test_grid_line_numbers.html @@ -0,0 +1,101 @@ +<!doctype html> +<html> +<head> +<meta charset="utf-8"> +<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> +<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> +<style> +body { + margin: 40px; +} +.wrapper { + display: grid; + grid-gap: 0px; + background-color: #f00; +} +.wrapper > div { + background-color: #444; + color: #fff; +} +.repeatColumns { + width: 600px; + grid-auto-columns: 50px; + grid-template-columns: repeat(auto-fit, 100px); +} +.repeatRows { + height: 600px; + grid-auto-rows: 50px; + grid-template-rows: repeat(auto-fit, 100px); +} +</style> + +<script> +'use strict'; + +SimpleTest.waitForExplicitFinish(); + +function testLines(elementName, lines, expectedValues) { + is(lines.count, expectedValues.count, elementName + " has expected number of lines."); + for (let i = 0; i < lines.length; i++) { + is(lines[i].number, expectedValues[i].number, elementName + " line index " + i + " has expected number."); + } +} + +function runTests() { + let grid; + let lines; + let expectedValues; + + grid = document.getElementById("gridWithColumns").getGridFragments()[0]; + lines = grid.cols.lines; + expectedValues = [ + { "number": 0 }, + { "number": 0 }, + { "number": 1 }, + { "number": 2 }, + { "number": 3 }, + { "number": 4 }, + { "number": 5 }, + { "number": 6 }, + { "number": 7 }, + { "number": 8 }, + ]; + testLines("gridWithColumns", lines, expectedValues); + + grid = document.getElementById("gridWithRows").getGridFragments()[0]; + lines = grid.rows.lines; + expectedValues = [ + { "number": 0 }, + { "number": 0 }, + { "number": 1 }, + { "number": 2 }, + { "number": 3 }, + { "number": 4 }, + { "number": 5 }, + { "number": 6 }, + { "number": 7 }, + { "number": 8 }, + ]; + testLines("gridWithRows", lines, expectedValues); + + SimpleTest.finish(); +} +</script> +</head> +<body onLoad="runTests();"> + +<div id="gridWithColumns" class="wrapper repeatColumns"> +<div style="grid-column: -9">A</div> +<div style="grid-column: 4">B</div> +<div style="grid-column: 7">C</div> +</div> + +<div id="gridWithRows" class="wrapper repeatRows"> +<div style="grid-row: span 3 / 2">A</div> +<div style="grid-row: 4">B</div> +<div style="grid-row: 5">C</div> +<div style="grid-row: span 2 / 8">D</div> +</div> + +</body> +</html> diff --git a/dom/html/ImageDocument.cpp b/dom/html/ImageDocument.cpp index f83a804be..451d989c3 100644 --- a/dom/html/ImageDocument.cpp +++ b/dom/html/ImageDocument.cpp @@ -659,7 +659,7 @@ ImageDocument::CreateSyntheticDocument() NS_ENSURE_SUCCESS(rv, rv); // Add the image element - Element* body = GetBodyElement(); + RefPtr<Element> body = GetBodyElement(); if (!body) { NS_WARNING("no body on image document!"); return NS_ERROR_FAILURE; diff --git a/dom/html/PluginDocument.cpp b/dom/html/PluginDocument.cpp index 1c923ecc6..f6be8a915 100644 --- a/dom/html/PluginDocument.cpp +++ b/dom/html/PluginDocument.cpp @@ -206,7 +206,7 @@ PluginDocument::CreateSyntheticPluginDocument() NS_ENSURE_SUCCESS(rv, rv); // then attach our plugin - Element* body = GetBodyElement(); + RefPtr<Element> body = GetBodyElement(); if (!body) { NS_WARNING("no body on plugin document!"); return NS_ERROR_FAILURE; diff --git a/dom/html/VideoDocument.cpp b/dom/html/VideoDocument.cpp index 1bd898564..76b2e326f 100644 --- a/dom/html/VideoDocument.cpp +++ b/dom/html/VideoDocument.cpp @@ -90,7 +90,7 @@ VideoDocument::CreateSyntheticVideoDocument(nsIChannel* aChannel, nsresult rv = MediaDocument::CreateSyntheticDocument(); NS_ENSURE_SUCCESS(rv, rv); - Element* body = GetBodyElement(); + RefPtr<Element> body = GetBodyElement(); if (!body) { NS_WARNING("no body on video document!"); return NS_ERROR_FAILURE; diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini index 99b425df8..f619be5df 100644 --- a/dom/html/test/mochitest.ini +++ b/dom/html/test/mochitest.ini @@ -553,7 +553,6 @@ skip-if = true # Disabled for timeouts. [test_viewport.html] [test_documentAll.html] [test_document-element-inserted.html] -[test_document.watch.html] [test_bug445004.html] skip-if = true || toolkit == 'android' # Disabled permanently (bug 559932). [test_bug446483.html] diff --git a/dom/html/test/test_document.watch.html b/dom/html/test/test_document.watch.html deleted file mode 100644 index 54509823b..000000000 --- a/dom/html/test/test_document.watch.html +++ /dev/null @@ -1,129 +0,0 @@ -<!DOCTYPE html> -<html> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=903332 ---> -<head> - <meta charset="utf-8"> - <title>Test for Bug 903332</title> - <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> - <script type="application/javascript"> - - /** Test for Bug 903332 **/ - - var watch1Called; - function watch1(prop, oldValue, newValue) - { - is(watch1Called, false, "watch1Called not reset properly?"); - watch1Called = true; - - is(prop, "cookie", "wrong property name passed to watch1"); - return newValue; - } - - var watch2Called; - function watch2(prop, oldValue, newValue) - { - is(watch2Called, false, "watch2Called not reset properly?"); - watch2Called = true; - - is(prop, "cookie", "wrong property name passed to watch2"); - return newValue; - } - - // Just in case subsequent tests depend on a particular value... - var originalValue = document.cookie; - ok(true, "originalValue: " + originalValue); - - var originalPrefix = originalValue.length > 0 ? originalValue + "; " : ""; - - try - { - // trial set (no watch) to verify things work - document.cookie = "first=set"; - is(document.cookie, originalPrefix + "first=set", - "first value correct"); - - // add a watch - document.watch("cookie", watch1); - - // set, check for watch invoked - watch1Called = false; - document.cookie = "second=set"; - is(watch1Called, true, "watch1 function should be called"); - is(document.cookie, originalPrefix + "first=set; second=set", - "second value correct"); - - // and a second time, just in case - watch1Called = false; - document.cookie = "third=set"; - is(watch1Called, true, "watch1 function should be called"); - is(document.cookie, originalPrefix + "first=set; second=set; third=set", - "third value correct"); - - // overwrite the current watch with a new one - document.watch("cookie", watch2); - - // set, check for watch invoked - watch1Called = false; - watch2Called = false; - document.cookie = "fourth=set"; - is(watch1Called, false, "watch1 invoked erroneously"); - is(watch2Called, true, "watch2 function should be called"); - is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set", - "fourth value correct"); - - // and a second time, just in case - watch1Called = false; - watch2Called = false; - document.cookie = "fifth=set"; - is(watch1Called, false, "watch1 invoked erroneously"); - is(watch2Called, true, "watch2 function should be called"); - is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set; fifth=set", - "fifth value correct"); - - // remove the watch - document.unwatch("cookie"); - - // check for non-invocation now - watch1Called = false; - watch2Called = false; - document.cookie = "sixth=set"; - is(watch1Called, false, "watch1 shouldn't be called"); - is(watch2Called, false, "watch2 shouldn't be called"); - is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set; fifth=set; sixth=set", - "sixth value correct"); - } - finally - { - // reset - document.unwatch("cookie"); // harmless, should be no-op except if bugs - - var d = new Date(); - d.setTime(0); - var suffix = "=; expires=" + d.toGMTString(); - - document.cookie = "first" + suffix; - document.cookie = "second" + suffix; - document.cookie = "third" + suffix; - document.cookie = "fourth" + suffix; - document.cookie = "fifth" + suffix; - document.cookie = "sixth" + suffix; - } - - is(document.cookie, originalValue, - "document.cookie isn't what it was initially! expect bustage further " + - "down the line"); - </script> -</head> -<body> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=903332">Mozilla Bug 903332</a> -<p id="display"></p> -<div id="content" style="display: none"> - -</div> -<pre id="test"> -</pre> -</body> -</html> diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index af88742f0..be0295dc7 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -430,7 +430,7 @@ IDBCursor::Continue(JSContext* aCx, } Key key; - aRv = key.SetFromJSVal(aCx, aKey); + aRv = key.SetFromJSVal(aCx, aKey, /* aCallGetters */ true); if (aRv.Failed()) { return; } @@ -536,7 +536,7 @@ IDBCursor::ContinuePrimaryKey(JSContext* aCx, } Key key; - aRv = key.SetFromJSVal(aCx, aKey); + aRv = key.SetFromJSVal(aCx, aKey, /* aCallGetters */ true); if (aRv.Failed()) { return; } @@ -558,7 +558,7 @@ IDBCursor::ContinuePrimaryKey(JSContext* aCx, } Key primaryKey; - aRv = primaryKey.SetFromJSVal(aCx, aPrimaryKey); + aRv = primaryKey.SetFromJSVal(aCx, aPrimaryKey, /* aCallGetters */ true); if (aRv.Failed()) { return; } @@ -718,7 +718,7 @@ IDBCursor::Update(JSContext* aCx, JS::Handle<JS::Value> aValue, const KeyPath& keyPath = objectStore->GetKeyPath(); Key key; - aRv = keyPath.ExtractKey(aCx, aValue, key); + aRv = keyPath.ExtractKey(aCx, aValue, key, /* aCallGetters */ false); if (aRv.Failed()) { return nullptr; } diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp index 5592e7f93..6ef352801 100644 --- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -1257,6 +1257,9 @@ IDBDatabase::LastRelease() AssertIsOnOwningThread(); CloseInternal(); + + // Make sure that file actors created after the database was closed are expired. + ExpireFileActors(/* aExpireAll */ true); if (mBackgroundActor) { mBackgroundActor->SendDeleteMeInternal(); diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp index c1ef6353d..66471fe24 100644 --- a/dom/indexedDB/IDBFactory.cpp +++ b/dom/indexedDB/IDBFactory.cpp @@ -482,13 +482,13 @@ IDBFactory::Cmp(JSContext* aCx, JS::Handle<JS::Value> aFirst, JS::Handle<JS::Value> aSecond, ErrorResult& aRv) { Key first, second; - nsresult rv = first.SetFromJSVal(aCx, aFirst); + nsresult rv = first.SetFromJSVal(aCx, aFirst, /* aCallGetters */ true); if (NS_FAILED(rv)) { aRv.Throw(rv); return 0; } - rv = second.SetFromJSVal(aCx, aSecond); + rv = second.SetFromJSVal(aCx, aSecond, /* aCallGetters */ true); if (NS_FAILED(rv)) { aRv.Throw(rv); return 0; diff --git a/dom/indexedDB/IDBKeyRange.cpp b/dom/indexedDB/IDBKeyRange.cpp index e61c80617..168fb4a5a 100644 --- a/dom/indexedDB/IDBKeyRange.cpp +++ b/dom/indexedDB/IDBKeyRange.cpp @@ -24,7 +24,7 @@ GetKeyFromJSVal(JSContext* aCx, JS::Handle<JS::Value> aVal, Key& aKey) { - nsresult rv = aKey.SetFromJSVal(aCx, aVal); + nsresult rv = aKey.SetFromJSVal(aCx, aVal, /* aCallGetters */ true); if (NS_FAILED(rv)) { MOZ_ASSERT(NS_ERROR_GET_MODULE(rv) == NS_ERROR_MODULE_DOM_INDEXEDDB); return rv; diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index 756792741..cbac30894 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -1084,7 +1084,7 @@ IDBObjectStore::AppendIndexUpdateInfo( if (!aMultiEntry) { Key key; - rv = aKeyPath.ExtractKey(aCx, aVal, key); + rv = aKeyPath.ExtractKey(aCx, aVal, key, /* aCallGetters */ false); // If an index's keyPath doesn't match an object, we ignore that object. if (rv == NS_ERROR_DOM_INDEXEDDB_DATA_ERR || key.IsUnset()) { @@ -1114,7 +1114,7 @@ IDBObjectStore::AppendIndexUpdateInfo( } bool isArray; - if (!JS_IsArrayObject(aCx, val, &isArray)) { + if (NS_WARN_IF(!JS_IsArrayObject(aCx, val, &isArray))) { IDB_REPORT_INTERNAL_ERR(); return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; } @@ -1127,14 +1127,31 @@ IDBObjectStore::AppendIndexUpdateInfo( } for (uint32_t arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) { - JS::Rooted<JS::Value> arrayItem(aCx); - if (NS_WARN_IF(!JS_GetElement(aCx, array, arrayIndex, &arrayItem))) { + JS::RootedId indexId(aCx);
+ if (NS_WARN_IF(!JS_IndexToId(aCx, arrayIndex, &indexId))) {
+ IDB_REPORT_INTERNAL_ERR();
+ return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
+ }
+
+ bool hasOwnProperty;
+ if (NS_WARN_IF(
+ !JS_HasOwnPropertyById(aCx, array, indexId, &hasOwnProperty))) {
+ IDB_REPORT_INTERNAL_ERR();
+ return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
+ }
+
+ if (!hasOwnProperty) {
+ continue;
+ }
+
+ JS::RootedValue arrayItem(aCx);
+ if (NS_WARN_IF(!JS_GetPropertyById(aCx, array, indexId, &arrayItem))) { IDB_REPORT_INTERNAL_ERR(); return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; } Key value; - if (NS_FAILED(value.SetFromJSVal(aCx, arrayItem)) || + if (NS_FAILED(value.SetFromJSVal(aCx, arrayItem, /* aCallGetters */ false)) || value.IsUnset()) { // Not a value we can do anything with, ignore it. continue; @@ -1153,7 +1170,7 @@ IDBObjectStore::AppendIndexUpdateInfo( } else { Key value; - if (NS_FAILED(value.SetFromJSVal(aCx, val)) || + if (NS_FAILED(value.SetFromJSVal(aCx, val, /* aCallGetters */ false)) || value.IsUnset()) { // Not a value we can do anything with, ignore it. return NS_OK; @@ -1324,12 +1341,12 @@ IDBObjectStore::GetAddInfo(JSContext* aCx, if (!HasValidKeyPath()) { // Out-of-line keys must be passed in. - rv = aKey.SetFromJSVal(aCx, aKeyVal); + rv = aKey.SetFromJSVal(aCx, aKeyVal, /* aCallGetters */ true); if (NS_FAILED(rv)) { return rv; } } else if (!isAutoIncrement) { - rv = GetKeyPath().ExtractKey(aCx, aValue, aKey); + rv = GetKeyPath().ExtractKey(aCx, aValue, aKey, /* aCallGetters */ false); if (NS_FAILED(rv)) { return rv; } @@ -1368,7 +1385,8 @@ IDBObjectStore::GetAddInfo(JSContext* aCx, aValue, aKey, &GetAddInfoCallback, - &data); + &data, + /* aCallGetters */ false); } else { rv = GetAddInfoCallback(aCx, &data); } diff --git a/dom/indexedDB/Key.cpp b/dom/indexedDB/Key.cpp index 0f693b2c6..575734af2 100644 --- a/dom/indexedDB/Key.cpp +++ b/dom/indexedDB/Key.cpp @@ -201,8 +201,11 @@ Key::ToLocaleBasedKey(Key& aTarget, const nsCString& aLocale) const } nsresult -Key::EncodeJSValInternal(JSContext* aCx, JS::Handle<JS::Value> aVal, - uint8_t aTypeOffset, uint16_t aRecursionDepth) +Key::EncodeJSValInternal(JSContext* aCx, + JS::Handle<JS::Value> aVal, + uint8_t aTypeOffset, + uint16_t aRecursionDepth, + bool aCallGetters) { static_assert(eMaxType * kMaxArrayCollapse < 256, "Unable to encode jsvals."); @@ -257,13 +260,18 @@ Key::EncodeJSValInternal(JSContext* aCx, JS::Handle<JS::Value> aVal, for (uint32_t index = 0; index < length; index++) { JS::Rooted<JS::Value> val(aCx); - if (!JS_GetElement(aCx, obj, index, &val)) { + bool ok = aCallGetters ? JS_GetElement(aCx, obj, index, &val) + : JS_GetOwnElement(aCx, obj, index, &val); + if (!ok) { IDB_REPORT_INTERNAL_ERR(); return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; } - nsresult rv = EncodeJSValInternal(aCx, val, aTypeOffset, - aRecursionDepth + 1); + nsresult rv = EncodeJSValInternal(aCx, + val, + aTypeOffset, + aRecursionDepth + 1, + aCallGetters); if (NS_FAILED(rv)) { return rv; } @@ -406,9 +414,10 @@ Key::DecodeJSValInternal(const unsigned char*& aPos, const unsigned char* aEnd, nsresult Key::EncodeJSVal(JSContext* aCx, JS::Handle<JS::Value> aVal, - uint8_t aTypeOffset) + uint8_t aTypeOffset, + bool aCallGetters) { - return EncodeJSValInternal(aCx, aVal, aTypeOffset, 0); + return EncodeJSValInternal(aCx, aVal, aTypeOffset, 0, aCallGetters); } void @@ -741,7 +750,8 @@ Key::SetFromValueArray(mozIStorageValueArray* aValues, nsresult Key::SetFromJSVal(JSContext* aCx, - JS::Handle<JS::Value> aVal) + JS::Handle<JS::Value> aVal, + bool aCallGetters) { mBuffer.Truncate(); @@ -750,7 +760,7 @@ Key::SetFromJSVal(JSContext* aCx, return NS_OK; } - nsresult rv = EncodeJSVal(aCx, aVal, 0); + nsresult rv = EncodeJSVal(aCx, aVal, 0, aCallGetters); if (NS_FAILED(rv)) { Unset(); return rv; @@ -793,9 +803,15 @@ Key::ToJSVal(JSContext* aCx, } nsresult -Key::AppendItem(JSContext* aCx, bool aFirstOfArray, JS::Handle<JS::Value> aVal) +Key::AppendItem(JSContext* aCx, + bool aFirstOfArray, + JS::Handle<JS::Value> aVal, + bool aCallGetters) { - nsresult rv = EncodeJSVal(aCx, aVal, aFirstOfArray ? eMaxType : 0); + nsresult rv = EncodeJSVal(aCx, + aVal, + aFirstOfArray ? eMaxType : 0, + aCallGetters); if (NS_FAILED(rv)) { Unset(); return rv; diff --git a/dom/indexedDB/Key.h b/dom/indexedDB/Key.h index 9d70ce6ad..a4fb65b48 100644 --- a/dom/indexedDB/Key.h +++ b/dom/indexedDB/Key.h @@ -203,7 +203,7 @@ public: } nsresult - SetFromJSVal(JSContext* aCx, JS::Handle<JS::Value> aVal); + SetFromJSVal(JSContext* aCx, JS::Handle<JS::Value> aVal, bool aCallGetters); nsresult ToJSVal(JSContext* aCx, JS::MutableHandle<JS::Value> aVal) const; @@ -212,7 +212,10 @@ public: ToJSVal(JSContext* aCx, JS::Heap<JS::Value>& aVal) const; nsresult - AppendItem(JSContext* aCx, bool aFirstOfArray, JS::Handle<JS::Value> aVal); + AppendItem(JSContext* aCx, + bool aFirstOfArray, + JS::Handle<JS::Value> aVal, + bool aCallGetters); nsresult ToLocaleBasedKey(Key& aTarget, const nsCString& aLocale) const; @@ -283,7 +286,10 @@ private: // Encoding functions. These append the encoded value to the end of mBuffer nsresult - EncodeJSVal(JSContext* aCx, JS::Handle<JS::Value> aVal, uint8_t aTypeOffset); + EncodeJSVal(JSContext* aCx, + JS::Handle<JS::Value> aVal, + uint8_t aTypeOffset, + bool aCallGetters); void EncodeString(const nsAString& aString, uint8_t aTypeOffset); @@ -331,7 +337,8 @@ private: EncodeJSValInternal(JSContext* aCx, JS::Handle<JS::Value> aVal, uint8_t aTypeOffset, - uint16_t aRecursionDepth); + uint16_t aRecursionDepth, + bool aCallGetters); static nsresult DecodeJSValInternal(const unsigned char*& aPos, diff --git a/dom/indexedDB/KeyPath.cpp b/dom/indexedDB/KeyPath.cpp index 30edd8cd7..0221c9450 100644 --- a/dom/indexedDB/KeyPath.cpp +++ b/dom/indexedDB/KeyPath.cpp @@ -372,11 +372,13 @@ KeyPath::AppendStringWithValidation(const nsAString& aString) } nsresult -KeyPath::ExtractKey(JSContext* aCx, const JS::Value& aValue, Key& aKey) const +KeyPath::ExtractKey(JSContext* aCx, + const JS::Value& aValue, + Key& aKey, + bool aCallGetters) const { uint32_t len = mStrings.Length(); JS::Rooted<JS::Value> value(aCx); - aKey.Unset(); for (uint32_t i = 0; i < len; ++i) { @@ -388,7 +390,10 @@ KeyPath::ExtractKey(JSContext* aCx, const JS::Value& aValue, Key& aKey) const return rv; } - if (NS_FAILED(aKey.AppendItem(aCx, IsArray() && i == 0, value))) { + if (NS_FAILED(aKey.AppendItem(aCx, + IsArray() && i == 0, + value, + aCallGetters))) { NS_ASSERTION(aKey.IsUnset(), "Encoding error should unset"); return NS_ERROR_DOM_INDEXEDDB_DATA_ERR; } @@ -437,9 +442,12 @@ KeyPath::ExtractKeyAsJSVal(JSContext* aCx, const JS::Value& aValue, } nsresult -KeyPath::ExtractOrCreateKey(JSContext* aCx, const JS::Value& aValue, - Key& aKey, ExtractOrCreateKeyCallback aCallback, - void* aClosure) const +KeyPath::ExtractOrCreateKey(JSContext* aCx, + const JS::Value& aValue, + Key& aKey, + ExtractOrCreateKeyCallback aCallback, + void* aClosure, + bool aCallGetters) const { NS_ASSERTION(IsString(), "This doesn't make sense!"); @@ -455,7 +463,7 @@ KeyPath::ExtractOrCreateKey(JSContext* aCx, const JS::Value& aValue, return rv; } - if (NS_FAILED(aKey.AppendItem(aCx, false, value))) { + if (NS_FAILED(aKey.AppendItem(aCx, false, value, aCallGetters))) { NS_ASSERTION(aKey.IsUnset(), "Should be unset"); return value.isUndefined() ? NS_OK : NS_ERROR_DOM_INDEXEDDB_DATA_ERR; } diff --git a/dom/indexedDB/KeyPath.h b/dom/indexedDB/KeyPath.h index c133cdc4a..e6e5f57d4 100644 --- a/dom/indexedDB/KeyPath.h +++ b/dom/indexedDB/KeyPath.h @@ -72,7 +72,10 @@ public: Parse(const Nullable<OwningStringOrStringSequence>& aValue, KeyPath* aKeyPath); nsresult - ExtractKey(JSContext* aCx, const JS::Value& aValue, Key& aKey) const; + ExtractKey(JSContext* aCx, + const JS::Value& aValue, + Key& aKey, + bool aCallGetters) const; nsresult ExtractKeyAsJSVal(JSContext* aCx, const JS::Value& aValue, @@ -82,9 +85,12 @@ public: (*ExtractOrCreateKeyCallback)(JSContext* aCx, void* aClosure); nsresult - ExtractOrCreateKey(JSContext* aCx, const JS::Value& aValue, Key& aKey, + ExtractOrCreateKey(JSContext* aCx, + const JS::Value& aValue, + Key& aKey, ExtractOrCreateKeyCallback aCallback, - void* aClosure) const; + void* aClosure, + bool aCallGetters) const; inline bool IsValid() const { return mType != NONEXISTENT; diff --git a/dom/media/AudioStream.h b/dom/media/AudioStream.h index acc38b93d..199314d4b 100644 --- a/dom/media/AudioStream.h +++ b/dom/media/AudioStream.h @@ -17,6 +17,10 @@ #include "mozilla/UniquePtr.h" #include "CubebUtils.h" #include "soundtouch/SoundTouchFactory.h" +#ifdef XP_SOLARIS +#include "soundtouch/SoundTouch.h" +#endif + namespace mozilla { diff --git a/dom/plugins/base/npapi.h b/dom/plugins/base/npapi.h index 12ac635c7..e554aaabc 100644 --- a/dom/plugins/base/npapi.h +++ b/dom/plugins/base/npapi.h @@ -327,9 +327,12 @@ typedef enum { #define NP_ABI_GCC3_MASK 0x10000000 /* * gcc 3.x generated vtables on UNIX and OSX are incompatible with - * previous compilers. + * previous compilers. Flash plugin binaries for Solaris were compiled + * with Sun Studio, so this has to be false to make things work. This may + * become a problem in the future when/if new plugins are compiled with + * GCC, however. */ -#if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3)) +#if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3) && !defined(XP_SOLARIS)) #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK #else #define _NP_ABI_MIXIN_FOR_GCC3 0 diff --git a/dom/plugins/base/nptypes.h b/dom/plugins/base/nptypes.h index c36532472..d0cef6540 100644 --- a/dom/plugins/base/nptypes.h +++ b/dom/plugins/base/nptypes.h @@ -22,6 +22,19 @@ typedef unsigned int uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; +#elif defined(__sun) + /* + * SunOS ships an inttypes.h header that defines [u]int32_t, + * but not bool for C. + */ + #include <inttypes.h> + + + #ifndef __cplusplus + typedef int bool; + #define true 1 + #define false 0 + #endif #elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) /* * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 05e0ec4ba..1d42c18d6 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -248,7 +248,6 @@ const static js::ObjectOps sNPObjectJSWrapperObjectOps = { nullptr, // setProperty nullptr, // getOwnPropertyDescriptor nullptr, // deleteProperty - nullptr, nullptr, // watch/unwatch nullptr, // getElements NPObjWrapper_Enumerate, nullptr, diff --git a/dom/plugins/base/nsPluginsDirUnix.cpp b/dom/plugins/base/nsPluginsDirUnix.cpp index e6956c34c..de3b7a2d1 100644 --- a/dom/plugins/base/nsPluginsDirUnix.cpp +++ b/dom/plugins/base/nsPluginsDirUnix.cpp @@ -19,7 +19,9 @@ #include "nsIPrefService.h" #define LOCAL_PLUGIN_DLL_SUFFIX ".so" -#if defined(LINUX) +#ifdef XP_SOLARIS +#define DEFAULT_X11_PATH "/usr/openwin/lib" +#elif defined(LINUX) #define DEFAULT_X11_PATH "/usr/X11R6/lib/" #elif defined(__APPLE__) #define DEFAULT_X11_PATH "/usr/X11R6/lib" @@ -92,7 +94,11 @@ static bool LoadExtraSharedLib(const char *name, char **soname, bool tryToGetSon #define PLUGIN_MAX_NUMBER_OF_EXTRA_LIBS 32 #define PREF_PLUGINS_SONAME "plugin.soname.list" +#ifdef XP_SOLARIS +#define DEFAULT_EXTRA_LIBS_LIST "libXt" LOCAL_PLUGIN_DLL_SUFFIX ":libXext" LOCAL_PLUGIN_DLL_SUFFIX ":libXm" LOCAL_PLUGIN_DLL_SUFFIX +#else #define DEFAULT_EXTRA_LIBS_LIST "libXt" LOCAL_PLUGIN_DLL_SUFFIX ":libXext" LOCAL_PLUGIN_DLL_SUFFIX +#endif /* this function looks for user_pref("plugin.soname.list", "/usr/X11R6/lib/libXt.so.6:libXext.so"); @@ -264,11 +270,15 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary) // at runtime. Explicitly opening Xt/Xext into the global // namespace before attempting to load the plug-in seems to // work fine. - - +#if defined(XP_SOLARIS) + // Acrobat/libXm: Lazy resolving might cause crash later (bug 211587) + *outLibrary = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW); + pLibrary = *outLibrary; +#else // Some dlopen() doesn't recover from a failed PR_LD_NOW (bug 223744) *outLibrary = PR_LoadLibraryWithFlags(libSpec, 0); pLibrary = *outLibrary; +#endif if (!pLibrary) { LoadExtraSharedLibs(); // try reload plugin once more diff --git a/dom/plugins/ipc/PluginMessageUtils.cpp b/dom/plugins/ipc/PluginMessageUtils.cpp index 47653fe6e..5b1d1667f 100644 --- a/dom/plugins/ipc/PluginMessageUtils.cpp +++ b/dom/plugins/ipc/PluginMessageUtils.cpp @@ -82,7 +82,7 @@ MediateRace(const MessageChannel::MessageInfo& parent, } } -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) static string ReplaceAll(const string& haystack, const string& needle, const string& with) { @@ -101,7 +101,7 @@ ReplaceAll(const string& haystack, const string& needle, const string& with) string MungePluginDsoPath(const string& path) { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) // https://bugzilla.mozilla.org/show_bug.cgi?id=519601 return ReplaceAll(path, "netscape", "netsc@pe"); #else @@ -112,7 +112,7 @@ MungePluginDsoPath(const string& path) string UnmungePluginDsoPath(const string& munged) { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) return ReplaceAll(munged, "netsc@pe", "netscape"); #else return munged; diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp index cbf6e509f..f943dfc42 100644 --- a/dom/plugins/ipc/PluginModuleChild.cpp +++ b/dom/plugins/ipc/PluginModuleChild.cpp @@ -286,7 +286,7 @@ PluginModuleChild::InitForChrome(const std::string& aPluginFilename, // TODO: use PluginPRLibrary here -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) mShutdownFunc = (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown"); @@ -1821,7 +1821,7 @@ PluginModuleChild::AnswerNP_GetEntryPoints(NPError* _retval) AssertPluginThread(); MOZ_ASSERT(mIsChrome); -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) return true; #elif defined(OS_WIN) || defined(OS_MACOSX) *_retval = mGetEntryPointsFunc(&mFunctions); @@ -1866,7 +1866,7 @@ PluginModuleChild::DoNP_Initialize(const PluginSettings& aSettings) #endif NPError result; -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) result = mInitializeFunc(&sBrowserFuncs, &mFunctions); #elif defined(OS_WIN) || defined(OS_MACOSX) result = mInitializeFunc(&sBrowserFuncs); diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h index 681743582..5e4fa7d20 100644 --- a/dom/plugins/ipc/PluginModuleChild.h +++ b/dom/plugins/ipc/PluginModuleChild.h @@ -258,7 +258,7 @@ private: // we get this from the plugin NP_PLUGINSHUTDOWN mShutdownFunc; -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) NP_PLUGINUNIXINIT mInitializeFunc; #elif defined(OS_WIN) || defined(OS_MACOSX) NP_PLUGININIT mInitializeFunc; diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index 65be02809..56a119e1a 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -513,8 +513,19 @@ nsCSPContext::GetAllowsInline(nsContentPolicyType aContentType, for (uint32_t i = 0; i < mPolicies.Length(); i++) { bool allowed = mPolicies[i]->allows(aContentType, CSP_UNSAFE_INLINE, EmptyString(), aParserCreated) || - mPolicies[i]->allows(aContentType, CSP_NONCE, aNonce, aParserCreated) || - mPolicies[i]->allows(aContentType, CSP_HASH, aContent, aParserCreated); + mPolicies[i]->allows(aContentType, CSP_NONCE, aNonce, aParserCreated); + + // If the inlined script or style is allowed by either unsafe-inline or the + // nonce, go ahead and shortcut this loop. + if (allowed) { + continue; + } + + // Check if the csp-hash matches against the hash of the script. + // If we don't have any content to check, block the script. + if (!aContent.IsEmpty()) { + allowed = mPolicies[i]->allows(aContentType, CSP_HASH, aContent, aParserCreated); + } if (!allowed) { // policy is violoated: deny the load unless policy is report only and diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp index 71c8e3433..d07ad7945 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -641,13 +641,22 @@ nsCSPHostSrc::permits(nsIURI* aUri, const nsAString& aNonce, bool aWasRedirected // just a specific scheme, the parser should generate a nsCSPSchemeSource. NS_ASSERTION((!mHost.IsEmpty()), "host can not be the empty string"); + // Before we can check if the host matches, we have to + // extract the host part from aUri. + nsAutoCString uriHost; + nsresult rv = aUri->GetAsciiHost(uriHost); + NS_ENSURE_SUCCESS(rv, false); + + nsString decodedUriHost; + CSP_PercentDecodeStr(NS_ConvertUTF8toUTF16(uriHost), decodedUriHost); + // 2) host matching: Enforce a single * if (mHost.EqualsASCII("*")) { // The single ASTERISK character (*) does not match a URI's scheme of a type // designating a globally unique identifier (such as blob:, data:, or filesystem:) - // At the moment firefox does not support filesystem; but for future compatibility + // At the moment UXP does not support "filesystem:" but for future compatibility // we support it in CSP according to the spec, see: 4.2.2 Matching Source Expressions - // Note, that whitelisting any of these schemes would call nsCSPSchemeSrc::permits(). + // Note: whitelisting any of these schemes would call nsCSPSchemeSrc::permits(). bool isBlobScheme = (NS_SUCCEEDED(aUri->SchemeIs("blob", &isBlobScheme)) && isBlobScheme); bool isDataScheme = @@ -658,20 +667,15 @@ nsCSPHostSrc::permits(nsIURI* aUri, const nsAString& aNonce, bool aWasRedirected if (isBlobScheme || isDataScheme || isFileScheme) { return false; } - return true; - } - - // Before we can check if the host matches, we have to - // extract the host part from aUri. - nsAutoCString uriHost; - nsresult rv = aUri->GetAsciiHost(uriHost); - NS_ENSURE_SUCCESS(rv, false); - - nsString decodedUriHost; - CSP_PercentDecodeStr(NS_ConvertUTF8toUTF16(uriHost), decodedUriHost); + // If no scheme is present there also won't be a port and folder to check + // which means we can return early. + if (mScheme.IsEmpty()) { + return true; + } + } // 4.5) host matching: Check if the allowed host starts with a wilcard. - if (mHost.First() == '*') { + else if (mHost.First() == '*') { NS_ASSERTION(mHost[1] == '.', "Second character needs to be '.' whenever host starts with '*'"); // Eliminate leading "*", but keeping the FULL STOP (.) thereafter before checking diff --git a/dom/svg/crashtests/880544-1.svg b/dom/svg/crashtests/880544-1.svg deleted file mode 100644 index 9052d2396..000000000 --- a/dom/svg/crashtests/880544-1.svg +++ /dev/null @@ -1,15 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg">
- <script>//<![CDATA[
-
-function add_watch()
-{
- document.getElementById("p").transform.baseVal.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
- //]]></script>
-
- <path id="p" transform="scale(1)" />
-
-</svg>
diff --git a/dom/svg/crashtests/880544-2.svg b/dom/svg/crashtests/880544-2.svg deleted file mode 100644 index 7570c7cbf..000000000 --- a/dom/svg/crashtests/880544-2.svg +++ /dev/null @@ -1,15 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg">
- <script>//<![CDATA[
-
-function add_watch()
-{
- document.getElementById("e").x.baseVal.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
- //]]></script>
-
- <text id="e" x="10">foo</text>
-
-</svg>
diff --git a/dom/svg/crashtests/880544-3.svg b/dom/svg/crashtests/880544-3.svg deleted file mode 100644 index 5791b8ec6..000000000 --- a/dom/svg/crashtests/880544-3.svg +++ /dev/null @@ -1,15 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg">
- <script>//<![CDATA[
-
-function add_watch()
-{
- document.getElementById("e").rotate.baseVal.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
- //]]></script>
-
- <text id="e" rotate="10">foo</text>
-
-</svg>
diff --git a/dom/svg/crashtests/880544-4.svg b/dom/svg/crashtests/880544-4.svg deleted file mode 100644 index 7bdb80f47..000000000 --- a/dom/svg/crashtests/880544-4.svg +++ /dev/null @@ -1,15 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg">
- <script>//<![CDATA[
-
-function add_watch()
-{
- document.getElementById("e").pathSegList.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
- //]]></script>
-
- <path id="e" d="M0,0"/>
-
-</svg>
diff --git a/dom/svg/crashtests/880544-5.svg b/dom/svg/crashtests/880544-5.svg deleted file mode 100644 index ef7f468f8..000000000 --- a/dom/svg/crashtests/880544-5.svg +++ /dev/null @@ -1,15 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg">
- <script>//<![CDATA[
-
-function add_watch()
-{
- document.getElementById("e").points.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
- //]]></script>
-
- <polygon id="e" points="0,0"/>
-
-</svg>
diff --git a/dom/svg/crashtests/crashtests.list b/dom/svg/crashtests/crashtests.list index 147838bbe..b2e920152 100644 --- a/dom/svg/crashtests/crashtests.list +++ b/dom/svg/crashtests/crashtests.list @@ -66,11 +66,6 @@ load 837450-1.svg load 842463-1.html load 847138-1.svg load 864509.svg -load 880544-1.svg -load 880544-2.svg -load 880544-3.svg -load 880544-4.svg -load 880544-5.svg load 898915-1.svg load 1035248-1.svg load 1035248-2.svg diff --git a/dom/tests/mochitest/bugs/iframe_bug38959-1.html b/dom/tests/mochitest/bugs/iframe_bug38959-1.html deleted file mode 100644 index d4c16c47a..000000000 --- a/dom/tests/mochitest/bugs/iframe_bug38959-1.html +++ /dev/null @@ -1,14 +0,0 @@ -<html> -<head> - <title>Iframe test for bug 38959</title> -</head> -<body"> -<script> - -x = false; -window.opener.postMessage(1, "http://mochi.test:8888"); -window.close(); - -</script> -</body> -</html> diff --git a/dom/tests/mochitest/bugs/iframe_bug38959-2.html b/dom/tests/mochitest/bugs/iframe_bug38959-2.html deleted file mode 100644 index 36cd0c156..000000000 --- a/dom/tests/mochitest/bugs/iframe_bug38959-2.html +++ /dev/null @@ -1,14 +0,0 @@ -<html> -<head> - <title>Iframe test for bug 38959</title> -</head> -<body"> -<script> - -x = true; -window.opener.postMessage(2, "http://mochi.test:8888"); -window.close(); - -</script> -</body> -</html> diff --git a/dom/tests/mochitest/bugs/mochitest.ini b/dom/tests/mochitest/bugs/mochitest.ini index e0c71f857..309aab6e0 100644 --- a/dom/tests/mochitest/bugs/mochitest.ini +++ b/dom/tests/mochitest/bugs/mochitest.ini @@ -23,8 +23,6 @@ support-files = grandchild_bug260264.html iframe_bug304459-1.html iframe_bug304459-2.html - iframe_bug38959-1.html - iframe_bug38959-2.html iframe_bug430276-2.html iframe_bug430276.html iframe_bug440572.html @@ -64,7 +62,6 @@ skip-if = toolkit == 'android' #TIMED_OUT [test_bug377539.html] [test_bug384122.html] [test_bug389366.html] -[test_bug38959.html] [test_bug393974.html] [test_bug394769.html] [test_bug396843.html] diff --git a/dom/tests/mochitest/bugs/test_bug38959.html b/dom/tests/mochitest/bugs/test_bug38959.html deleted file mode 100644 index a8d07d1a6..000000000 --- a/dom/tests/mochitest/bugs/test_bug38959.html +++ /dev/null @@ -1,57 +0,0 @@ -<!DOCTYPE HTML> -<html> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=38959 ---> -<head> - <title>Test for Bug 38959</title> - <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> -</head> -<body> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=38959">Mozilla Bug 38959</a> -<p id="display"></p> -<div id="content" style="display: none"> - <iframe id="frame"></iframe> -</div> -<pre id="test"> -<script type="application/javascript"> - -/** Test for Bug 38959 **/ - -var newValue; - -function watcher(id, ol, ne) -{ - newValue = ne; - return ne; -} - -function openWindow(url, crossOrigin) -{ - newValue = true; - var w = window.open(url); - w.watch("x", watcher); -} - -function receiveMessage(evt) -{ - ok(newValue, "Watchpoints only allowed same-origin."); - if (evt.data == 1) { - openWindow("/tests/dom/tests/mochitest/bugs/iframe_bug38959-2.html"); - } - else { - SimpleTest.finish(); - } -} - -SimpleTest.waitForExplicitFinish(); - -window.addEventListener("message", receiveMessage, false); - -openWindow("http://example.org/tests/dom/tests/mochitest/bugs/iframe_bug38959-1.html"); - -</script> -</pre> -</body> -</html> diff --git a/editor/libeditor/tests/test_htmleditor_keyevent_handling.html b/editor/libeditor/tests/test_htmleditor_keyevent_handling.html index 414045ac0..bfec290a5 100644 --- a/editor/libeditor/tests/test_htmleditor_keyevent_handling.html +++ b/editor/libeditor/tests/test_htmleditor_keyevent_handling.html @@ -27,7 +27,7 @@ var htmlEditor = document.getElementById("htmlEditor"); const kIsMac = navigator.platform.indexOf("Mac") == 0; const kIsWin = navigator.platform.indexOf("Win") == 0; -const kIsLinux = navigator.platform.indexOf("Linux") == 0; +const kIsLinux = navigator.platform.indexOf("Linux") == 0 || navigator.platform.indexOf("SunOS") == 0 ; function runTests() { diff --git a/editor/reftests/xul/platform.js b/editor/reftests/xul/platform.js index a8633fb09..d3f5d33bf 100644 --- a/editor/reftests/xul/platform.js +++ b/editor/reftests/xul/platform.js @@ -13,6 +13,8 @@ if (/Windows/.test(ua)) { } else if (/Linux/.test(ua)) id = "linux"; +else if (/SunOS/.test(ua)) + id = "linux"; else if (/Mac OS X/.test(ua)) id = "mac"; diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index 22a01ca10..d6835c8e6 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -723,7 +723,7 @@ public: * The resulting vertices are populated in aVerts. aVerts must be * pre-allocated to hold at least kTransformAndClipRectMaxVerts Points. * The vertex count is returned by TransformAndClipRect. It is possible to - * emit fewer that 3 vertices, indicating that aRect will not be visible + * emit fewer than 3 vertices, indicating that aRect will not be visible * within aClip. */ template<class F> @@ -734,7 +734,8 @@ public: // Initialize a double-buffered array of points in homogenous space with // the input rectangle, aRect. Point4DTyped<UnknownUnits, F> points[2][kTransformAndClipRectMaxVerts]; - Point4DTyped<UnknownUnits, F>* dstPoint = points[0]; + Point4DTyped<UnknownUnits, F>* dstPointStart = points[0]; + Point4DTyped<UnknownUnits, F>* dstPoint = dstPointStart; *dstPoint++ = TransformPoint(Point4DTyped<UnknownUnits, F>(aRect.x, aRect.y, 0, 1)); *dstPoint++ = TransformPoint(Point4DTyped<UnknownUnits, F>(aRect.XMost(), aRect.y, 0, 1)); @@ -750,16 +751,26 @@ public: planeNormals[3] = Point4DTyped<UnknownUnits, F>(0.0, -1.0, 0.0, aClip.YMost()); // Iterate through each clipping plane and clip the polygon. - // In each pass, we double buffer, alternating between points[0] and - // points[1]. + // For each clipping plane, we intersect the plane with all polygon edges. + // Each pass can increase or decrease the number of points that make up the + // current clipped polygon. We double buffer that set of points, alternating + // between points[0] and points[1]. for (int plane=0; plane < 4; plane++) { planeNormals[plane].Normalize(); - Point4DTyped<UnknownUnits, F>* srcPoint = points[plane & 1]; + Point4DTyped<UnknownUnits, F>* srcPoint = dstPointStart; Point4DTyped<UnknownUnits, F>* srcPointEnd = dstPoint; - dstPoint = points[~plane & 1]; - Point4DTyped<UnknownUnits, F>* dstPointStart = dstPoint; - + dstPointStart = points[~plane & 1]; + dstPoint = dstPointStart; + + // Iterate over the polygon edges. In each iteration the current edge is + // the edge from prevPoint to srcPoint. If the two end points lie on + // different sides of the plane, we have an intersection. Otherwise, the + // edge is either completely "inside" the half-space created by the + // clipping plane, and we add srcPoint, or it is completely "outside", and + // we discard srcPoint. + // We may create duplicated points in the polygon. We keep those around + // until all clipping is done and then filter out duplicates at the end. Point4DTyped<UnknownUnits, F>* prevPoint = srcPointEnd - 1; F prevDot = planeNormals[plane].DotProduct(*prevPoint); while (srcPoint < srcPointEnd && ((dstPoint - dstPointStart) < kTransformAndClipRectMaxVerts)) { @@ -783,14 +794,16 @@ public: } if (dstPoint == dstPointStart) { + // No polygon points were produced, so the polygon has been + // completely clipped away by the current clipping plane. Exit. break; } } - size_t dstPointCount = 0; - size_t srcPointCount = dstPoint - points[0]; - for (Point4DTyped<UnknownUnits, F>* srcPoint = points[0]; srcPoint < points[0] + srcPointCount; srcPoint++) { - + Point4DTyped<UnknownUnits, F>* srcPoint = dstPointStart; + Point4DTyped<UnknownUnits, F>* srcPointEnd = dstPoint; + size_t vertCount = 0; + while (srcPoint < srcPointEnd) { PointTyped<TargetUnits, F> p; if (srcPoint->w == 0.0) { // If a point lies on the intersection of the clipping planes at @@ -800,12 +813,13 @@ public: p = srcPoint->As2DPoint(); } // Emit only unique points - if (dstPointCount == 0 || p != aVerts[dstPointCount - 1]) { - aVerts[dstPointCount++] = p; + if (vertCount == 0 || p != aVerts[vertCount - 1]) { + aVerts[vertCount++] = p; } + srcPoint++; } - return dstPointCount; + return vertCount; } static const int kTransformAndClipRectMaxVerts = 32; diff --git a/gfx/tests/gtest/TestMatrix.cpp b/gfx/tests/gtest/TestMatrix.cpp new file mode 100644 index 000000000..bc2f9e63c --- /dev/null +++ b/gfx/tests/gtest/TestMatrix.cpp @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "mozilla/gfx/Matrix.h" + +using namespace mozilla; +using namespace mozilla::gfx; + +static Rect NudgedToInt(const Rect& aRect) { + Rect r(aRect); + r.NudgeToIntegers(); + return r; +} + +TEST(Matrix, TransformAndClipRect) +{ + Rect c(100, 100, 100, 100); + Matrix4x4 m; + EXPECT_TRUE(m.TransformAndClipBounds(Rect(50, 50, 20, 20), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(250, 50, 20, 20), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(250, 250, 20, 20), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(50, 250, 20, 20), c).IsEmpty()); + + EXPECT_TRUE(m.TransformAndClipBounds(Rect(50, 50, 100, 20), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(150, 50, 100, 20), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(50, 250, 100, 20), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(150, 250, 100, 20), c).IsEmpty()); + + EXPECT_TRUE(m.TransformAndClipBounds(Rect(50, 50, 20, 100), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(50, 150, 20, 100), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(250, 50, 20, 100), c).IsEmpty()); + EXPECT_TRUE(m.TransformAndClipBounds(Rect(250, 150, 20, 100), c).IsEmpty()); + + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(50, 50, 100, 100), c)) + .IsEqualInterior(Rect(100, 100, 50, 50))); + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(150, 50, 100, 100), c)) + .IsEqualInterior(Rect(150, 100, 50, 50))); + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(150, 150, 100, 100), c)) + .IsEqualInterior(Rect(150, 150, 50, 50))); + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(50, 150, 100, 100), c)) + .IsEqualInterior(Rect(100, 150, 50, 50))); + + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(110, 110, 80, 80), c)) + .IsEqualInterior(Rect(110, 110, 80, 80))); + + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(50, 50, 200, 200), c)) + .IsEqualInterior(Rect(100, 100, 100, 100))); + + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(50, 50, 200, 100), c)) + .IsEqualInterior(Rect(100, 100, 100, 50))); + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(50, 150, 200, 100), c)) + .IsEqualInterior(Rect(100, 150, 100, 50))); + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(50, 50, 100, 200), c)) + .IsEqualInterior(Rect(100, 100, 50, 100))); + EXPECT_TRUE(NudgedToInt(m.TransformAndClipBounds(Rect(150, 50, 100, 200), c)) + .IsEqualInterior(Rect(150, 100, 50, 100))); +} diff --git a/gfx/tests/gtest/moz.build b/gfx/tests/gtest/moz.build index 23b019d1b..ea18c1e3b 100644 --- a/gfx/tests/gtest/moz.build +++ b/gfx/tests/gtest/moz.build @@ -17,6 +17,7 @@ UNIFIED_SOURCES += [ 'TestGfxWidgets.cpp', 'TestJobScheduler.cpp', 'TestLayers.cpp', + 'TestMatrix.cpp', 'TestMoz2D.cpp', 'TestPolygon.cpp', 'TestQcms.cpp', diff --git a/intl/icu/source/common/uposixdefs.h b/intl/icu/source/common/uposixdefs.h index 495deea49..a5b7fd09f 100644 --- a/intl/icu/source/common/uposixdefs.h +++ b/intl/icu/source/common/uposixdefs.h @@ -54,7 +54,7 @@ * * z/OS needs this definition for timeval and to get usleep. */ -#if !defined(_XOPEN_SOURCE_EXTENDED) +#if !defined(_XOPEN_SOURCE_EXTENDED) && (U_PLATFORM != U_PF_SOLARIS) # define _XOPEN_SOURCE_EXTENDED 1 #endif diff --git a/intl/tzdata/GIT-INFO b/intl/tzdata/GIT-INFO index 9c6206b1b..80b232e89 100644 --- a/intl/tzdata/GIT-INFO +++ b/intl/tzdata/GIT-INFO @@ -1,5 +1,5 @@ -commit a1dd3c5661404aa93924e737aeb86acf130b8889 -Author: yumaoka <y.umaoka@gmail.com> -Date: Tue Mar 26 19:02:10 2019 -0400 +commit 4d027901ef4d3288b2ca264ba1f532cf826190ac +Author: Yoshito Umaoka <yumaoka@users.noreply.github.com> +Date: Fri Sep 13 18:23:18 2019 -0400 - ICU-20522 tzdata2019a updates + ICU-20823 ICU time zone data updates for 2019c diff --git a/intl/tzdata/VERSION b/intl/tzdata/VERSION index 149d790c3..db18f8311 100644 --- a/intl/tzdata/VERSION +++ b/intl/tzdata/VERSION @@ -1 +1 @@ -2019a +2019c diff --git a/intl/tzdata/source/be/metaZones.res b/intl/tzdata/source/be/metaZones.res Binary files differindex 3df8225d6..bc6b490a3 100644 --- a/intl/tzdata/source/be/metaZones.res +++ b/intl/tzdata/source/be/metaZones.res diff --git a/intl/tzdata/source/be/windowsZones.res b/intl/tzdata/source/be/windowsZones.res Binary files differindex e6bb5af0f..9e84b8f22 100644 --- a/intl/tzdata/source/be/windowsZones.res +++ b/intl/tzdata/source/be/windowsZones.res diff --git a/intl/tzdata/source/be/zoneinfo64.res b/intl/tzdata/source/be/zoneinfo64.res Binary files differindex fc5c0f58e..949fd8986 100644 --- a/intl/tzdata/source/be/zoneinfo64.res +++ b/intl/tzdata/source/be/zoneinfo64.res diff --git a/intl/tzdata/source/ee/metaZones.res b/intl/tzdata/source/ee/metaZones.res Binary files differindex e495c2aa9..bb2226702 100644 --- a/intl/tzdata/source/ee/metaZones.res +++ b/intl/tzdata/source/ee/metaZones.res diff --git a/intl/tzdata/source/ee/windowsZones.res b/intl/tzdata/source/ee/windowsZones.res Binary files differindex 2a6500de3..c2ec2db8a 100644 --- a/intl/tzdata/source/ee/windowsZones.res +++ b/intl/tzdata/source/ee/windowsZones.res diff --git a/intl/tzdata/source/ee/zoneinfo64.res b/intl/tzdata/source/ee/zoneinfo64.res Binary files differindex faef29683..33bc1df91 100644 --- a/intl/tzdata/source/ee/zoneinfo64.res +++ b/intl/tzdata/source/ee/zoneinfo64.res diff --git a/intl/tzdata/source/le/metaZones.res b/intl/tzdata/source/le/metaZones.res Binary files differindex 3b3ee0134..3d894c944 100644 --- a/intl/tzdata/source/le/metaZones.res +++ b/intl/tzdata/source/le/metaZones.res diff --git a/intl/tzdata/source/le/windowsZones.res b/intl/tzdata/source/le/windowsZones.res Binary files differindex 77b503f23..89eb10001 100644 --- a/intl/tzdata/source/le/windowsZones.res +++ b/intl/tzdata/source/le/windowsZones.res diff --git a/intl/tzdata/source/le/zoneinfo64.res b/intl/tzdata/source/le/zoneinfo64.res Binary files differindex 7e0afd405..2dd90caaa 100644 --- a/intl/tzdata/source/le/zoneinfo64.res +++ b/intl/tzdata/source/le/zoneinfo64.res diff --git a/intl/tzdata/source/metaZones.txt b/intl/tzdata/source/metaZones.txt index d6b002005..62439a51a 100644 --- a/intl/tzdata/source/metaZones.txt +++ b/intl/tzdata/source/metaZones.txt @@ -3647,11 +3647,11 @@ metaZones:table(nofallback){ { "Europe_Eastern", "1970-01-01 00:00", - "1978-10-14 21:00", + "1978-06-28 21:00", } { "Turkey", - "1978-10-14 21:00", + "1978-06-28 21:00", "1985-04-19 21:00", } { diff --git a/intl/tzdata/source/windowsZones.txt b/intl/tzdata/source/windowsZones.txt index e29b769c9..cb139642f 100644 --- a/intl/tzdata/source/windowsZones.txt +++ b/intl/tzdata/source/windowsZones.txt @@ -17,8 +17,8 @@ windowsZones:table(nofallback){ "Alaskan Standard Time"{ 001{"America/Anchorage"} US{ - "America/Anchorage America/Juneau America/Nome America/Sitka America/" - "Yakutat" + "America/Anchorage America/Juneau America/Metlakatla America/Nome Ame" + "rica/Sitka America/Yakutat" } } "Aleutian Standard Time"{ @@ -287,7 +287,7 @@ windowsZones:table(nofallback){ } "GTB Standard Time"{ 001{"Europe/Bucharest"} - CY{"Asia/Famagusta Asia/Nicosia"} + CY{"Asia/Nicosia Asia/Famagusta"} GR{"Europe/Athens"} RO{"Europe/Bucharest"} } @@ -371,7 +371,6 @@ windowsZones:table(nofallback){ } "Magallanes Standard Time"{ 001{"America/Punta_Arenas"} - AQ{"Antarctica/Palmer"} CL{"America/Punta_Arenas"} } "Marquesas Standard Time"{ @@ -468,7 +467,7 @@ windowsZones:table(nofallback){ "Pacific Standard Time"{ 001{"America/Los_Angeles"} CA{"America/Vancouver America/Dawson America/Whitehorse"} - US{"America/Los_Angeles America/Metlakatla"} + US{"America/Los_Angeles"} ZZ{"PST8PDT"} } "Pakistan Standard Time"{ @@ -479,6 +478,10 @@ windowsZones:table(nofallback){ 001{"America/Asuncion"} PY{"America/Asuncion"} } + "Qyzylorda Standard Time"{ + 001{"Asia/Qyzylorda"} + KZ{"Asia/Qyzylorda"} + } "Romance Standard Time"{ 001{"Europe/Paris"} BE{"Europe/Brussels"} @@ -500,12 +503,12 @@ windowsZones:table(nofallback){ } "Russian Standard Time"{ 001{"Europe/Moscow"} - RU{"Europe/Moscow Europe/Kirov Europe/Volgograd"} + RU{"Europe/Moscow Europe/Kirov"} UA{"Europe/Simferopol"} } "SA Eastern Standard Time"{ 001{"America/Cayenne"} - AQ{"Antarctica/Rothera"} + AQ{"Antarctica/Rothera Antarctica/Palmer"} BR{ "America/Fortaleza America/Belem America/Maceio America/Recife Americ" "a/Santarem" @@ -590,6 +593,7 @@ windowsZones:table(nofallback){ } "Singapore Standard Time"{ 001{"Asia/Singapore"} + AQ{"Antarctica/Casey"} BN{"Asia/Brunei"} ID{"Asia/Makassar"} MY{"Asia/Kuala_Lumpur Asia/Kuching"} @@ -731,9 +735,12 @@ windowsZones:table(nofallback){ 001{"Asia/Vladivostok"} RU{"Asia/Vladivostok Asia/Ust-Nera"} } + "Volgograd Standard Time"{ + 001{"Europe/Volgograd"} + RU{"Europe/Volgograd"} + } "W. Australia Standard Time"{ 001{"Australia/Perth"} - AQ{"Antarctica/Casey"} AU{"Australia/Perth"} } "W. Central Africa Standard Time"{ @@ -779,7 +786,7 @@ windowsZones:table(nofallback){ "West Asia Standard Time"{ 001{"Asia/Tashkent"} AQ{"Antarctica/Mawson"} - KZ{"Asia/Oral Asia/Aqtau Asia/Aqtobe Asia/Atyrau Asia/Qyzylorda"} + KZ{"Asia/Oral Asia/Aqtau Asia/Aqtobe Asia/Atyrau"} MV{"Indian/Maldives"} TF{"Indian/Kerguelen"} TJ{"Asia/Dushanbe"} diff --git a/intl/tzdata/source/zoneinfo64.txt b/intl/tzdata/source/zoneinfo64.txt index e64943419..89b89737e 100644 --- a/intl/tzdata/source/zoneinfo64.txt +++ b/intl/tzdata/source/zoneinfo64.txt @@ -3,17 +3,17 @@ // License & terms of use: http://www.unicode.org/copyright.html#License //--------------------------------------------------------- // Build tool: tz2icu -// Build date: Tue Mar 26 16:57:59 2019 +// Build date: Fri Sep 13 17:31:25 2019 // tz database: ftp://ftp.iana.org/tz/ -// tz version: 2019a -// ICU version: 64.1 +// tz version: 2019c +// ICU version: 65.1 //--------------------------------------------------------- // >> !!! >> THIS IS A MACHINE-GENERATED FILE << !!! << // >> !!! >>> DO NOT EDIT <<< !!! << //--------------------------------------------------------- zoneinfo64:table(nofallback) { - TZVersion { "2019a" } + TZVersion { "2019c" } Zones:array { /* ACT */ :int { 355 } //Z#0 /* AET */ :int { 367 } //Z#1 @@ -60,8 +60,9 @@ zoneinfo64:table(nofallback) { } //Z#18 /* Africa/Casablanca */ :table { trans:intvector { -1773012580, -956361600, -950490000, -942019200, -761187600, -617241600, -605149200, -81432000, -71110800, 141264000, 147222000, 199756800, 207702000, 231292800, 244249200, 265507200, 271033200, 448243200, 504918000, 1212278400, 1220223600, 1243814400, 1250809200, 1272758400, 1281222000, 1301788800, 1312066800, 1335664800, 1342749600, 1345428000, 1348970400, 1367114400, 1373162400, 1376100000, 1382839200, 1396144800, 1403920800, 1406944800, 1414288800, 1427594400, 1434247200, 1437271200, 1445738400, 1459044000, 1465092000, 1468116000, 1477792800, 1490493600, 1495332000, 1498960800, 1509242400, 1521943200, 1526176800, 1529200800, 1557021600, 1560045600, 1587261600, 1590285600, 1618106400, 1621130400, 1648346400, 1651975200, 1679191200, 1682215200, 1710036000, 1713060000, 1740276000, 1743904800, 1771120800, 1774144800, 1801965600, 1804989600, 1832205600, 1835229600, 1863050400, 1866074400, 1893290400, 1896919200, 1924135200, 1927159200, 1954980000, 1958004000, 1985220000, 1988848800, 2016064800, 2019088800, 2046304800, 2049933600, 2077149600, 2080173600, 2107994400, 2111018400, 2138234400, 2141863200 } + transPost32:intvector { 0, -2125888096, 0, -2122864096, 0, -2095043296, 0, -2092019296, 0, -2064803296, 0, -2061174496, 0, -2033958496, 0, -2030934496, 0, -2003718496, 0, -2000089696, 0, -1972873696, 0, -1969849696, 0, -1942028896, 0, -1939004896, 0, -1911788896, 0, -1908160096, 0, -1880944096, 0, -1877920096, 0, -1850099296, 0, -1847075296, 0, -1819859296, 0, -1816230496, 0, -1789014496, 0, -1785990496, 0, -1758774496, 0, -1755145696, 0, -1727929696, 0, -1724905696, 0, -1697084896, 0, -1694060896, 0, -1666844896, 0, -1663216096, 0, -1636000096, 0, -1632976096, 0, -1605155296, 0, -1602131296, 0, -1574915296, 0, -1571286496, 0, -1544070496, 0, -1541046496, 0, -1513830496, 0, -1510201696, 0, -1482985696, 0, -1479961696, 0, -1452140896, 0, -1449116896, 0, -1421900896, 0, -1418272096, 0, -1391056096, 0, -1388032096, 0, -1360211296, 0, -1357187296, 0, -1329971296, 0, -1326947296, 0, -1299126496, 0, -1296102496, 0, -1268886496, 0, -1265257696, 0, -1238041696, 0, -1235017696, 0, -1207196896, 0, -1204172896, 0, -1176956896, 0, -1173328096, 0, -1146112096, 0, -1143088096, 0, -1115267296, 0, -1112243296, 0, -1085027296, 0, -1082003296, 0, -1054182496, 0, -1051158496, 0, -1023942496, 0, -1020313696, 0, -993097696, 0, -990073696, 0, -962252896, 0, -959228896, 0, -932012896, 0, -928384096, 0, -901168096, 0, -898144096, 0, -870323296, 0, -867299296, 0, -840083296, 0, -837059296, 0, -809238496, 0, -806214496, 0, -778998496, 0, -775369696, 0, -748153696, 0, -745129696, 0, -717308896, 0, -714284896, 0, -687068896, 0, -683440096, 0, -656224096, 0, -653200096, 0, -625379296, 0, -622355296, 0, -595139296, 0, -592115296 } typeOffsets:intvector { -1820, 0, 0, 0, 0, 3600, 3600, 0 } - typeMap:bin { "01020102010201020102010201020102010301020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102" } + typeMap:bin { "01020102010201020102010201020102010301020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102" } } //Z#19 /* Africa/Ceuta */ :table { transPre32:intvector { -1, 2117514496 } @@ -79,8 +80,9 @@ zoneinfo64:table(nofallback) { /* Africa/Douala */ :int { 36 } //Z#25 /* Africa/El_Aaiun */ :table { trans:intvector { -1136070432, 198291600, 199756800, 207702000, 231292800, 244249200, 265507200, 271033200, 1212278400, 1220223600, 1243814400, 1250809200, 1272758400, 1281222000, 1301788800, 1312066800, 1335664800, 1342749600, 1345428000, 1348970400, 1367114400, 1373162400, 1376100000, 1382839200, 1396144800, 1403920800, 1406944800, 1414288800, 1427594400, 1434247200, 1437271200, 1445738400, 1459044000, 1465092000, 1468116000, 1477792800, 1490493600, 1495332000, 1498960800, 1509242400, 1521943200, 1526176800, 1529200800, 1557021600, 1560045600, 1587261600, 1590285600, 1618106400, 1621130400, 1648346400, 1651975200, 1679191200, 1682215200, 1710036000, 1713060000, 1740276000, 1743904800, 1771120800, 1774144800, 1801965600, 1804989600, 1832205600, 1835229600, 1863050400, 1866074400, 1893290400, 1896919200, 1924135200, 1927159200, 1954980000, 1958004000, 1985220000, 1988848800, 2016064800, 2019088800, 2046304800, 2049933600, 2077149600, 2080173600, 2107994400, 2111018400, 2138234400, 2141863200 } + transPost32:intvector { 0, -2125888096, 0, -2122864096, 0, -2095043296, 0, -2092019296, 0, -2064803296, 0, -2061174496, 0, -2033958496, 0, -2030934496, 0, -2003718496, 0, -2000089696, 0, -1972873696, 0, -1969849696, 0, -1942028896, 0, -1939004896, 0, -1911788896, 0, -1908160096, 0, -1880944096, 0, -1877920096, 0, -1850099296, 0, -1847075296, 0, -1819859296, 0, -1816230496, 0, -1789014496, 0, -1785990496, 0, -1758774496, 0, -1755145696, 0, -1727929696, 0, -1724905696, 0, -1697084896, 0, -1694060896, 0, -1666844896, 0, -1663216096, 0, -1636000096, 0, -1632976096, 0, -1605155296, 0, -1602131296, 0, -1574915296, 0, -1571286496, 0, -1544070496, 0, -1541046496, 0, -1513830496, 0, -1510201696, 0, -1482985696, 0, -1479961696, 0, -1452140896, 0, -1449116896, 0, -1421900896, 0, -1418272096, 0, -1391056096, 0, -1388032096, 0, -1360211296, 0, -1357187296, 0, -1329971296, 0, -1326947296, 0, -1299126496, 0, -1296102496, 0, -1268886496, 0, -1265257696, 0, -1238041696, 0, -1235017696, 0, -1207196896, 0, -1204172896, 0, -1176956896, 0, -1173328096, 0, -1146112096, 0, -1143088096, 0, -1115267296, 0, -1112243296, 0, -1085027296, 0, -1082003296, 0, -1054182496, 0, -1051158496, 0, -1023942496, 0, -1020313696, 0, -993097696, 0, -990073696, 0, -962252896, 0, -959228896, 0, -932012896, 0, -928384096, 0, -901168096, 0, -898144096, 0, -870323296, 0, -867299296, 0, -840083296, 0, -837059296, 0, -809238496, 0, -806214496, 0, -778998496, 0, -775369696, 0, -748153696, 0, -745129696, 0, -717308896, 0, -714284896, 0, -687068896, 0, -683440096, 0, -656224096, 0, -653200096, 0, -625379296, 0, -622355296, 0, -595139296, 0, -592115296 } typeOffsets:intvector { -3168, 0, -3600, 0, 0, 0, 0, 3600 } - typeMap:bin { "0102030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203" } + typeMap:bin { "0102030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203" } } //Z#26 /* Africa/Freetown */ :int { 5 } //Z#27 /* Africa/Gaborone */ :int { 43 } //Z#28 @@ -355,13 +357,9 @@ zoneinfo64:table(nofallback) { finalYear:int { 2008 } } //Z#91 /* America/Campo_Grande */ :table { - trans:intvector { -1767212492, -1206954000, -1191358800, -1175371200, -1159822800, -633816000, -622065600, -602280000, -591829200, -570744000, -560206800, -539121600, -531349200, -191361600, -184194000, -155160000, -150066000, -128894400, -121122000, -99950400, -89586000, -68414400, -57963600, 499752000, 511239600, 530596800, 540270000, 562132800, 571201200, 592977600, 602046000, 624427200, 634705200, 656481600, 666759600, 687931200, 697604400, 719985600, 728449200, 750830400, 761713200, 782280000, 793162800, 813729600, 824007600, 844574400, 856062000, 876110400, 888721200, 908078400, 919566000, 938923200, 951620400, 970977600, 982465200, 1003032000, 1013914800, 1036296000, 1045364400, 1066536000, 1076814000, 1099368000, 1108868400, 1129435200, 1140318000, 1162699200, 1172372400, 1192334400, 1203217200, 1224388800, 1234666800, 1255838400, 1266721200, 1287288000, 1298170800, 1318737600, 1330225200, 1350792000, 1361070000, 1382241600, 1392519600, 1413691200, 1424574000, 1445140800, 1456023600, 1476590400, 1487473200, 1508040000, 1518922800, 1541304000, 1550372400, 1572753600, 1581822000, 1604203200, 1613876400, 1636257600, 1645326000, 1667707200, 1677380400, 1699156800, 1708225200, 1730606400, 1739674800, 1762056000, 1771729200, 1793505600, 1803178800, 1825560000, 1834628400, 1857009600, 1866078000, 1888459200, 1897527600, 1919908800, 1928977200, 1951358400, 1960426800, 1983412800, 1992481200, 2014862400, 2024535600, 2046312000, 2055380400, 2077761600, 2086830000, 2109211200, 2118884400, 2140660800 } - transPost32:intvector { 0, -2144633296, 0, -2122252096 } + trans:intvector { -1767212492, -1206954000, -1191358800, -1175371200, -1159822800, -633816000, -622065600, -602280000, -591829200, -570744000, -560206800, -539121600, -531349200, -191361600, -184194000, -155160000, -150066000, -128894400, -121122000, -99950400, -89586000, -68414400, -57963600, 499752000, 511239600, 530596800, 540270000, 562132800, 571201200, 592977600, 602046000, 624427200, 634705200, 656481600, 666759600, 687931200, 697604400, 719985600, 728449200, 750830400, 761713200, 782280000, 793162800, 813729600, 824007600, 844574400, 856062000, 876110400, 888721200, 908078400, 919566000, 938923200, 951620400, 970977600, 982465200, 1003032000, 1013914800, 1036296000, 1045364400, 1066536000, 1076814000, 1099368000, 1108868400, 1129435200, 1140318000, 1162699200, 1172372400, 1192334400, 1203217200, 1224388800, 1234666800, 1255838400, 1266721200, 1287288000, 1298170800, 1318737600, 1330225200, 1350792000, 1361070000, 1382241600, 1392519600, 1413691200, 1424574000, 1445140800, 1456023600, 1476590400, 1487473200, 1508040000, 1518922800, 1541304000, 1550372400 } typeOffsets:intvector { -13108, 0, -14400, 0, -14400, 3600 } - typeMap:bin { "01020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102" } - finalRule { "Brazil" } - finalRaw:int { -14400 } - finalYear:int { 2039 } + typeMap:bin { "01020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } } //Z#92 /* America/Cancun */ :table { trans:intvector { -1514743200, 377935200, 828860400, 846396000, 860310000, 877845600, 891759600, 902037600, 909298800, 923212800, 941353200, 954662400, 972802800, 989136000, 1001833200, 1018166400, 1035702000, 1049616000, 1067151600, 1081065600, 1099206000, 1112515200, 1130655600, 1143964800, 1162105200, 1175414400, 1193554800, 1207468800, 1225004400, 1238918400, 1256454000, 1270368000, 1288508400, 1301817600, 1319958000, 1333267200, 1351407600, 1365321600, 1382857200, 1396771200, 1414306800, 1422777600 } @@ -413,13 +411,9 @@ zoneinfo64:table(nofallback) { typeMap:bin { "020102" } } //Z#103 /* America/Cuiaba */ :table { - trans:intvector { -1767212140, -1206954000, -1191358800, -1175371200, -1159822800, -633816000, -622065600, -602280000, -591829200, -570744000, -560206800, -539121600, -531349200, -191361600, -184194000, -155160000, -150066000, -128894400, -121122000, -99950400, -89586000, -68414400, -57963600, 499752000, 511239600, 530596800, 540270000, 562132800, 571201200, 592977600, 602046000, 624427200, 634705200, 656481600, 666759600, 687931200, 697604400, 719985600, 728449200, 750830400, 761713200, 782280000, 793162800, 813729600, 824007600, 844574400, 856062000, 876110400, 888721200, 908078400, 919566000, 938923200, 951620400, 970977600, 982465200, 1003032000, 1013914800, 1036296000, 1045364400, 1099368000, 1108868400, 1129435200, 1140318000, 1162699200, 1172372400, 1192334400, 1203217200, 1224388800, 1234666800, 1255838400, 1266721200, 1287288000, 1298170800, 1318737600, 1330225200, 1350792000, 1361070000, 1382241600, 1392519600, 1413691200, 1424574000, 1445140800, 1456023600, 1476590400, 1487473200, 1508040000, 1518922800, 1541304000, 1550372400, 1572753600, 1581822000, 1604203200, 1613876400, 1636257600, 1645326000, 1667707200, 1677380400, 1699156800, 1708225200, 1730606400, 1739674800, 1762056000, 1771729200, 1793505600, 1803178800, 1825560000, 1834628400, 1857009600, 1866078000, 1888459200, 1897527600, 1919908800, 1928977200, 1951358400, 1960426800, 1983412800, 1992481200, 2014862400, 2024535600, 2046312000, 2055380400, 2077761600, 2086830000, 2109211200, 2118884400, 2140660800 } - transPost32:intvector { 0, -2144633296, 0, -2122252096 } + trans:intvector { -1767212140, -1206954000, -1191358800, -1175371200, -1159822800, -633816000, -622065600, -602280000, -591829200, -570744000, -560206800, -539121600, -531349200, -191361600, -184194000, -155160000, -150066000, -128894400, -121122000, -99950400, -89586000, -68414400, -57963600, 499752000, 511239600, 530596800, 540270000, 562132800, 571201200, 592977600, 602046000, 624427200, 634705200, 656481600, 666759600, 687931200, 697604400, 719985600, 728449200, 750830400, 761713200, 782280000, 793162800, 813729600, 824007600, 844574400, 856062000, 876110400, 888721200, 908078400, 919566000, 938923200, 951620400, 970977600, 982465200, 1003032000, 1013914800, 1036296000, 1045364400, 1099368000, 1108868400, 1129435200, 1140318000, 1162699200, 1172372400, 1192334400, 1203217200, 1224388800, 1234666800, 1255838400, 1266721200, 1287288000, 1298170800, 1318737600, 1330225200, 1350792000, 1361070000, 1382241600, 1392519600, 1413691200, 1424574000, 1445140800, 1456023600, 1476590400, 1487473200, 1508040000, 1518922800, 1541304000, 1550372400 } typeOffsets:intvector { -13460, 0, -14400, 0, -14400, 3600 } - typeMap:bin { "0102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102" } - finalRule { "Brazil" } - finalRaw:int { -14400 } - finalYear:int { 2039 } + typeMap:bin { "0102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } } //Z#104 /* America/Curacao */ :table { trans:intvector { -1826738653, -157750200 } @@ -458,9 +452,9 @@ zoneinfo64:table(nofallback) { links:intvector { 109, 204, 544, 624 } } //Z#109 /* America/Detroit */ :table { - trans:intvector { -2051202469, -1724083200, -880218000, -765396000, -684349200, -671047200, 104914800, 120636000, 126687600, 152085600, 167814000, 183535200, 199263600, 215589600, 230713200, 247039200, 262767600, 278488800, 294217200, 309938400, 325666800, 341388000, 357116400, 372837600, 388566000, 404892000, 420015600, 436341600, 452070000, 467791200, 483519600, 499240800, 514969200, 530690400, 544604400, 562140000, 576054000, 594194400, 607503600, 625644000, 638953200, 657093600, 671007600, 688543200, 702457200, 719992800, 733906800, 752047200, 765356400, 783496800, 796806000, 814946400, 828860400, 846396000, 860310000, 877845600, 891759600, 909295200, 923209200, 941349600, 954658800, 972799200, 986108400, 1004248800, 1018162800, 1035698400, 1049612400, 1067148000, 1081062000, 1099202400, 1112511600, 1130652000, 1143961200, 1162101600, 1173596400, 1194156000 } + trans:intvector { -2051202469, -1724083200, -880218000, -765396000, -684349200, -671047200, -80506740, -68666400, -52938000, -37216800, 104914800, 120636000, 126687600, 152085600, 167814000, 183535200, 199263600, 215589600, 230713200, 247039200, 262767600, 278488800, 294217200, 309938400, 325666800, 341388000, 357116400, 372837600, 388566000, 404892000, 420015600, 436341600, 452070000, 467791200, 483519600, 499240800, 514969200, 530690400, 544604400, 562140000, 576054000, 594194400, 607503600, 625644000, 638953200, 657093600, 671007600, 688543200, 702457200, 719992800, 733906800, 752047200, 765356400, 783496800, 796806000, 814946400, 828860400, 846396000, 860310000, 877845600, 891759600, 909295200, 923209200, 941349600, 954658800, 972799200, 986108400, 1004248800, 1018162800, 1035698400, 1049612400, 1067148000, 1081062000, 1099202400, 1112511600, 1130652000, 1143961200, 1162101600, 1173596400, 1194156000 } typeOffsets:intvector { -19931, 0, -21600, 0, -18000, 0, -18000, 3600 } - typeMap:bin { "01020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302" } + typeMap:bin { "0102030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302" } finalRule { "US" } finalRaw:int { -18000 } finalYear:int { 2008 } @@ -468,9 +462,9 @@ zoneinfo64:table(nofallback) { } //Z#110 /* America/Dominica */ :int { 186 } //Z#111 /* America/Edmonton */ :table { - trans:intvector { -1998663968, -1632063600, -1615132800, -1600614000, -1596816000, -1567954800, -1551628800, -1536505200, -1523203200, -1504450800, -1491753600, -1473001200, -1459699200, -880210800, -765388800, -715791600, -702489600, -84380400, -68659200, -21481200, -5760000, 73472400, 89193600, 104922000, 120643200, 136371600, 152092800, 167821200, 183542400, 199270800, 215596800, 230720400, 247046400, 262774800, 278496000, 294224400, 309945600, 325674000, 341395200, 357123600, 372844800, 388573200, 404899200, 420022800, 436348800, 452077200, 467798400, 483526800, 499248000, 514976400, 530697600, 544611600, 562147200, 576061200, 594201600, 607510800, 625651200, 638960400, 657100800, 671014800, 688550400, 702464400, 720000000, 733914000, 752054400, 765363600, 783504000, 796813200, 814953600, 828867600, 846403200, 860317200, 877852800, 891766800, 909302400, 923216400, 941356800, 954666000, 972806400, 986115600, 1004256000, 1018170000, 1035705600, 1049619600, 1067155200, 1081069200, 1099209600, 1112518800, 1130659200, 1143968400, 1162108800, 1173603600, 1194163200 } + trans:intvector { -1998663968, -1632063600, -1615132800, -1600614000, -1596816000, -1567954800, -1551628800, -1536505200, -1523203200, -1504450800, -1491753600, -1473001200, -1459699200, -880210800, -765388800, -715791600, -702489600, 73472400, 89193600, 104922000, 120643200, 136371600, 152092800, 167821200, 183542400, 199270800, 215596800, 230720400, 247046400, 262774800, 278496000, 294224400, 309945600, 325674000, 341395200, 357123600, 372844800, 388573200, 404899200, 420022800, 436348800, 452077200, 467798400, 483526800, 499248000, 514976400, 530697600, 544611600, 562147200, 576061200, 594201600, 607510800, 625651200, 638960400, 657100800, 671014800, 688550400, 702464400, 720000000, 733914000, 752054400, 765363600, 783504000, 796813200, 814953600, 828867600, 846403200, 860317200, 877852800, 891766800, 909302400, 923216400, 941356800, 954666000, 972806400, 986115600, 1004256000, 1018170000, 1035705600, 1049619600, 1067155200, 1081069200, 1099209600, 1112518800, 1130659200, 1143968400, 1162108800, 1173603600, 1194163200 } typeOffsets:intvector { -27232, 0, -25200, 0, -25200, 3600 } - typeMap:bin { "010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } + typeMap:bin { "0102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } finalRule { "Canada" } finalRaw:int { -25200 } finalYear:int { 2008 } @@ -615,9 +609,9 @@ zoneinfo64:table(nofallback) { } //Z#134 /* America/Indiana/Tell_City */ :table { transPre32:intvector { -1, 1577320096 } - trans:intvector { -1633276800, -1615136400, -1601827200, -1583686800, -880214400, -765392400, -747244800, -733942800, -526492800, -513190800, -495043200, -481741200, -462996000, -450291600, -431539200, -418237200, -400089600, -386787600, -368640000, -355338000, -337190400, -323888400, -305740800, -289414800, -273686400, -260989200, -242236800, -226515600, -210787200, -195066000, -179337600, -21488400, -5767200, 9961200, 25682400, 1143961200, 1162105200, 1173600000, 1194159600 } + trans:intvector { -1633276800, -1615136400, -1601827200, -1583686800, -880214400, -765392400, -462996000, -450291600, -431539200, -418237200, -400089600, -386787600, -368640000, -355338000, -337190400, -323888400, -305740800, -292438800, -273686400, -257965200, -242236800, -226515600, -210787200, -195066000, -179337600, -68662800, -52934400, -37213200, -21484800, -5767200, 9961200, 25682400, 1143961200, 1162105200, 1173600000, 1194159600 } typeOffsets:intvector { -20823, 0, -21600, 0, -21600, 3600, -18000, 0, -18000, 3600 } - typeMap:bin { "01020102010201020102010201020102010201020102010201020102010201030403040302010201" } + typeMap:bin { "01020102010201020102010201020102010201020102010201030102010403040302010201" } finalRule { "US" } finalRaw:int { -21600 } finalYear:int { 2008 } @@ -684,7 +678,7 @@ zoneinfo64:table(nofallback) { } //Z#144 /* America/Kentucky/Louisville */ :table { transPre32:intvector { -1, 1577320096 } - trans:intvector { -1633276800, -1615136400, -1601827200, -1583686800, -1535904000, -1525280400, -905097600, -891795600, -880214400, -765392400, -757360800, -744224400, -715795200, -608144400, -589392000, -576090000, -557942400, -544640400, -526492800, -513190800, -495043200, -481741200, -463593600, -450291600, -431539200, -415818000, -400089600, -384368400, -368640000, -352918800, -337190400, -321469200, -305740800, -289414800, -273686400, -266432400, -52938000, -37216800, -21488400, -5767200, 9961200, 25682400, 41410800, 57736800, 73465200, 89186400, 104914800, 120636000, 126687600, 152089200, 162370800, 183535200, 199263600, 215589600, 230713200, 247039200, 262767600, 278488800, 294217200, 309938400, 325666800, 341388000, 357116400, 372837600, 388566000, 404892000, 420015600, 436341600, 452070000, 467791200, 483519600, 499240800, 514969200, 530690400, 544604400, 562140000, 576054000, 594194400, 607503600, 625644000, 638953200, 657093600, 671007600, 688543200, 702457200, 719992800, 733906800, 752047200, 765356400, 783496800, 796806000, 814946400, 828860400, 846396000, 860310000, 877845600, 891759600, 909295200, 923209200, 941349600, 954658800, 972799200, 986108400, 1004248800, 1018162800, 1035698400, 1049612400, 1067148000, 1081062000, 1099202400, 1112511600, 1130652000, 1143961200, 1162101600, 1173596400, 1194156000 } + trans:intvector { -1633276800, -1615136400, -1601827200, -1583686800, -1535904000, -1525280400, -905097600, -891795600, -880214400, -765392400, -747251940, -744224400, -620841600, -608144400, -589392000, -576090000, -557942400, -544640400, -526492800, -513190800, -495043200, -481741200, -463593600, -450291600, -431539200, -415818000, -400089600, -384368400, -368640000, -352918800, -337190400, -321469200, -305740800, -289414800, -273686400, -266432400, -52938000, -37216800, -21488400, -5767200, 9961200, 25682400, 41410800, 57736800, 73465200, 89186400, 104914800, 120636000, 126687600, 152089200, 162370800, 183535200, 199263600, 215589600, 230713200, 247039200, 262767600, 278488800, 294217200, 309938400, 325666800, 341388000, 357116400, 372837600, 388566000, 404892000, 420015600, 436341600, 452070000, 467791200, 483519600, 499240800, 514969200, 530690400, 544604400, 562140000, 576054000, 594194400, 607503600, 625644000, 638953200, 657093600, 671007600, 688543200, 702457200, 719992800, 733906800, 752047200, 765356400, 783496800, 796806000, 814946400, 828860400, 846396000, 860310000, 877845600, 891759600, 909295200, 923209200, 941349600, 954658800, 972799200, 986108400, 1004248800, 1018162800, 1035698400, 1049612400, 1067148000, 1081062000, 1099202400, 1112511600, 1130652000, 1143961200, 1162101600, 1173596400, 1194156000 } typeOffsets:intvector { -20582, 0, -21600, 0, -21600, 3600, -18000, 0, -18000, 3600 } typeMap:bin { "010201020102010201020102010201020102010201020102010201020102010201020102030403040304030403040304030203040304030403040304030403040304030403040304030403040304030403040304030403040304030403040304030403040304030403040304030403040304030403" } finalRule { "US" } @@ -1037,13 +1031,9 @@ zoneinfo64:table(nofallback) { typeMap:bin { "0401030102010201020102010201050105" } } //Z#201 /* America/Sao_Paulo */ :table { - trans:intvector { -1767214412, -1206957600, -1191362400, -1175374800, -1159826400, -633819600, -622069200, -602283600, -591832800, -570747600, -560210400, -539125200, -531352800, -195426000, -184197600, -155163600, -150069600, -128898000, -121125600, -99954000, -89589600, -68418000, -57967200, 499748400, 511236000, 530593200, 540266400, 562129200, 571197600, 592974000, 602042400, 624423600, 634701600, 656478000, 666756000, 687927600, 697600800, 719982000, 728445600, 750826800, 761709600, 782276400, 793159200, 813726000, 824004000, 844570800, 856058400, 876106800, 888717600, 908074800, 919562400, 938919600, 951616800, 970974000, 982461600, 1003028400, 1013911200, 1036292400, 1045360800, 1066532400, 1076810400, 1099364400, 1108864800, 1129431600, 1140314400, 1162695600, 1172368800, 1192330800, 1203213600, 1224385200, 1234663200, 1255834800, 1266717600, 1287284400, 1298167200, 1318734000, 1330221600, 1350788400, 1361066400, 1382238000, 1392516000, 1413687600, 1424570400, 1445137200, 1456020000, 1476586800, 1487469600, 1508036400, 1518919200, 1541300400, 1550368800, 1572750000, 1581818400, 1604199600, 1613872800, 1636254000, 1645322400, 1667703600, 1677376800, 1699153200, 1708221600, 1730602800, 1739671200, 1762052400, 1771725600, 1793502000, 1803175200, 1825556400, 1834624800, 1857006000, 1866074400, 1888455600, 1897524000, 1919905200, 1928973600, 1951354800, 1960423200, 1983409200, 1992477600, 2014858800, 2024532000, 2046308400, 2055376800, 2077758000, 2086826400, 2109207600, 2118880800, 2140657200 } - transPost32:intvector { 0, -2144636896, 0, -2122255696 } + trans:intvector { -1767214412, -1206957600, -1191362400, -1175374800, -1159826400, -633819600, -622069200, -602283600, -591832800, -570747600, -560210400, -539125200, -531352800, -195426000, -184197600, -155163600, -150069600, -128898000, -121125600, -99954000, -89589600, -68418000, -57967200, 499748400, 511236000, 530593200, 540266400, 562129200, 571197600, 592974000, 602042400, 624423600, 634701600, 656478000, 666756000, 687927600, 697600800, 719982000, 728445600, 750826800, 761709600, 782276400, 793159200, 813726000, 824004000, 844570800, 856058400, 876106800, 888717600, 908074800, 919562400, 938919600, 951616800, 970974000, 982461600, 1003028400, 1013911200, 1036292400, 1045360800, 1066532400, 1076810400, 1099364400, 1108864800, 1129431600, 1140314400, 1162695600, 1172368800, 1192330800, 1203213600, 1224385200, 1234663200, 1255834800, 1266717600, 1287284400, 1298167200, 1318734000, 1330221600, 1350788400, 1361066400, 1382238000, 1392516000, 1413687600, 1424570400, 1445137200, 1456020000, 1476586800, 1487469600, 1508036400, 1518919200, 1541300400, 1550368800 } typeOffsets:intvector { -11188, 0, -10800, 0, -10800, 3600 } - typeMap:bin { "01020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102" } - finalRule { "Brazil" } - finalRaw:int { -10800 } - finalYear:int { 2039 } + typeMap:bin { "01020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } links:intvector { 202, 372, 376 } } //Z#202 /* America/Scoresbysund */ :table { @@ -1127,7 +1117,7 @@ zoneinfo64:table(nofallback) { /* America/Tortola */ :int { 186 } //Z#218 /* America/Vancouver */ :table { transPre32:intvector { -1, 1581086444 } - trans:intvector { -1632060000, -1615129200, -880207200, -765385200, -747237600, -732726000, -715788000, -702486000, -684338400, -671036400, -652888800, -639586800, -620834400, -608137200, -589384800, -576082800, -557935200, -544633200, -526485600, -513183600, -495036000, -481734000, -463586400, -450284400, -431532000, -418230000, -400082400, -386780400, -368632800, -355330800, -337183200, -323881200, -305733600, -292431600, -273679200, -260982000, -242229600, -226508400, -210780000, -195058800, -179330400, -163609200, -147880800, -131554800, -116431200, -100105200, -84376800, -68655600, -52927200, -37206000, -21477600, -5756400, 9972000, 25693200, 41421600, 57747600, 73476000, 89197200, 104925600, 120646800, 136375200, 152096400, 167824800, 183546000, 199274400, 215600400, 230724000, 247050000, 262778400, 278499600, 294228000, 309949200, 325677600, 341398800, 357127200, 372848400, 388576800, 404902800, 420026400, 436352400, 452080800, 467802000, 483530400, 499251600, 514980000, 530701200, 544615200, 562150800, 576064800, 594205200, 607514400, 625654800, 638964000, 657104400, 671018400, 688554000, 702468000, 720003600, 733917600, 752058000, 765367200, 783507600, 796816800, 814957200, 828871200, 846406800, 860320800, 877856400, 891770400, 909306000, 923220000, 941360400, 954669600, 972810000, 986119200, 1004259600, 1018173600, 1035709200, 1049623200, 1067158800, 1081072800, 1099213200, 1112522400, 1130662800, 1143972000, 1162112400, 1173607200, 1194166800 } + trans:intvector { -1632060000, -1615129200, -880207200, -765385200, -747237600, -733935600, -715788000, -702486000, -684338400, -671036400, -652888800, -639586800, -620834400, -608137200, -589384800, -576082800, -557935200, -544633200, -526485600, -513183600, -495036000, -481734000, -463586400, -450284400, -431532000, -418230000, -400082400, -386780400, -368632800, -355330800, -337183200, -323881200, -305733600, -292431600, -273679200, -260982000, -242229600, -226508400, -210780000, -195058800, -179330400, -163609200, -147880800, -131554800, -116431200, -100105200, -84376800, -68655600, -52927200, -37206000, -21477600, -5756400, 9972000, 25693200, 41421600, 57747600, 73476000, 89197200, 104925600, 120646800, 136375200, 152096400, 167824800, 183546000, 199274400, 215600400, 230724000, 247050000, 262778400, 278499600, 294228000, 309949200, 325677600, 341398800, 357127200, 372848400, 388576800, 404902800, 420026400, 436352400, 452080800, 467802000, 483530400, 499251600, 514980000, 530701200, 544615200, 562150800, 576064800, 594205200, 607514400, 625654800, 638964000, 657104400, 671018400, 688554000, 702468000, 720003600, 733917600, 752058000, 765367200, 783507600, 796816800, 814957200, 828871200, 846406800, 860320800, 877856400, 891770400, 909306000, 923220000, 941360400, 954669600, 972810000, 986119200, 1004259600, 1018173600, 1035709200, 1049623200, 1067158800, 1081072800, 1099213200, 1112522400, 1130662800, 1143972000, 1162112400, 1173607200, 1194166800 } typeOffsets:intvector { -29548, 0, -28800, 0, -28800, 3600 } typeMap:bin { "010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } finalRule { "Canada" } @@ -1374,22 +1364,22 @@ zoneinfo64:table(nofallback) { } //Z#267 /* Asia/Gaza */ :table { transPre32:intvector { -1, 2109557424 } - trans:intvector { -933645600, -857358000, -844300800, -825822000, -812685600, -794199600, -779853600, -762656400, -748310400, -731127600, -399088800, -386650800, -368330400, -355114800, -336790800, -323654400, -305168400, -292032000, -273632400, -260496000, -242096400, -228960000, -210560400, -197424000, -178938000, -165801600, -147402000, -134265600, -115866000, -102643200, -84330000, -81313200, 142380000, 150843600, 167176800, 178664400, 334015200, 337644000, 452556000, 462232800, 482277600, 495579600, 516751200, 526424400, 545436000, 558478800, 576626400, 589323600, 609890400, 620773200, 638316000, 651618000, 669765600, 683672400, 701820000, 715726800, 733701600, 747176400, 765151200, 778021200, 796600800, 810075600, 828655200, 843170400, 860104800, 874620000, 891554400, 906069600, 924213600, 939934800, 956268000, 971989200, 987717600, 1003438800, 1019167200, 1034888400, 1050616800, 1066338000, 1082066400, 1096581600, 1113516000, 1128380400, 1143842400, 1158872400, 1175378400, 1189638000, 1206655200, 1219957200, 1238104800, 1252015200, 1269640860, 1281474000, 1301608860, 1312146000, 1333058400, 1348178400, 1364508000, 1380229200, 1395957600, 1414098000, 1427493600, 1445547600, 1458946800, 1477692000 } + trans:intvector { -933645600, -857358000, -844300800, -825822000, -812685600, -794199600, -779853600, -762656400, -748310400, -731127600, -399088800, -386650800, -368330400, -355114800, -336790800, -323654400, -305168400, -292032000, -273632400, -260496000, -242096400, -228960000, -210560400, -197424000, -178938000, -165801600, -147402000, -134265600, -115866000, -102643200, -84330000, -81313200, 142380000, 150843600, 167176800, 178664400, 334015200, 337644000, 452556000, 462232800, 482277600, 495579600, 516751200, 526424400, 545436000, 558478800, 576626400, 589323600, 609890400, 620773200, 638316000, 651618000, 669765600, 683672400, 701820000, 715726800, 733701600, 747176400, 765151200, 778021200, 796600800, 810075600, 828655200, 843170400, 860104800, 874620000, 891554400, 906069600, 924213600, 939934800, 956268000, 971989200, 987717600, 1003438800, 1019167200, 1034888400, 1050616800, 1066338000, 1082066400, 1096581600, 1113516000, 1128380400, 1143842400, 1158872400, 1175378400, 1189638000, 1206655200, 1219957200, 1238104800, 1252015200, 1269640860, 1281474000, 1301608860, 1312146000, 1333058400, 1348178400, 1364508000, 1380229200, 1395957600, 1414098000, 1427493600, 1445547600, 1458946800, 1477692000, 1490396400, 1509141600, 1521846000, 1540591200, 1553810400, 1572040800 } typeOffsets:intvector { 8272, 0, 7200, 0, 7200, 3600 } - typeMap:bin { "010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } + typeMap:bin { "010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } finalRule { "Palestine" } finalRaw:int { 7200 } - finalYear:int { 2017 } + finalYear:int { 2020 } } //Z#268 /* Asia/Harbin */ :int { 314 } //Z#269 /* Asia/Hebron */ :table { transPre32:intvector { -1, 2109557273 } - trans:intvector { -933645600, -857358000, -844300800, -825822000, -812685600, -794199600, -779853600, -762656400, -748310400, -731127600, -399088800, -386650800, -368330400, -355114800, -336790800, -323654400, -305168400, -292032000, -273632400, -260496000, -242096400, -228960000, -210560400, -197424000, -178938000, -165801600, -147402000, -134265600, -115866000, -102643200, -84330000, -81313200, 142380000, 150843600, 167176800, 178664400, 334015200, 337644000, 452556000, 462232800, 482277600, 495579600, 516751200, 526424400, 545436000, 558478800, 576626400, 589323600, 609890400, 620773200, 638316000, 651618000, 669765600, 683672400, 701820000, 715726800, 733701600, 747176400, 765151200, 778021200, 796600800, 810075600, 828655200, 843170400, 860104800, 874620000, 891554400, 906069600, 924213600, 939934800, 956268000, 971989200, 987717600, 1003438800, 1019167200, 1034888400, 1050616800, 1066338000, 1082066400, 1096581600, 1113516000, 1128380400, 1143842400, 1158872400, 1175378400, 1189638000, 1206655200, 1220216400, 1238104800, 1252015200, 1269554400, 1281474000, 1301608860, 1312146000, 1314655200, 1317330000, 1333058400, 1348178400, 1364508000, 1380229200, 1395957600, 1414098000, 1427493600, 1445547600, 1458946800, 1477692000 } + trans:intvector { -933645600, -857358000, -844300800, -825822000, -812685600, -794199600, -779853600, -762656400, -748310400, -731127600, -399088800, -386650800, -368330400, -355114800, -336790800, -323654400, -305168400, -292032000, -273632400, -260496000, -242096400, -228960000, -210560400, -197424000, -178938000, -165801600, -147402000, -134265600, -115866000, -102643200, -84330000, -81313200, 142380000, 150843600, 167176800, 178664400, 334015200, 337644000, 452556000, 462232800, 482277600, 495579600, 516751200, 526424400, 545436000, 558478800, 576626400, 589323600, 609890400, 620773200, 638316000, 651618000, 669765600, 683672400, 701820000, 715726800, 733701600, 747176400, 765151200, 778021200, 796600800, 810075600, 828655200, 843170400, 860104800, 874620000, 891554400, 906069600, 924213600, 939934800, 956268000, 971989200, 987717600, 1003438800, 1019167200, 1034888400, 1050616800, 1066338000, 1082066400, 1096581600, 1113516000, 1128380400, 1143842400, 1158872400, 1175378400, 1189638000, 1206655200, 1220216400, 1238104800, 1252015200, 1269554400, 1281474000, 1301608860, 1312146000, 1314655200, 1317330000, 1333058400, 1348178400, 1364508000, 1380229200, 1395957600, 1414098000, 1427493600, 1445547600, 1458946800, 1477692000, 1490396400, 1509141600, 1521846000, 1540591200, 1553810400, 1572040800 } typeOffsets:intvector { 8423, 0, 7200, 0, 7200, 3600 } - typeMap:bin { "0102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } + typeMap:bin { "0102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } finalRule { "Palestine" } finalRaw:int { 7200 } - finalYear:int { 2017 } + finalYear:int { 2020 } } //Z#270 /* Asia/Ho_Chi_Minh */ :table { trans:intvector { -2004073600, -1851577590, -852105600, -782643600, -767869200, -718095600, -457776000, -315648000, 171820800 } @@ -1398,9 +1388,9 @@ zoneinfo64:table(nofallback) { links:intvector { 271, 310, 630 } } //Z#271 /* Asia/Hong_Kong */ :table { - trans:intvector { -2056690800, -900909000, -891579600, -884248200, -766659600, -747981000, -728544600, -717049800, -694503000, -683785800, -668064600, -654755400, -636615000, -623305800, -605165400, -591856200, -573715800, -559801800, -541661400, -528352200, -510211800, -498112200, -478762200, -466662600, -446707800, -435213000, -415258200, -403158600, -383808600, -371709000, -352359000, -340259400, -320909400, -308809800, -288855000, -277360200, -257405400, -245910600, -225955800, -213856200, -194506200, -182406600, -163056600, -148537800, -132816600, -117088200, -101367000, -85638600, -69312600, -53584200, -37863000, -22134600, -6413400, 9315000, 25036200, 40764600, 56485800, 72214200, 88540200, 104268600, 119989800, 126041400, 151439400, 167167800, 182889000, 198617400, 214338600, 295385400, 309292200 } - typeOffsets:intvector { 27402, 0, 28800, 0, 28800, 3600, 30600, 0, 32400, 0 } - typeMap:bin { "010203040102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } + trans:intvector { -2056690800, -900910800, -891579600, -884248200, -761209200, -747907200, -728541000, -717049800, -697091400, -683785800, -668061000, -654755400, -636611400, -623305800, -605161800, -591856200, -573712200, -559801800, -541657800, -528352200, -510211800, -498112200, -478762200, -466662600, -446707800, -435213000, -415258200, -403158600, -383808600, -371709000, -352359000, -340259400, -320909400, -308809800, -288855000, -277360200, -257405400, -245910600, -225955800, -213856200, -194506200, -182406600, -163056600, -148537800, -132816600, -117088200, -101367000, -85638600, -69312600, -53584200, -37863000, -22134600, -6413400, 9315000, 25036200, 40764600, 56485800, 72214200, 88540200, 104268600, 119989800, 126041400, 151439400, 167167800, 182889000, 198617400, 214338600, 295385400, 309292200 } + typeOffsets:intvector { 27402, 0, 28800, 0, 28800, 1800, 28800, 3600, 32400, 0 } + typeMap:bin { "010302040103010301030103010301030103010301030103010301030103010301030103010301030103010301030103010301030103010301030103010301030103010301" } links:intvector { 272, 511 } } //Z#272 /* Asia/Hovd */ :table { @@ -1588,9 +1578,9 @@ zoneinfo64:table(nofallback) { typeMap:bin { "010203040302030203020302030203020302030203020302" } } //Z#312 /* Asia/Seoul */ :table { - trans:intvector { -1948782472, -1830414600, -498128400, -462702600, -451733400, -429784200, -418296600, -399544200, -387451800, -368094600, -356002200, -336645000, -324552600, -305195400, -293103000, -264933000, 547578000, 560883600, 579027600, 592333200 } + trans:intvector { -1948782472, -1830414600, -681210000, -672228000, -654771600, -640864800, -623408400, -609415200, -588848400, -577965600, -498128400, -462702600, -451733400, -429784200, -418296600, -399544200, -387451800, -368094600, -356002200, -336645000, -324552600, -305195400, -293103000, -264933000, 547578000, 560883600, 579027600, 592333200 } typeOffsets:intvector { 30472, 0, 30600, 0, 30600, 3600, 32400, 0, 32400, 3600 } - typeMap:bin { "0103010201020102010201020102010304030403" } + typeMap:bin { "01030403040304030403010201020102010201020102010304030403" } links:intvector { 313, 597 } } //Z#313 /* Asia/Shanghai */ :table { @@ -2093,7 +2083,7 @@ zoneinfo64:table(nofallback) { } //Z#445 /* Europe/Bratislava */ :int { 477 } //Z#446 /* Europe/Brussels */ :table { - transPre32:intvector { -1, 1844014246 } + transPre32:intvector { -1, 1843972096 } trans:intvector { -1740355200, -1693702800, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -1613826000, -1604278800, -1585530000, -1574038800, -1552266000, -1539997200, -1520557200, -1507510800, -1490576400, -1473642000, -1459126800, -1444006800, -1427677200, -1411952400, -1396227600, -1379293200, -1364778000, -1348448400, -1333328400, -1316394000, -1301263200, -1284328800, -1269813600, -1253484000, -1238364000, -1221429600, -1206914400, -1191189600, -1175464800, -1160344800, -1143410400, -1127685600, -1111960800, -1096840800, -1080511200, -1063576800, -1049061600, -1033336800, -1017612000, -1002492000, -986162400, -969228000, -950479200, -942012000, -934668000, -857257200, -844556400, -828226800, -812502000, -798073200, -781052400, -766623600, -745455600, -733273200, 228877200, 243997200, 260326800, 276051600, 291776400, 307501200, 323830800, 338950800, 354675600, 370400400, 386125200, 401850000, 417574800, 433299600, 449024400, 465354000, 481078800, 496803600, 512528400, 528253200, 543978000, 559702800, 575427600, 591152400, 606877200, 622602000, 638326800, 654656400, 670381200, 686106000, 701830800, 717555600, 733280400, 749005200, 764730000, 780454800, 796179600, 811904400, 828234000, 846378000 } typeOffsets:intvector { 1050, 0, 0, 0, 0, 3600, 3600, 0, 3600, 3600 } typeMap:bin { "010304030403040301020102010201020102010201020102010201020102010201020102010201020102010201020102010201020403040304030403040304030403040304030403040304030403040304030403040304030403040304030403040304030403" } @@ -2170,17 +2160,17 @@ zoneinfo64:table(nofallback) { /* Europe/Isle_of_Man */ :int { 465 } //Z#457 /* Europe/Istanbul */ :table { transPre32:intvector { -1, 1454819544 } - trans:intvector { -1869875816, -1693706400, -1680490800, -1570413600, -1552186800, -1538359200, -1522551600, -1507514400, -1490583600, -1440208800, -1428030000, -1409709600, -1396494000, -931140000, -922762800, -917834400, -892436400, -875844000, -857358000, -781063200, -764737200, -744343200, -733806000, -716436000, -701924400, -684986400, -670474800, -654141600, -639025200, -621828000, -606970800, -590032800, -575434800, -235620000, -228279600, -177732000, -165726000, 10533600, 23835600, 41983200, 55285200, 74037600, 87339600, 107910000, 121219200, 133920000, 152676000, 165362400, 183502800, 202428000, 215557200, 228866400, 245797200, 260316000, 277246800, 308779200, 323827200, 340228800, 354672000, 371678400, 386121600, 403128000, 428446800, 433886400, 482792400, 496702800, 512521200, 528246000, 543970800, 559695600, 575420400, 591145200, 606870000, 622594800, 638319600, 654649200, 670374000, 686098800, 701823600, 717548400, 733273200, 748998000, 764118000, 780447600, 796172400, 811897200, 828226800, 846370800, 859676400, 877820400, 891126000, 909270000, 922575600, 941324400, 954025200, 972774000, 985474800, 1004223600, 1017529200, 1035673200, 1048978800, 1067122800, 1080428400, 1099177200, 1111878000, 1130626800, 1143327600, 1162076400, 1174784400, 1193533200, 1206838800, 1224982800, 1238288400, 1256432400, 1269738000, 1288486800, 1301274000, 1319936400, 1332637200, 1351386000, 1364691600, 1382835600, 1396227600, 1414285200, 1427590800, 1446944400, 1459040400, 1473195600 } + trans:intvector { -1869875816, -1693706400, -1680490800, -1570413600, -1552186800, -1538359200, -1522551600, -1507514400, -1490583600, -1440208800, -1428030000, -1409709600, -1396494000, -931053600, -922676400, -917834400, -892436400, -875844000, -764737200, -744343200, -733806000, -716436000, -701924400, -684986400, -670474800, -654141600, -639025200, -622087200, -606970800, -590032800, -575521200, -235620000, -194842800, -177732000, -165726000, 107910000, 121215600, 133920000, 152665200, 164678400, 184114800, 196214400, 215564400, 228873600, 245804400, 260323200, 267915600, 428454000, 433893600, 468111600, 482799600, 496710000, 512521200, 528246000, 543970800, 559695600, 575420400, 591145200, 606870000, 622594800, 638319600, 654649200, 670374000, 686098800, 701823600, 717548400, 733273200, 748998000, 764118000, 780447600, 796172400, 811897200, 828226800, 846370800, 859676400, 877820400, 891126000, 909270000, 922575600, 941324400, 954025200, 972774000, 985474800, 1004223600, 1017529200, 1035673200, 1048978800, 1067122800, 1080428400, 1099177200, 1111878000, 1130626800, 1143327600, 1162076400, 1174784400, 1193533200, 1206838800, 1224982800, 1238288400, 1256432400, 1269738000, 1288486800, 1301274000, 1319936400, 1332637200, 1351386000, 1364691600, 1382835600, 1396227600, 1414285200, 1427590800, 1446944400, 1459040400, 1473195600 } typeOffsets:intvector { 6952, 0, 7016, 0, 7200, 0, 7200, 3600, 10800, 0, 10800, 3600 } - typeMap:bin { "010203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030504050405040504050403020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020304" } + typeMap:bin { "01020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030405040203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020302030203020304" } links:intvector { 275, 458, 613 } } //Z#458 /* Europe/Jersey */ :int { 465 } //Z#459 /* Europe/Kaliningrad */ :table { transPre32:intvector { -1, 1872911176 } - trans:intvector { -1693706400, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -938905200, -857257200, -844556400, -828226800, -812502000, -796777200, -788922000, -778730400, -762663600, -757389600, 354920400, 370728000, 386456400, 402264000, 417992400, 433800000, 449614800, 465346800, 481071600, 496796400, 512521200, 528246000, 543970800, 559695600, 575420400, 591145200, 606870000, 622598400, 638323200, 654652800, 670377600, 686102400, 701827200, 717552000, 733276800, 749001600, 764726400, 780451200, 796176000, 811900800, 828230400, 846374400, 859680000, 877824000, 891129600, 909273600, 922579200, 941328000, 954028800, 972777600, 985478400, 1004227200, 1017532800, 1035676800, 1048982400, 1067126400, 1080432000, 1099180800, 1111881600, 1130630400, 1143331200, 1162080000, 1174780800, 1193529600, 1206835200, 1224979200, 1238284800, 1256428800, 1269734400, 1288483200, 1301184000, 1414278000 } + trans:intvector { -1693706400, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -938905200, -857257200, -844556400, -828226800, -812502000, -796777200, -781052400, -780372000, -778730400, -762663600, -749095200, 354920400, 370728000, 386456400, 402264000, 417992400, 433800000, 449614800, 465346800, 481071600, 496796400, 512521200, 528246000, 543970800, 559695600, 575420400, 591145200, 606870000, 622598400, 638323200, 654652800, 670377600, 686102400, 701827200, 717552000, 733276800, 749001600, 764726400, 780451200, 796176000, 811900800, 828230400, 846374400, 859680000, 877824000, 891129600, 909273600, 922579200, 941328000, 954028800, 972777600, 985478400, 1004227200, 1017532800, 1035676800, 1048982400, 1067126400, 1080432000, 1099180800, 1111881600, 1130630400, 1143331200, 1162080000, 1174780800, 1193529600, 1206835200, 1224979200, 1238284800, 1256428800, 1269734400, 1288483200, 1301184000, 1414278000 } typeOffsets:intvector { 4920, 0, 3600, 0, 3600, 3600, 7200, 0, 7200, 3600, 10800, 0, 10800, 3600 } - typeMap:bin { "01020102010201020102010201030403050605060506050605060506050605060504030403040304030403040304030403040304030403040304030403040304030403040304030403040304030503" } + typeMap:bin { "0102010201020102010201020102030403050605060506050605060506050605060504030403040304030403040304030403040304030403040304030403040304030403040304030403040304030503" } } //Z#460 /* Europe/Kiev */ :table { trans:intvector { -1441159324, -1247536800, -892522800, -857257200, -844556400, -828226800, -825382800, 354920400, 370728000, 386456400, 402264000, 417992400, 433800000, 449614800, 465346800, 481071600, 496796400, 512521200, 528246000, 543970800, 559695600, 575420400, 591145200, 606870000, 622594800, 638319600, 646783200, 686102400, 701820000, 717541200, 733269600, 748990800, 764719200, 780440400, 796179600, 811904400, 828234000, 846378000 } @@ -2384,7 +2374,7 @@ zoneinfo64:table(nofallback) { /* Europe/Vatican */ :int { 479 } //Z#494 /* Europe/Vienna */ :table { transPre32:intvector { -1, 1872912175 } - trans:intvector { -1693706400, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -1569711600, -1555801200, -938905200, -857257200, -844556400, -828226800, -812502000, -796777200, -781052400, -780188400, -748479600, -733359600, -717634800, -701910000, -684975600, -670460400, 323823600, 338940000, 354675600, 370400400, 386125200, 401850000, 417574800, 433299600, 449024400, 465354000, 481078800, 496803600, 512528400, 528253200, 543978000, 559702800, 575427600, 591152400, 606877200, 622602000, 638326800, 654656400, 670381200, 686106000, 701830800, 717555600, 733280400, 749005200, 764730000, 780454800, 796179600, 811904400, 828234000, 846378000 } + trans:intvector { -1693706400, -1680483600, -1663455600, -1650150000, -1632006000, -1618700400, -1569711600, -1555801200, -938905200, -857257200, -844556400, -828226800, -812502000, -796777200, -781052400, -780188400, -748479600, -733273200, -717634800, -701910000, -684975600, -670460400, 323823600, 338940000, 354675600, 370400400, 386125200, 401850000, 417574800, 433299600, 449024400, 465354000, 481078800, 496803600, 512528400, 528253200, 543978000, 559702800, 575427600, 591152400, 606877200, 622602000, 638326800, 654656400, 670381200, 686106000, 701830800, 717555600, 733280400, 749005200, 764730000, 780454800, 796179600, 811904400, 828234000, 846378000 } typeOffsets:intvector { 3921, 0, 3600, 0, 3600, 3600 } typeMap:bin { "010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201020102010201" } finalRule { "EU" } @@ -2612,12 +2602,12 @@ zoneinfo64:table(nofallback) { typeMap:bin { "0102" } } //Z#559 /* Pacific/Fiji */ :table { - trans:intvector { -1709985344, 909842400, 920124000, 941896800, 951573600, 1259416800, 1269698400, 1287842400, 1299333600, 1319292000, 1327154400, 1350741600, 1358604000, 1382796000, 1390050000, 1414850400, 1421503200, 1446300000 } + trans:intvector { -1709985344, 909842400, 920124000, 941896800, 951573600, 1259416800, 1269698400, 1287842400, 1299333600, 1319292000, 1327154400, 1350741600, 1358604000, 1382796000, 1390050000, 1414850400, 1421503200, 1446300000, 1452952800, 1478354400, 1484402400, 1509804000, 1515852000, 1541253600, 1547301600, 1573308000 } typeOffsets:intvector { 42944, 0, 43200, 0, 43200, 3600 } - typeMap:bin { "010201020102010201020102010201020102" } + typeMap:bin { "0102010201020102010201020102010201020102010201020102" } finalRule { "Fiji" } finalRaw:int { 43200 } - finalYear:int { 2016 } + finalYear:int { 2020 } } //Z#560 /* Pacific/Funafuti */ :table { transPre32:intvector { -1, 2117471484 } @@ -2699,9 +2689,12 @@ zoneinfo64:table(nofallback) { } //Z#575 /* Pacific/Norfolk */ :table { transPre32:intvector { -1, 2117474184 } - trans:intvector { -599656320, 152029800, 162912600, 1443882600 } - typeOffsets:intvector { 40312, 0, 39600, 0, 40320, 0, 41400, 0, 41400, 3600 } - typeMap:bin { "0203040301" } + trans:intvector { -599656320, 152029800, 162916200, 1443882600, 1570287600, 1586012400, 1601737200 } + typeOffsets:intvector { 40312, 0, 39600, 0, 39600, 3600, 40320, 0, 41400, 0, 41400, 3600 } + typeMap:bin { "0304050401020102" } + finalRule { "AN" } + finalRaw:int { 39600 } + finalYear:int { 2021 } } //Z#576 /* Pacific/Noumea */ :table { trans:intvector { -1829387148, 250002000, 257342400, 281451600, 288878400, 849366000, 857228400 } @@ -3086,84 +3079,81 @@ zoneinfo64:table(nofallback) { AV:intvector { 9, 1, -1, 7200, 1, 3, 1, -1, 7200, 1, 3600 } //_#3 - Brazil:intvector { - 10, 1, -1, 0, 0, 1, 15, -1, 0, 0, 3600 - } //_#4 C-Eur:intvector { 2, -31, -1, 7200, 1, 9, -31, -1, 7200, 1, 3600 - } //_#5 + } //_#4 Canada:intvector { 2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600 - } //_#6 + } //_#5 Chatham:intvector { 8, -30, -1, 9900, 1, 3, 1, -1, 9900, 1, 3600 - } //_#7 + } //_#6 Chile:intvector { 8, 2, -1, 14400, 2, 3, 2, -1, 10800, 2, 3600 - } //_#8 + } //_#7 Cuba:intvector { 2, 8, -1, 0, 1, 10, 1, -1, 0, 1, 3600 - } //_#9 + } //_#8 EU:intvector { 2, -31, -1, 3600, 2, 9, -31, -1, 3600, 2, 3600 - } //_#10 + } //_#9 EUAsia:intvector { 2, -31, -1, 3600, 2, 9, -31, -1, 3600, 2, 3600 - } //_#11 + } //_#10 Fiji:intvector { - 10, 1, -1, 7200, 0, 0, 13, -1, 10800, 0, 3600 - } //_#12 + 10, 8, -1, 7200, 0, 0, 12, -1, 10800, 0, 3600 + } //_#11 Haiti:intvector { 2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600 - } //_#13 + } //_#12 Iran:intvector { 2, 20, 0, 86400, 0, 8, 20, 0, 86400, 0, 3600 - } //_#14 + } //_#13 Jordan:intvector { 2, -31, -5, 86400, 0, 9, -31, -6, 0, 1, 3600 - } //_#15 + } //_#14 LH:intvector { 9, 1, -1, 7200, 0, 3, 1, -1, 7200, 0, 1800 - } //_#16 + } //_#15 Lebanon:intvector { 2, -31, -1, 0, 0, 9, -31, -1, 0, 0, 3600 - } //_#17 + } //_#16 Mexico:intvector { 3, 1, -1, 7200, 0, 9, -31, -1, 7200, 0, 3600 - } //_#18 + } //_#17 Moldova:intvector { 2, -31, -1, 7200, 0, 9, -31, -1, 10800, 0, 3600 - } //_#19 + } //_#18 NZ:intvector { 8, -30, -1, 7200, 1, 3, 1, -1, 7200, 1, 3600 - } //_#20 + } //_#19 Palestine:intvector { - 2, 24, -7, 3600, 0, 9, -31, -7, 3600, 0, 3600 - } //_#21 + 2, -31, -6, 0, 0, 9, -31, -7, 3600, 0, 3600 + } //_#20 Para:intvector { 9, 1, -1, 0, 0, 2, 22, -1, 0, 0, 3600 - } //_#22 + } //_#21 Syria:intvector { 2, -31, -6, 0, 0, 9, -31, -6, 0, 0, 3600 - } //_#23 + } //_#22 SystemV:intvector { 3, -30, -1, 7200, 0, 9, -31, -1, 7200, 0, 3600 - } //_#24 + } //_#23 Thule:intvector { 2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600 - } //_#25 + } //_#24 Troll:intvector { 2, -31, -1, 3600, 2, 9, -31, -1, 3600, 2, 7200 - } //_#26 + } //_#25 US:intvector { 2, 8, -1, 7200, 0, 10, 1, -1, 7200, 0, 3600 - } //_#27 + } //_#26 WS:intvector { 8, -30, -1, 10800, 0, 3, 1, -1, 14400, 0, 3600 - } //_#28 + } //_#27 Zion:intvector { 2, 23, -6, 7200, 0, 9, -31, -1, 7200, 0, 3600 - } //_#29 + } //_#28 } Regions:array { "AU", //Z#0 ACT diff --git a/ipc/chromium/chromium-config.mozbuild b/ipc/chromium/chromium-config.mozbuild index 9df182cb8..f045bca54 100644 --- a/ipc/chromium/chromium-config.mozbuild +++ b/ipc/chromium/chromium-config.mozbuild @@ -41,6 +41,9 @@ else: if CONFIG['OS_ARCH'] == 'Darwin': DEFINES['OS_MACOSX'] = 1 + elif CONFIG['OS_ARCH'] == 'SunOS': + DEFINES['OS_SOLARIS'] = 1 + elif CONFIG['OS_ARCH'] == 'DragonFly': DEFINES.update({ 'OS_DRAGONFLY': 1, diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build index f047e7011..ba5f4e512 100644 --- a/ipc/chromium/moz.build +++ b/ipc/chromium/moz.build @@ -132,12 +132,21 @@ if os_linux: DEFINES['ANDROID'] = True DEFINES['_POSIX_MONOTONIC_CLOCK'] = 0 -if os_bsd or os_linux: +if os_bsd or os_linux or os_solaris: if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: SOURCES += [ 'src/base/message_pump_glib.cc', ] +if os_solaris: + SOURCES += [ + 'src/base/atomicops_internals_x86_gcc.cc', + 'src/base/process_util_linux.cc', + 'src/base/time_posix.cc', +] + +LOCAL_INCLUDES += ['src/third_party/libevent/linux'] + ost = CONFIG['OS_TEST'] if '86' not in ost and 'arm' not in ost and 'aarch64' != ost and 'mips' not in ost: SOURCES += [ diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc index 3c794b276..638018feb 100644 --- a/ipc/chromium/src/base/message_loop.cc +++ b/ipc/chromium/src/base/message_loop.cc @@ -21,7 +21,7 @@ #if defined(OS_POSIX) #include "base/message_pump_libevent.h" #endif -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined (OS_SOLARIS) #if defined(MOZ_WIDGET_GTK) #include "base/message_pump_glib.h" #endif @@ -149,7 +149,7 @@ MessageLoop::MessageLoop(Type type, nsIThread* aThread) if (type_ == TYPE_UI) { #if defined(OS_MACOSX) pump_ = base::MessagePumpMac::Create(); -#elif defined(OS_LINUX) || defined(OS_BSD) +#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) pump_ = new base::MessagePumpForUI(); #endif // OS_LINUX } else if (type_ == TYPE_IO) { diff --git a/ipc/chromium/src/base/message_pump_glib.cc b/ipc/chromium/src/base/message_pump_glib.cc index 36ebfdd69..24081bd8b 100644 --- a/ipc/chromium/src/base/message_pump_glib.cc +++ b/ipc/chromium/src/base/message_pump_glib.cc @@ -9,6 +9,9 @@ #include <fcntl.h> #include <math.h> +#ifdef OS_SOLARIS +#include <unistd.h> +#endif #include <gtk/gtk.h> #include <glib.h> @@ -131,6 +134,12 @@ MessagePumpForUI::MessagePumpForUI() // Create our wakeup pipe, which is used to flag when work was scheduled. int fds[2]; CHECK(pipe(fds) == 0); +#ifdef OS_SOLARIS + int flags = fcntl(fds[0], F_GETFL,0); + if (flags == -1) + flags = 0; + fcntl(fds[0], F_SETFL, flags | O_NDELAY); +#endif wakeup_pipe_read_ = fds[0]; wakeup_pipe_write_ = fds[1]; wakeup_gpollfd_->fd = wakeup_pipe_read_; @@ -238,11 +247,15 @@ bool MessagePumpForUI::HandleCheck() { // whether there was data, so this read shouldn't block. if (wakeup_gpollfd_->revents & G_IO_IN) { pipe_full_ = false; - +#ifndef OS_SOLARIS char msg; if (HANDLE_EINTR(read(wakeup_pipe_read_, &msg, 1)) != 1 || msg != '!') { NOTREACHED() << "Error reading from the wakeup pipe."; } +#else + char buf[32]; + while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32))); +#endif // Since we ate the message, we need to record that we have more work, // because HandleCheck() may be called without HandleDispatch being called // afterwards. @@ -311,6 +324,10 @@ void MessagePumpForUI::ScheduleWork() { // variables as we would then need locks all over. This ensures that if // we are sleeping in a poll that we will wake up. char msg = '!'; +#ifdef OS_SOLARIS + char buf[32]; + while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32))); +#endif if (HANDLE_EINTR(write(wakeup_pipe_write_, &msg, 1)) != 1) { NOTREACHED() << "Could not write to the UI message loop wakeup pipe!"; } diff --git a/ipc/chromium/src/base/message_pump_libevent.cc b/ipc/chromium/src/base/message_pump_libevent.cc index 3cca238c1..51d3205b8 100644 --- a/ipc/chromium/src/base/message_pump_libevent.cc +++ b/ipc/chromium/src/base/message_pump_libevent.cc @@ -8,6 +8,9 @@ #include <errno.h> #include <fcntl.h> +#ifdef OS_SOLARIS +#include <sys/stat.h> +#endif #if defined(ANDROID) || defined(OS_POSIX) #include <unistd.h> #endif @@ -21,7 +24,7 @@ #include "mozilla/UniquePtr.h" // This macro checks that the _EVENT_SIZEOF_* constants defined in -// ipc/chromiume/src/third_party/<platform>/event2/event-config.h are correct. +// ipc/chromium/src/third_party/<platform>/event2/event-config.h are correct. #if defined(_EVENT_SIZEOF_SHORT) #define CHECK_EVENT_SIZEOF(TYPE, type) \ static_assert(_EVENT_SIZEOF_##TYPE == sizeof(type), \ diff --git a/ipc/chromium/src/base/platform_thread.h b/ipc/chromium/src/base/platform_thread.h index 727a13a84..3432128a6 100644 --- a/ipc/chromium/src/base/platform_thread.h +++ b/ipc/chromium/src/base/platform_thread.h @@ -24,7 +24,7 @@ typedef void* PlatformThreadHandle; // HANDLE #elif defined(OS_POSIX) #include <pthread.h> typedef pthread_t PlatformThreadHandle; -#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(__GLIBC__) +#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) #include <unistd.h> typedef pid_t PlatformThreadId; #elif defined(OS_BSD) diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc index 4acd95f23..fdb2d9200 100644 --- a/ipc/chromium/src/base/platform_thread_posix.cc +++ b/ipc/chromium/src/base/platform_thread_posix.cc @@ -49,7 +49,7 @@ PlatformThreadId PlatformThread::CurrentId() { return port; #elif defined(OS_LINUX) return syscall(__NR_gettid); -#elif defined(OS_OPENBSD) || defined(__GLIBC__) +#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) return (intptr_t) (pthread_self()); #elif defined(OS_NETBSD) return _lwp_self(); @@ -103,6 +103,8 @@ void PlatformThread::SetName(const char* name) { pthread_setname_np(pthread_self(), "%s", (void *)name); #elif defined(OS_BSD) && !defined(__GLIBC__) pthread_set_name_np(pthread_self(), name); +#elif defined(OS_SOLARIS) + pthread_setname_np(pthread_self(), name); #else #endif } diff --git a/ipc/chromium/src/base/process_util.h b/ipc/chromium/src/base/process_util.h index 4df1f29fb..4bb125681 100644 --- a/ipc/chromium/src/base/process_util.h +++ b/ipc/chromium/src/base/process_util.h @@ -19,7 +19,7 @@ #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif -#elif defined(OS_LINUX) || defined(__GLIBC__) +#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(__GLIBC__) #include <dirent.h> #include <limits.h> #include <sys/types.h> @@ -39,26 +39,7 @@ #include "base/command_line.h" #include "base/process.h" -#if defined(OS_WIN) -typedef PROCESSENTRY32 ProcessEntry; -typedef IO_COUNTERS IoCounters; -#elif defined(OS_POSIX) -// TODO(port): we should not rely on a Win32 structure. -struct ProcessEntry { - int pid; - int ppid; - char szExeFile[NAME_MAX + 1]; -}; - -struct IoCounters { - unsigned long long ReadOperationCount; - unsigned long long WriteOperationCount; - unsigned long long OtherOperationCount; - unsigned long long ReadTransferCount; - unsigned long long WriteTransferCount; - unsigned long long OtherTransferCount; -}; - +#if defined(OS_POSIX) #include "base/file_descriptor_shuffle.h" #endif diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 57388ccb0..a0d5ae816 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -34,11 +34,6 @@ namespace { -enum ParsingState { - KEY_NAME, - KEY_VALUE -}; - static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG"); } // namespace diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc index ade3ebe5e..3eb952a32 100644 --- a/ipc/chromium/src/base/process_util_posix.cc +++ b/ipc/chromium/src/base/process_util_posix.cc @@ -117,7 +117,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { #if defined(ANDROID) static const rlim_t kSystemDefaultMaxFds = 1024; static const char kFDDir[] = "/proc/self/fd"; -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_SOLARIS) static const rlim_t kSystemDefaultMaxFds = 8192; static const char kFDDir[] = "/proc/self/fd"; #elif defined(OS_MACOSX) @@ -209,7 +209,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { // TODO(agl): Remove this function. It's fundamentally broken for multithreaded // apps. void SetAllFDsToCloseOnExec() { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) const char fd_dir[] = "/proc/self/fd"; #elif defined(OS_MACOSX) || defined(OS_BSD) const char fd_dir[] = "/dev/fd"; diff --git a/ipc/chromium/src/base/sys_info_posix.cc b/ipc/chromium/src/base/sys_info_posix.cc index 81ec78053..632aa2f37 100644 --- a/ipc/chromium/src/base/sys_info_posix.cc +++ b/ipc/chromium/src/base/sys_info_posix.cc @@ -121,7 +121,11 @@ std::wstring SysInfo::GetEnvVar(const wchar_t* var) { // static std::string SysInfo::OperatingSystemName() { +#ifndef XP_SOLARIS) utsname info; +#else + struct utsname info; +#endif if (uname(&info) < 0) { NOTREACHED(); return ""; @@ -129,9 +133,17 @@ std::string SysInfo::OperatingSystemName() { return std::string(info.sysname); } +// Solaris <sys/utsname.h> contains "extern struct utsname utsname;" +// As a consequence, any use of utsname has to be preceded with struct on +// Solaris. See Mozilla bugs 758483 and 1353332. + // static std::string SysInfo::CPUArchitecture() { +#ifndef XP_SOLARIS utsname info; +#else + struct utsname info; +#endif if (uname(&info) < 0) { NOTREACHED(); return ""; diff --git a/ipc/chromium/src/base/time.h b/ipc/chromium/src/base/time.h index 55bc7b451..cee463579 100644 --- a/ipc/chromium/src/base/time.h +++ b/ipc/chromium/src/base/time.h @@ -28,7 +28,7 @@ #include "base/basictypes.h" -#if defined(OS_WIN) +#ifdef OS_WIN // For FILETIME in FromFileTime, until it moves to a new converter class. // See TODO(iyengar) below. #include <windows.h> @@ -64,6 +64,10 @@ class TimeDelta { return delta_; } +#ifdef OS_SOLARIS + struct timespec ToTimeSpec() const; +#endif + // Returns the time delta in some unit. The F versions return a floating // point value, the "regular" versions return a rounded-down value. int InDays() const; @@ -226,8 +230,11 @@ class Time { static Time FromDoubleT(double dt); double ToDoubleT() const; +#ifdef OS_SOLARIS + struct timeval ToTimeVal() const; +#endif -#if defined(OS_WIN) +#ifdef OS_WIN static Time FromFileTime(FILETIME ft); FILETIME ToFileTime() const; #endif diff --git a/ipc/chromium/src/base/time_posix.cc b/ipc/chromium/src/base/time_posix.cc index 2eb76a989..5e0a922d9 100644 --- a/ipc/chromium/src/base/time_posix.cc +++ b/ipc/chromium/src/base/time_posix.cc @@ -67,11 +67,13 @@ Time Time::FromExploded(bool is_local, const Exploded& exploded) { timestruct.tm_wday = exploded.day_of_week; // mktime/timegm ignore this timestruct.tm_yday = 0; // mktime/timegm ignore this timestruct.tm_isdst = -1; // attempt to figure it out +#ifndef OS_SOLARIS timestruct.tm_gmtoff = 0; // not a POSIX field, so mktime/timegm ignore timestruct.tm_zone = NULL; // not a POSIX field, so mktime/timegm ignore +#endif time_t seconds; -#ifdef ANDROID +#if defined(ANDROID) || defined(OS_SOLARIS) seconds = mktime(×truct); #else if (is_local) @@ -175,7 +177,7 @@ TimeTicks TimeTicks::Now() { // With numer and denom = 1 (the expected case), the 64-bit absolute time // reported in nanoseconds is enough to last nearly 585 years. -#elif defined(OS_OPENBSD) || defined(OS_POSIX) && \ +#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_POSIX) && \ defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 struct timespec ts; @@ -200,4 +202,27 @@ TimeTicks TimeTicks::HighResNow() { return Now(); } +#ifdef OS_SOLARIS +struct timespec TimeDelta::ToTimeSpec() const { + int64_t microseconds = InMicroseconds(); + time_t seconds = 0; + if (microseconds >= Time::kMicrosecondsPerSecond) { + seconds = InSeconds(); + microseconds -= seconds * Time::kMicrosecondsPerSecond; + } + struct timespec result = + {seconds, + microseconds * Time::kNanosecondsPerMicrosecond}; + return result; +} + +struct timeval Time::ToTimeVal() const { + struct timeval result; + int64_t us = us_ - kTimeTToMicrosecondsOffset; + result.tv_sec = us / Time::kMicrosecondsPerSecond; + result.tv_usec = us % Time::kMicrosecondsPerSecond; + return result; +} +#endif + } // namespace base diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h index 390fa77a8..7e6beb37a 100644 --- a/ipc/chromium/src/build/build_config.h +++ b/ipc/chromium/src/build/build_config.h @@ -32,6 +32,8 @@ #define OS_NETBSD 1 #elif defined(__OpenBSD__) #define OS_OPENBSD 1 +#elif defined(__sun__) +#define OS_SOLARIS 1 #elif defined(_WIN32) #define OS_WIN 1 #else @@ -47,7 +49,7 @@ // For access to standard POSIX features, use OS_POSIX instead of a more // specific macro. -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) #define OS_POSIX 1 #endif diff --git a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc index 0d3a2b16c..9a8858656 100644 --- a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc +++ b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc @@ -8,6 +8,7 @@ #include <errno.h> #include <fcntl.h> +#include <limits.h> #if defined(OS_MACOSX) #include <sched.h> #endif @@ -39,8 +40,16 @@ #include "mozilla/ipc/Faulty.h" #endif -// Work around possible OS limitations. +// Use OS specific iovec array limit where it's possible +#if defined(IOV_MAX) +static const size_t kMaxIOVecSize = IOV_MAX; +// IOV_MAX isn't defined on Android, but the hard-coded 256 works well. +#elif defined(ANDROID) static const size_t kMaxIOVecSize = 256; +// On all other platforms, fallback to 16 (_XOPEN_IOV_MAX) as a safe bet. +#else +static const size_t kMaxIOVecSize = 16; +#endif #ifdef MOZ_TASK_TRACER #include "GeckoTaskTracerImpl.h" diff --git a/ipc/chromium/src/chrome/common/transport_dib.h b/ipc/chromium/src/chrome/common/transport_dib.h index b1e5c0fab..f40a97d17 100644 --- a/ipc/chromium/src/chrome/common/transport_dib.h +++ b/ipc/chromium/src/chrome/common/transport_dib.h @@ -15,7 +15,7 @@ #if defined(OS_WIN) #include <windows.h> -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_SOLARIS) #include "chrome/common/x11_util.h" #endif @@ -68,7 +68,7 @@ class TransportDIB { typedef base::SharedMemoryHandle Handle; // On Mac, the inode number of the backing file is used as an id. typedef base::SharedMemoryId Id; -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_SOLARIS) typedef int Handle; // These two ints are SysV IPC shared memory keys typedef int Id; #endif @@ -98,7 +98,7 @@ class TransportDIB { // wire to give this transport DIB to another process. Handle handle() const; -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) // Map the shared memory into the X server and return an id for the shared // segment. XID MapToX(Display* connection); @@ -109,7 +109,7 @@ class TransportDIB { #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD) explicit TransportDIB(base::SharedMemoryHandle dib); base::SharedMemory shared_memory_; -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_SOLARIS) int key_; // SysV shared memory id void* address_; // mapped address XID x_shm_; // X id for the shared segment diff --git a/ipc/chromium/src/third_party/libevent/arc4random.c b/ipc/chromium/src/third_party/libevent/arc4random.c index cabc46f4b..0dd6934ef 100644 --- a/ipc/chromium/src/third_party/libevent/arc4random.c +++ b/ipc/chromium/src/third_party/libevent/arc4random.c @@ -41,6 +41,10 @@ * RC4 is a registered trademark of RSA Laboratories. */ +#ifdef XP_SOLARIS +#include "build/build_config.h" +#endif + #ifndef ARC4RANDOM_EXPORT #define ARC4RANDOM_EXPORT #endif @@ -477,6 +481,7 @@ arc4random(void) } #endif +#if defined(_we_have_arc4random_buf) || !defined(XP_SOLARIS) ARC4RANDOM_EXPORT void arc4random_buf(void *_buf, size_t n) { @@ -490,6 +495,7 @@ arc4random_buf(void *_buf, size_t n) } _ARC4_UNLOCK(); } +#endif #ifndef ARC4RANDOM_NOUNIFORM /* diff --git a/ipc/chromium/src/third_party/libevent/event.c b/ipc/chromium/src/third_party/libevent/event.c index a979f1f26..f6b44bcaf 100644 --- a/ipc/chromium/src/third_party/libevent/event.c +++ b/ipc/chromium/src/third_party/libevent/event.c @@ -2883,8 +2883,10 @@ event_global_setup_locks_(const int enable_locks) #endif if (evsig_global_setup_locks_(enable_locks) < 0) return -1; +#ifndef OS_SOLARIS if (evutil_secure_rng_global_setup_locks_(enable_locks) < 0) return -1; +#endif return 0; } #endif diff --git a/ipc/chromium/src/third_party/libevent/evutil_rand.c b/ipc/chromium/src/third_party/libevent/evutil_rand.c index 3bab23121..7c92bae23 100644 --- a/ipc/chromium/src/third_party/libevent/evutil_rand.c +++ b/ipc/chromium/src/third_party/libevent/evutil_rand.c @@ -139,7 +139,7 @@ evutil_secure_rng_get_bytes(void *buf, size_t n) ev_arc4random_buf(buf, n); } -#if !defined(__OpenBSD__) && !defined(ANDROID) +#if !defined(__OpenBSD__) && !defined(ANDROID) && !defined(__sun__) void evutil_secure_rng_add_bytes(const char *buf, size_t n) { diff --git a/ipc/chromium/src/third_party/libevent/include/event2/util.h b/ipc/chromium/src/third_party/libevent/include/event2/util.h index 42a28adcb..78516c156 100644 --- a/ipc/chromium/src/third_party/libevent/include/event2/util.h +++ b/ipc/chromium/src/third_party/libevent/include/event2/util.h @@ -672,7 +672,7 @@ void evutil_secure_rng_get_bytes(void *buf, size_t n); */ int evutil_secure_rng_init(void); -#if !defined(__OpenBSD__) && !defined(ANDROID) +#if !defined(__OpenBSD__) && !defined(ANDROID) && !defined(__sun__) /** Seed the random number generator with extra random bytes. You should almost never need to call this function; it should be diff --git a/ipc/chromium/src/third_party/libevent/solaris/event2/event-config.h b/ipc/chromium/src/third_party/libevent/solaris/event2/event-config.h new file mode 100644 index 000000000..cc4fb1eb1 --- /dev/null +++ b/ipc/chromium/src/third_party/libevent/solaris/event2/event-config.h @@ -0,0 +1,476 @@ +/* event2/event-config.h + * + * This file was generated by autoconf when libevent was built, and post- + * processed by Libevent so that its macros would have a uniform prefix. + * + * DO NOT EDIT THIS FILE. + * + * Do not rely on macros in this file existing in later versions. + */ + +#ifndef _EVENT2_EVENT_CONFIG_H_ +#define _EVENT2_EVENT_CONFIG_H_ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if libevent should build without support for a debug mode */ +/* #undef _EVENT_DISABLE_DEBUG_MODE */ + +/* Define if libevent should not allow replacing the mm functions */ +/* #undef _EVENT_DISABLE_MM_REPLACEMENT */ + +/* Define if libevent should not be compiled with thread support */ +/* #undef _EVENT_DISABLE_THREAD_SUPPORT */ + +/* Define to 1 if you have the `arc4random' function. */ +#define _EVENT_HAVE_ARC4RANDOM 1 + +/* Define to 1 if you have the `arc4random_buf' function. */ +#define _EVENT_HAVE_ARC4RANDOM_BUF 1 + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define _EVENT_HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define _EVENT_HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you + don't. */ +/* #undef _EVENT_HAVE_DECL_CTL_KERN */ + +/* Define to 1 if you have the declaration of `KERN_ARND', and to 0 if you + don't. */ +/* #undef _EVENT_HAVE_DECL_KERN_ARND */ + +/* Define to 1 if you have the declaration of `KERN_RANDOM', and to 0 if you + don't. */ +/* #undef _EVENT_HAVE_DECL_KERN_RANDOM */ + +/* Define to 1 if you have the declaration of `RANDOM_UUID', and to 0 if you + don't. */ +/* #undef _EVENT_HAVE_DECL_RANDOM_UUID */ + +/* Define if /dev/poll is available */ +#define _EVENT_HAVE_DEVPOLL 1 + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define _EVENT_HAVE_DLFCN_H 1 + +/* Define if your system supports the epoll system calls */ +#undef _EVENT_HAVE_EPOLL + +/* Define to 1 if you have the `epoll_ctl' function. */ +/* #undef _EVENT_HAVE_EPOLL_CTL */ + +/* Define to 1 if you have the `eventfd' function. */ +/* #undef _EVENT_HAVE_EVENTFD */ + +/* Define if your system supports event ports */ +/*#define _EVENT_HAVE_EVENT_PORTS 1*/ + +/* Define to 1 if you have the `fcntl' function. */ +#define _EVENT_HAVE_FCNTL 1 + +/* Define to 1 if you have the <fcntl.h> header file. */ +#define _EVENT_HAVE_FCNTL_H 1 + +/* Define to 1 if the system has the type `fd_mask'. */ +#define _EVENT_HAVE_FD_MASK 1 + +/* Do we have getaddrinfo()? */ +#define _EVENT_HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getegid' function. */ +#define _EVENT_HAVE_GETEGID 1 + +/* Define to 1 if you have the `geteuid' function. */ +#define _EVENT_HAVE_GETEUID 1 + +/* Define this if you have any gethostbyname_r() */ +/* #undef _EVENT_HAVE_GETHOSTBYNAME_R */ + +/* Define this if gethostbyname_r takes 3 arguments */ +/* #undef _EVENT_HAVE_GETHOSTBYNAME_R_3_ARG */ + +/* Define this if gethostbyname_r takes 5 arguments */ +/* #undef _EVENT_HAVE_GETHOSTBYNAME_R_5_ARG */ + +/* Define this if gethostbyname_r takes 6 arguments */ +/* #undef _EVENT_HAVE_GETHOSTBYNAME_R_6_ARG */ + +/* Define to 1 if you have the `getnameinfo' function. */ +#define _EVENT_HAVE_GETNAMEINFO 1 + +/* Define to 1 if you have the `getprotobynumber' function. */ +#define _EVENT_HAVE_GETPROTOBYNUMBER 1 + +/* Define to 1 if you have the `getservbyname' function. */ +/* #undef _EVENT_HAVE_GETSERVBYNAME */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define _EVENT_HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `inet_aton' function. */ +#define _EVENT_HAVE_INET_ATON 1 + +/* Define to 1 if you have the `inet_ntop' function. */ +#define _EVENT_HAVE_INET_NTOP 1 + +/* Define to 1 if you have the `inet_pton' function. */ +#define _EVENT_HAVE_INET_PTON 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define _EVENT_HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `issetugid' function. */ +#define _EVENT_HAVE_ISSETUGID 1 + +/* Define to 1 if you have the `kqueue' function. */ +/* #undef _EVENT_HAVE_KQUEUE */ + +/* Define if the system has zlib */ +#define _EVENT_HAVE_LIBZ 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#define _EVENT_HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#define _EVENT_HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define _EVENT_HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in6.h> header file. */ +/* #undef _EVENT_HAVE_NETINET_IN6_H */ + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define _EVENT_HAVE_NETINET_IN_H 1 + +/* Define if the system has openssl */ +#define _EVENT_HAVE_OPENSSL 1 + +/* Define to 1 if you have the <openssl/bio.h> header file. */ +#define _EVENT_HAVE_OPENSSL_BIO_H 1 + +/* Define to 1 if you have the `pipe' function. */ +#define _EVENT_HAVE_PIPE 1 + +/* Define to 1 if you have the `poll' function. */ +#define _EVENT_HAVE_POLL 1 + +/* Define to 1 if you have the <poll.h> header file. */ +#define _EVENT_HAVE_POLL_H 1 + +/* Define to 1 if you have the `port_create' function. */ +#define _EVENT_HAVE_PORT_CREATE 1 + +/* Define to 1 if you have the <port.h> header file. */ +#define _EVENT_HAVE_PORT_H 1 + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef _EVENT_HAVE_PTHREAD */ + +/* Define if we have pthreads on this system */ +#define _EVENT_HAVE_PTHREADS 1 + +/* Define to 1 if you have the `putenv' function. */ +#define _EVENT_HAVE_PUTENV 1 + +/* Define to 1 if the system has the type `sa_family_t'. */ +#define _EVENT_HAVE_SA_FAMILY_T 1 + +/* Define to 1 if you have the `select' function. */ +#define _EVENT_HAVE_SELECT 1 + +/* Define to 1 if you have the `sendfile' function. */ +#define _EVENT_HAVE_SENDFILE 1 + +/* Define to 1 if you have the `setenv' function. */ +#define _EVENT_HAVE_SETENV 1 + +/* Define if F_SETFD is defined in <fcntl.h> */ +#define _EVENT_HAVE_SETFD 1 + +/* Define to 1 if you have the `sigaction' function. */ +#define _EVENT_HAVE_SIGACTION 1 + +/* Define to 1 if you have the `signal' function. */ +#define _EVENT_HAVE_SIGNAL 1 + +/* Define to 1 if you have the `splice' function. */ +/* #undef _EVENT_HAVE_SPLICE */ + +/* Define to 1 if you have the <stdarg.h> header file. */ +#define _EVENT_HAVE_STDARG_H 1 + +/* Define to 1 if you have the <stddef.h> header file. */ +#define _EVENT_HAVE_STDDEF_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define _EVENT_HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define _EVENT_HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define _EVENT_HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define _EVENT_HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define _EVENT_HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strsep' function. */ +#define _EVENT_HAVE_STRSEP 1 + +/* Define to 1 if you have the `strtok_r' function. */ +#define _EVENT_HAVE_STRTOK_R 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define _EVENT_HAVE_STRTOLL 1 + +/* Define to 1 if the system has the type `struct addrinfo'. */ +#define _EVENT_HAVE_STRUCT_ADDRINFO 1 + +/* Define to 1 if the system has the type `struct in6_addr'. */ +#define _EVENT_HAVE_STRUCT_IN6_ADDR 1 + +/* Define to 1 if `s6_addr16' is a member of `struct in6_addr'. */ +/* #undef _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR16 */ + +/* Define to 1 if `s6_addr32' is a member of `struct in6_addr'. */ +/* #undef _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR32 */ + +/* Define to 1 if the system has the type `struct sockaddr_in6'. */ +#define _EVENT_HAVE_STRUCT_SOCKADDR_IN6 1 + +/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */ +/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */ + +/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */ +/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ + +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE 1 + +/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */ +#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 + +/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */ +/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */ + +/* Define to 1 if you have the `sysctl' function. */ +/* #undef _EVENT_HAVE_SYSCTL */ + +/* Define to 1 if you have the <sys/devpoll.h> header file. */ +#define _EVENT_HAVE_SYS_DEVPOLL_H 1 + +/* Define to 1 if you have the <sys/epoll.h> header file. */ +/* #undef _EVENT_HAVE_SYS_EPOLL_H */ + +/* Define to 1 if you have the <sys/eventfd.h> header file. */ +/* #undef _EVENT_HAVE_SYS_EVENTFD_H */ + +/* Define to 1 if you have the <sys/event.h> header file. */ +/* #undef _EVENT_HAVE_SYS_EVENT_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define _EVENT_HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/mman.h> header file. */ +#define _EVENT_HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define _EVENT_HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/queue.h> header file. */ +#define _EVENT_HAVE_SYS_QUEUE_H 1 + +/* Define to 1 if you have the <sys/select.h> header file. */ +#define _EVENT_HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the <sys/sendfile.h> header file. */ +#define _EVENT_HAVE_SYS_SENDFILE_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define _EVENT_HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define _EVENT_HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/sysctl.h> header file. */ +#undef _EVENT_HAVE_SYS_SYSCTL_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define _EVENT_HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define _EVENT_HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/uio.h> header file. */ +#define _EVENT_HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define _EVENT_HAVE_SYS_WAIT_H 1 + +/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */ +#define _EVENT_HAVE_TAILQFOREACH 1 + +/* Define if timeradd is defined in <sys/time.h> */ +#define _EVENT_HAVE_TIMERADD 1 + +/* Define if timerclear is defined in <sys/time.h> */ +#define _EVENT_HAVE_TIMERCLEAR 1 + +/* Define if timercmp is defined in <sys/time.h> */ +#define _EVENT_HAVE_TIMERCMP 1 + +/* Define if timerisset is defined in <sys/time.h> */ +#define _EVENT_HAVE_TIMERISSET 1 + +/* Define to 1 if the system has the type `uint16_t'. */ +#define _EVENT_HAVE_UINT16_T 1 + +/* Define to 1 if the system has the type `uint32_t'. */ +#define _EVENT_HAVE_UINT32_T 1 + +/* Define to 1 if the system has the type `uint64_t'. */ +#define _EVENT_HAVE_UINT64_T 1 + +/* Define to 1 if the system has the type `uint8_t'. */ +#define _EVENT_HAVE_UINT8_T 1 + +/* Define to 1 if the system has the type `uintptr_t'. */ +#define _EVENT_HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the `umask' function. */ +#define _EVENT_HAVE_UMASK 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define _EVENT_HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `unsetenv' function. */ +#define _EVENT_HAVE_UNSETENV 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#define _EVENT_HAVE_VASPRINTF 1 + +/* Define if kqueue works correctly with pipes */ +/* #undef _EVENT_HAVE_WORKING_KQUEUE */ + +/* Define to 1 if you have the <zlib.h> header file. */ +#define _EVENT_HAVE_ZLIB_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define _EVENT_LT_OBJDIR ".libs/" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef _EVENT_NO_MINUS_C_MINUS_O */ + +/* Numeric representation of the version */ +#define _EVENT_NUMERIC_VERSION 0x02001600 + +/* Name of package */ +#define _EVENT_PACKAGE "libevent" + +/* Define to the address where bug reports for this package should be sent. */ +#define _EVENT_PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define _EVENT_PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define _EVENT_PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define _EVENT_PACKAGE_TARNAME "" + +/* Define to the home page for this package. */ +#define _EVENT_PACKAGE_URL "" + +/* Define to the version of this package. */ +#define _EVENT_PACKAGE_VERSION "" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef _EVENT_PTHREAD_CREATE_JOINABLE */ + +/* ------------------------------------------------------------------------ */ +/* MOZILLA NOTE: the following constants are hand-modified to be suitable */ +/* for both 32-bit and 64-bit platforms. See README.mozilla for details. */ +/* ------------------------------------------------------------------------ */ + +/* The size of `int', as computed by sizeof. */ +#define _EVENT_SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#ifdef __LP64__ +#define _EVENT_SIZEOF_LONG 8 +#else +#define _EVENT_SIZEOF_LONG 4 +#endif + +/* The size of `long long', as computed by sizeof. */ +#define _EVENT_SIZEOF_LONG_LONG 8 + +/* The size of `pthread_t', as computed by sizeof. */ +#define _EVENT_SIZEOF_PTHREAD_T 4 + +/* The size of `short', as computed by sizeof. */ +#define _EVENT_SIZEOF_SHORT 2 + +/* The size of `size_t', as computed by sizeof. */ +#ifdef __LP64__ +#define _EVENT_SIZEOF_SIZE_T 8 +#else +#define _EVENT_SIZEOF_SIZE_T 4 +#endif + +/* The size of `void *', as computed by sizeof. */ +#ifdef __LP64__ +#define _EVENT_SIZEOF_VOID_P 8 +#else +#define _EVENT_SIZEOF_VOID_P 4 +#endif + +/* ------------------------------------------------------------------------ */ +/* END MOZILLA NOTE */ +/* ------------------------------------------------------------------------ */ + +/* Define to 1 if you have the ANSI C header files. */ +#define _EVENT_STDC_HEADERS 1 + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#define _EVENT_TIME_WITH_SYS_TIME 1 + +/* Version number of package */ +#define _EVENT_VERSION "2.0.22-stable" + +/* Define to appropriate substitue if compiler doesnt have __func__ */ +/* #undef _EVENT___func__ */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef _EVENT_const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef _EVENT___cplusplus +/* #undef _EVENT_inline */ +#endif + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef _EVENT_pid_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef _EVENT_size_t */ + +/* Define to unsigned int if you dont have it */ +/* #undef _EVENT_socklen_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef _EVENT_ssize_t */ + +#endif /* event2/event-config.h */ diff --git a/ipc/chromium/src/third_party/libeventcommon.mozbuild b/ipc/chromium/src/third_party/libeventcommon.mozbuild index 7b0627e17..2b45ecb19 100644 --- a/ipc/chromium/src/third_party/libeventcommon.mozbuild +++ b/ipc/chromium/src/third_party/libeventcommon.mozbuild @@ -9,6 +9,7 @@ os_posix = 0 os_macosx = 0 os_bsd = 0 os_linux = 0 +os_solaris = 0 if CONFIG['OS_ARCH'] == 'WINNT': os_win = 1 @@ -21,6 +22,9 @@ else: 'NetBSD', 'OpenBSD']: os_bsd = 1 libevent_include_suffix = 'bsd' + elif CONFIG['OS_ARCH'] in ['SunOS']: + os_solaris = 1 + libevent_include_suffix = 'solaris' else: os_linux = 1 if CONFIG['OS_TARGET'] == 'Android': diff --git a/ipc/chromium/src/third_party/moz.build b/ipc/chromium/src/third_party/moz.build index 989e2aafc..2b99e53b3 100644 --- a/ipc/chromium/src/third_party/moz.build +++ b/ipc/chromium/src/third_party/moz.build @@ -54,6 +54,11 @@ if os_linux: 'libevent/epoll_sub.c', ] +if os_solaris: + SOURCES += [ + 'libevent/devpoll.c', + ] + # We allow warnings for third-party code that can be updated from upstream. ALLOW_COMPILER_WARNINGS = True diff --git a/ipc/glue/BrowserProcessSubThread.cpp b/ipc/glue/BrowserProcessSubThread.cpp index 7618dc934..589f20003 100644 --- a/ipc/glue/BrowserProcessSubThread.cpp +++ b/ipc/glue/BrowserProcessSubThread.cpp @@ -23,7 +23,7 @@ static const char* kBrowserThreadNames[BrowserProcessSubThread::ID_COUNT] = { // "Chrome_FileThread", // FILE // "Chrome_DBThread", // DB // "Chrome_HistoryThread", // HISTORY -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) "Gecko_Background_X11Thread", // BACKGROUND_X11 #endif }; @@ -34,7 +34,7 @@ BrowserProcessSubThread* BrowserProcessSubThread::sBrowserThreads[ID_COUNT] = { // nullptr, // FILE // nullptr, // DB // nullptr, // HISTORY -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) nullptr, // BACKGROUND_X11 #endif }; diff --git a/ipc/glue/BrowserProcessSubThread.h b/ipc/glue/BrowserProcessSubThread.h index e1b4aef46..cc9051412 100644 --- a/ipc/glue/BrowserProcessSubThread.h +++ b/ipc/glue/BrowserProcessSubThread.h @@ -25,7 +25,7 @@ public: //FILE, //DB, //HISTORY, -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_SOLARIS) // This thread has a second connection to the X server and is used // to process UI requests when routing the request to the UI // thread would risk deadlock. diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index fee429238..ea76f85f0 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -599,7 +599,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt // and passing wstrings from one config to the other is unsafe. So // we split the logic here. -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS) base::environment_map newEnvVars; ChildPrivileges privs = mPrivileges; if (privs == base::PRIVILEGES_DEFAULT) { @@ -744,7 +744,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt childArgv.push_back(childProcessType); base::LaunchApp(childArgv, mFileMap, -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS) newEnvVars, privs, #endif false, &process, arch); diff --git a/ipc/glue/MessageLink.cpp b/ipc/glue/MessageLink.cpp index a66fbbb32..14d885544 100644 --- a/ipc/glue/MessageLink.cpp +++ b/ipc/glue/MessageLink.cpp @@ -16,6 +16,9 @@ #include "nsDebug.h" #include "nsISupportsImpl.h" #include "nsXULAppAPI.h" +#if defined(__sun__) || defined(__sun) +#include <unistd.h> +#endif using namespace mozilla; using namespace std; @@ -267,9 +270,19 @@ ProcessLink::OnChannelOpened() MonitorAutoLock lock(*mChan->mMonitor); mExistingListener = mTransport->set_listener(this); + +// The queue we want here is defined in the namespace 'std' on Solaris, which +// also has another function called queue in a different namespace. Need to +// determine whether queue is defined in 'std' on other supported platforms +// before possibly removing ifdefs. + #ifdef DEBUG if (mExistingListener) { +#ifdef XP_SOLARIS + std::queue<Message> pending; +#else queue<Message> pending; +#endif mExistingListener->GetQueuedMessages(pending); MOZ_ASSERT(pending.empty()); } @@ -285,8 +298,11 @@ void ProcessLink::OnTakeConnectedChannel() { AssertIOThread(); - +#ifdef XP_SOLARIS + std::queue<Message> pending; +#else queue<Message> pending; +#endif { MonitorAutoLock lock(*mChan->mMonitor); diff --git a/js/public/Class.h b/js/public/Class.h index 3b5023875..f7533654b 100644 --- a/js/public/Class.h +++ b/js/public/Class.h @@ -425,12 +425,6 @@ typedef bool (* DeletePropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::ObjectOpResult& result); -typedef bool -(* WatchOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject callable); - -typedef bool -(* UnwatchOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id); - class JS_FRIEND_API(ElementAdder) { public: @@ -670,8 +664,6 @@ struct ObjectOps SetPropertyOp setProperty; GetOwnPropertyOp getOwnPropertyDescriptor; DeletePropertyOp deleteProperty; - WatchOp watch; - UnwatchOp unwatch; GetElementsOp getElements; JSNewEnumerateOp enumerate; JSFunToStringOp funToString; @@ -822,8 +814,8 @@ struct Class * Objects of this class aren't native objects. They don't have Shapes that * describe their properties and layout. Classes using this flag must * provide their own property behavior, either by being proxy classes (do - * this) or by overriding all the ObjectOps except getElements, watch and - * unwatch (don't do this). + * this) or by overriding all the ObjectOps except getElements + * (don't do this). */ static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2; @@ -900,8 +892,6 @@ struct Class const { return oOps ? oOps->getOwnPropertyDescriptor : nullptr; } DeletePropertyOp getOpsDeleteProperty() const { return oOps ? oOps->deleteProperty : nullptr; } - WatchOp getOpsWatch() const { return oOps ? oOps->watch : nullptr; } - UnwatchOp getOpsUnwatch() const { return oOps ? oOps->unwatch : nullptr; } GetElementsOp getOpsGetElements() const { return oOps ? oOps->getElements : nullptr; } JSNewEnumerateOp getOpsEnumerate() const { return oOps ? oOps->enumerate : nullptr; } JSFunToStringOp getOpsFunToString() const { return oOps ? oOps->funToString : nullptr; } diff --git a/js/public/Proxy.h b/js/public/Proxy.h index 5acb91b26..f40772fb0 100644 --- a/js/public/Proxy.h +++ b/js/public/Proxy.h @@ -341,12 +341,6 @@ class JS_FRIEND_API(BaseProxyHandler) virtual bool isCallable(JSObject* obj) const; virtual bool isConstructor(JSObject* obj) const; - // These two hooks must be overridden, or not overridden, in tandem -- no - // overriding just one! - virtual bool watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, - JS::HandleObject callable) const; - virtual bool unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id) const; - virtual bool getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end, ElementAdder* adder) const; diff --git a/js/src/Makefile.in b/js/src/Makefile.in index 20678c68c..bc99e62b5 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -138,6 +138,17 @@ distclean:: CFLAGS += $(MOZ_ZLIB_CFLAGS) +ifeq ($(OS_ARCH),SunOS) +ifeq ($(TARGET_CPU),sparc) + +ifdef GNU_CC +CFLAGS += -mcpu=v9 +CXXFLAGS += -mcpu=v9 +endif #GNU_CC + +endif +endif + $(LIBRARY_NAME).pc: js.pc cp $^ $@ diff --git a/js/src/builtin/IntlTimeZoneData.h b/js/src/builtin/IntlTimeZoneData.h index 8f963ffbc..1612f0f6b 100644 --- a/js/src/builtin/IntlTimeZoneData.h +++ b/js/src/builtin/IntlTimeZoneData.h @@ -1,5 +1,5 @@ // Generated by make_intl_data.py. DO NOT EDIT. -// tzdata version = 2019a +// tzdata version = 2019c #ifndef builtin_IntlTimeZoneData_h #define builtin_IntlTimeZoneData_h diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 56c77f304..bfcc8d20e 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -568,97 +568,6 @@ obj_setPrototypeOf(JSContext* cx, unsigned argc, Value* vp) return true; } -#if JS_HAS_OBJ_WATCHPOINT - -bool -js::WatchHandler(JSContext* cx, JSObject* obj_, jsid id_, const JS::Value& old, - JS::Value* nvp, void* closure) -{ - RootedObject obj(cx, obj_); - RootedId id(cx, id_); - - /* Avoid recursion on (obj, id) already being watched on cx. */ - AutoResolving resolving(cx, obj, id, AutoResolving::WATCH); - if (resolving.alreadyStarted()) - return true; - - FixedInvokeArgs<3> args(cx); - - args[0].set(IdToValue(id)); - args[1].set(old); - args[2].set(*nvp); - - RootedValue callable(cx, ObjectValue(*static_cast<JSObject*>(closure))); - RootedValue thisv(cx, ObjectValue(*obj)); - RootedValue rv(cx); - if (!Call(cx, callable, thisv, args, &rv)) - return false; - - *nvp = rv; - return true; -} - -static bool -obj_watch(JSContext* cx, unsigned argc, Value* vp) -{ - CallArgs args = CallArgsFromVp(argc, vp); - - RootedObject obj(cx, ToObject(cx, args.thisv())); - if (!obj) - return false; - - if (!GlobalObject::warnOnceAboutWatch(cx, obj)) - return false; - - if (args.length() <= 1) { - ReportMissingArg(cx, args.calleev(), 1); - return false; - } - - RootedObject callable(cx, ValueToCallable(cx, args[1], args.length() - 2)); - if (!callable) - return false; - - RootedId propid(cx); - if (!ValueToId<CanGC>(cx, args[0], &propid)) - return false; - - if (!WatchProperty(cx, obj, propid, callable)) - return false; - - args.rval().setUndefined(); - return true; -} - -static bool -obj_unwatch(JSContext* cx, unsigned argc, Value* vp) -{ - CallArgs args = CallArgsFromVp(argc, vp); - - RootedObject obj(cx, ToObject(cx, args.thisv())); - if (!obj) - return false; - - if (!GlobalObject::warnOnceAboutWatch(cx, obj)) - return false; - - RootedId id(cx); - if (args.length() != 0) { - if (!ValueToId<CanGC>(cx, args[0], &id)) - return false; - } else { - id = JSID_VOID; - } - - if (!UnwatchProperty(cx, obj, id)) - return false; - - args.rval().setUndefined(); - return true; -} - -#endif /* JS_HAS_OBJ_WATCHPOINT */ - /* ECMA 15.2.4.5. */ bool js::obj_hasOwnProperty(JSContext* cx, unsigned argc, Value* vp) @@ -1290,10 +1199,6 @@ static const JSFunctionSpec object_methods[] = { JS_FN(js_toString_str, obj_toString, 0,0), JS_SELF_HOSTED_FN(js_toLocaleString_str, "Object_toLocaleString", 0, 0), JS_SELF_HOSTED_FN(js_valueOf_str, "Object_valueOf", 0,0), -#if JS_HAS_OBJ_WATCHPOINT - JS_FN(js_watch_str, obj_watch, 2,0), - JS_FN(js_unwatch_str, obj_unwatch, 1,0), -#endif JS_FN(js_hasOwnProperty_str, obj_hasOwnProperty, 1,0), JS_FN(js_isPrototypeOf_str, obj_isPrototypeOf, 1,0), JS_FN(js_propertyIsEnumerable_str, obj_propertyIsEnumerable, 1,0), diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 992fe2c97..4363c7aed 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -239,8 +239,11 @@ GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp) value = BooleanValue(true); if (!JS_SetProperty(cx, info, "intl-api", value)) return false; - +#ifdef XP_SOLARIS + value = BooleanValue(false); +#else value = BooleanValue(true); +#endif if (!JS_SetProperty(cx, info, "mapped-array-buffer", value)) return false; diff --git a/js/src/builtin/TypedObject.cpp b/js/src/builtin/TypedObject.cpp index ff3680774..50bf0b836 100644 --- a/js/src/builtin/TypedObject.cpp +++ b/js/src/builtin/TypedObject.cpp @@ -2215,7 +2215,6 @@ const ObjectOps TypedObject::objectOps_ = { TypedObject::obj_setProperty, TypedObject::obj_getOwnPropertyDescriptor, TypedObject::obj_deleteProperty, - nullptr, nullptr, /* watch/unwatch */ nullptr, /* getElements */ TypedObject::obj_enumerate, nullptr, /* thisValue */ diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index d6adfac2c..aed1114bd 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -20,6 +20,10 @@ #include <float.h> #endif +#if defined(XP_SOLARIS) +#include <ieeefp.h> +#endif + #ifdef HAVE_SSIZE_T #include <sys/types.h> #endif diff --git a/js/src/ctypes/libffi/src/x86/win32.S b/js/src/ctypes/libffi/src/x86/win32.S index daf0e799c..4f702e8b1 100644 --- a/js/src/ctypes/libffi/src/x86/win32.S +++ b/js/src/ctypes/libffi/src/x86/win32.S @@ -1158,8 +1158,24 @@ L_ffi_closure_SYSV_inner$stub: .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */ .byte 0x8 /* CIE RA Column */ #ifdef __PIC__ - .byte 0x1 /* .uleb128 0x1; Augmentation size */ - .byte 0x1b /* FDE Encoding (pcrel sdata4) */ +# if defined __sun__ && defined __svr4__ +/* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22 + doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this. */ +# define FDE_ENCODING 0x30 /* datarel */ +# define FDE_ENCODE(X) X@GOTOFF +# else +# define FDE_ENCODING 0x1b /* pcrel sdata4 */ +# if defined HAVE_AS_X86_PCREL +# define FDE_ENCODE(X) X-. +# else +# define FDE_ENCODE(X) X@rel +# endif +# endif +#else +# define FDE_ENCODING 0 /* absolute */ +# define FDE_ENCODE(X) X +.byte 0x1 /* .uleb128 0x1; Augmentation size */ +.byte FDE_ENCODING #endif .byte 0xc /* DW_CFA_def_cfa CFA = r4 + 4 = 4(%esp) */ .byte 0x4 /* .uleb128 0x4 */ @@ -1176,7 +1192,7 @@ L_ffi_closure_SYSV_inner$stub: #if defined __PIC__ && defined HAVE_AS_X86_PCREL .long .LFB1-. /* FDE initial location */ #else - .long .LFB1 + .long FDE_ENCODE(.LFB1) #endif .long .LFE1-.LFB1 /* FDE address range */ #ifdef __PIC__ @@ -1207,7 +1223,7 @@ L_ffi_closure_SYSV_inner$stub: #if defined __PIC__ && defined HAVE_AS_X86_PCREL .long .LFB3-. /* FDE initial location */ #else - .long .LFB3 + .long FDE_ENCODE(.LFB3) #endif .long .LFE3-.LFB3 /* FDE address range */ #ifdef __PIC__ @@ -1240,7 +1256,7 @@ L_ffi_closure_SYSV_inner$stub: #if defined __PIC__ && defined HAVE_AS_X86_PCREL .long .LFB4-. /* FDE initial location */ #else - .long .LFB4 + .long FDE_ENCODE(.LFB4) #endif .long .LFE4-.LFB4 /* FDE address range */ #ifdef __PIC__ @@ -1278,7 +1294,7 @@ L_ffi_closure_SYSV_inner$stub: #if defined __PIC__ && defined HAVE_AS_X86_PCREL .long .LFB5-. /* FDE initial location */ #else - .long .LFB5 + .long FDE_ENCODE(.LFB5) #endif .long .LFE5-.LFB5 /* FDE address range */ #ifdef __PIC__ diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index da3ef7d0d..262fc8cbc 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -2846,10 +2846,9 @@ struct UnmarkGrayTracer : public JS::CallbackTracer * * There is an additional complication for certain kinds of edges that are not * contained explicitly in the source object itself, such as from a weakmap key - * to its value, and from an object being watched by a watchpoint to the - * watchpoint's closure. These "implicit edges" are represented in some other - * container object, such as the weakmap or the watchpoint itself. In these - * cases, calling unmark gray on an object won't find all of its children. + * to its value. These "implicit edges" are represented in some other + * container object, such as the weakmap itself. In these cases, calling unmark + * gray on an object won't find all of its children. * * Handling these implicit edges has two parts: * - A special pass enumerating all of the containers that know about the diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index 268e1e489..418984057 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -415,8 +415,15 @@ InitMemorySubsystem() static inline void* MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE, int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0) + +// Solaris manages 64-bit address space in a different manner from every other +// AMD64 operating system, but fortunately the fix is the same one +// required for every operating system on 64-bit SPARC, Itanium, and ARM. +// Most people's intuition failed them here and they thought this couldn't +// possibly be correct on AMD64, but for Solaris/illumos it is. + { -#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) +#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) MOZ_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0); #endif void* region = mmap(desired, length, prot, flags, fd, offset); @@ -466,7 +473,7 @@ MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE, return nullptr; } return region; -#elif defined(__aarch64__) +#elif defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) /* * There might be similar virtual address issue on arm64 which depends on * hardware and kernel configurations. But the work around is slightly @@ -678,7 +685,11 @@ MarkPagesUnused(void* p, size_t size) return false; MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0); - int result = madvise(p, size, MADV_DONTNEED); +#ifdef XP_SOLARIS + int result = posix_madvise(p, size, POSIX_MADV_DONTNEED); +#else + int result = madvise(p, size, MADV_DONTNEED); +#endif return result != -1; } diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index f5969bc1f..7d665e8eb 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -14,7 +14,6 @@ #include "jsgc.h" #include "jsprf.h" #include "jstypes.h" -#include "jswatchpoint.h" #include "builtin/MapObject.h" #include "frontend/BytecodeCompiler.h" diff --git a/js/src/jit-test/tests/auto-regress/bug466654.js b/js/src/jit-test/tests/auto-regress/bug466654.js deleted file mode 100644 index 6c82c425b..000000000 --- a/js/src/jit-test/tests/auto-regress/bug466654.js +++ /dev/null @@ -1,8 +0,0 @@ -// |jit-test| error:TypeError - -// Binary: cache/js-dbg-32-29add08d84ae-linux -// Flags: -j -// -this.watch('y', /x/g ); -for each (y in ['q', 'q', 'q']) continue; -gc(); diff --git a/js/src/jit-test/tests/auto-regress/bug516897.js b/js/src/jit-test/tests/auto-regress/bug516897.js deleted file mode 100644 index e3caf4e6e..000000000 --- a/js/src/jit-test/tests/auto-regress/bug516897.js +++ /dev/null @@ -1,6 +0,0 @@ -// Binary: cache/js-dbg-64-38754465ffde-linux -// Flags: -// -this.__defineSetter__("x", gc); -this.watch("x",function(){return}); -x = 3; diff --git a/js/src/jit-test/tests/auto-regress/bug537854.js b/js/src/jit-test/tests/auto-regress/bug537854.js deleted file mode 100644 index 80fb3c14a..000000000 --- a/js/src/jit-test/tests/auto-regress/bug537854.js +++ /dev/null @@ -1,4 +0,0 @@ -// Binary: cache/js-dbg-64-9d51f2a931f7-linux -// Flags: -// -({x:function(){}}).watch('x',function(){}); diff --git a/js/src/jit-test/tests/auto-regress/bug560796.js b/js/src/jit-test/tests/auto-regress/bug560796.js deleted file mode 100644 index 4ab93567e..000000000 --- a/js/src/jit-test/tests/auto-regress/bug560796.js +++ /dev/null @@ -1,9 +0,0 @@ -// Binary: cache/js-dbg-64-a6d7a5677b4c-linux -// Flags: -// -this.__defineSetter__("x", function(){}) -this.watch("x", "".localeCompare) -window = x -Object.defineProperty(this, "x", ({ - set: window -})) diff --git a/js/src/jit-test/tests/auto-regress/bug638735.js b/js/src/jit-test/tests/auto-regress/bug638735.js index 63071aa7c..c941f5369 100644 --- a/js/src/jit-test/tests/auto-regress/bug638735.js +++ b/js/src/jit-test/tests/auto-regress/bug638735.js @@ -4,7 +4,6 @@ var o9 = Function.prototype; var o13 = Array; function f5(o) { -o.watch('p3', function() {}); ox1 = new Proxy(o, {}); } f5(o9); diff --git a/js/src/jit-test/tests/auto-regress/bug639413.js b/js/src/jit-test/tests/auto-regress/bug639413.js deleted file mode 100644 index d8dd58eaf..000000000 --- a/js/src/jit-test/tests/auto-regress/bug639413.js +++ /dev/null @@ -1,9 +0,0 @@ -// |jit-test| error:TypeError - -// Binary: cache/js-dbg-32-1c8e91b2e3a4-linux -// Flags: -// -a = evalcx("lazy"); -a.watch("x", function() {}); -({}).watch("x", function() {}); -a.__defineGetter__("y", {}); diff --git a/js/src/jit-test/tests/auto-regress/bug698899.js b/js/src/jit-test/tests/auto-regress/bug698899.js deleted file mode 100644 index 644f45ec2..000000000 --- a/js/src/jit-test/tests/auto-regress/bug698899.js +++ /dev/null @@ -1,9 +0,0 @@ -// Binary: cache/js-dbg-32-f951e9151626-linux -// Flags: -m -n -// -o = evalcx("lazy").__proto__ -gc() -try { - o.watch() -} catch (e) {} -o.constructor() diff --git a/js/src/jit-test/tests/auto-regress/bug746397.js b/js/src/jit-test/tests/auto-regress/bug746397.js deleted file mode 100644 index d915ca7bb..000000000 --- a/js/src/jit-test/tests/auto-regress/bug746397.js +++ /dev/null @@ -1,10 +0,0 @@ -// |jit-test| error:ReferenceError - -// Binary: cache/js-dbg-64-67bf9a4a1f77-linux -// Flags: --ion-eager -// - -(function () { - var a = ['x', 'y']; - obj.watch(a[+("0")], counter); -})(); diff --git a/js/src/jit-test/tests/auto-regress/bug769192.js b/js/src/jit-test/tests/auto-regress/bug769192.js deleted file mode 100644 index 531e37912..000000000 --- a/js/src/jit-test/tests/auto-regress/bug769192.js +++ /dev/null @@ -1,6 +0,0 @@ -// |jit-test| error:TypeError - -// Binary: cache/js-dbg-64-bf8f2961d0cc-linux -// Flags: -// -Object.watch.call(new Uint8ClampedArray, "length", function() {}); diff --git a/js/src/jit-test/tests/baseline/bug843444.js b/js/src/jit-test/tests/baseline/bug843444.js deleted file mode 100644 index 3a77402ac..000000000 --- a/js/src/jit-test/tests/baseline/bug843444.js +++ /dev/null @@ -1,8 +0,0 @@ -gczeal(8, 1) -function recurse(x) { - recurse; - if (x < 20) - recurse(x + 1); -}; -this.watch(5, (function () {})) -recurse(0) diff --git a/js/src/jit-test/tests/basic/bug510437.js b/js/src/jit-test/tests/basic/bug510437.js deleted file mode 100644 index 2418b9b11..000000000 --- a/js/src/jit-test/tests/basic/bug510437.js +++ /dev/null @@ -1,13 +0,0 @@ -// Don't crash or assert. - -var d; -this.watch("d", eval); -(function () { - (eval("\ - (function () {\ - for (let x = 0; x < 2; ++x) {\ - d = x\ - }\ - })\ -"))() -})() diff --git a/js/src/jit-test/tests/basic/bug605015.js b/js/src/jit-test/tests/basic/bug605015.js deleted file mode 100644 index a35f7b6c7..000000000 --- a/js/src/jit-test/tests/basic/bug605015.js +++ /dev/null @@ -1,9 +0,0 @@ -// |jit-test| error: TypeError
-// don't assert
-
-print(this.watch("x",
-function() {
- Object.defineProperty(this, "x", ({
- get: (Int8Array)
- }))
-}))(x = /x/)
diff --git a/js/src/jit-test/tests/basic/bug631305.js b/js/src/jit-test/tests/basic/bug631305.js deleted file mode 100644 index b0cbbbb24..000000000 --- a/js/src/jit-test/tests/basic/bug631305.js +++ /dev/null @@ -1,9 +0,0 @@ -var n = 0; -var a = []; -for (var i = 0; i < 20; i++) - a[i] = {}; -a[18].watch("p", function () { n++; }); -delete a[18].p; -for (var i = 0; i < 20; i++) - a[i].p = 0; -assertEq(n, 1); diff --git a/js/src/jit-test/tests/basic/bug662562.js b/js/src/jit-test/tests/basic/bug662562.js deleted file mode 100644 index 45b48589a..000000000 --- a/js/src/jit-test/tests/basic/bug662562.js +++ /dev/null @@ -1,6 +0,0 @@ -// |jit-test| error: TypeError -function f(o) { - o.watch("x", this); -} -var c = evalcx(""); -f(c); diff --git a/js/src/jit-test/tests/basic/bug690292.js b/js/src/jit-test/tests/basic/bug690292.js deleted file mode 100644 index 43ab56dd7..000000000 --- a/js/src/jit-test/tests/basic/bug690292.js +++ /dev/null @@ -1,12 +0,0 @@ - -done = false; -try { - function x() {} - print(this.watch("d", Object.create)) - var d = {} -} catch (e) {} -try { - eval("d = ''") - done = true; -} catch (e) {} -assertEq(done, false); diff --git a/js/src/jit-test/tests/basic/bug696748.js b/js/src/jit-test/tests/basic/bug696748.js index fe171f976..33fb4d52f 100644 --- a/js/src/jit-test/tests/basic/bug696748.js +++ b/js/src/jit-test/tests/basic/bug696748.js @@ -1,6 +1,3 @@ -try { -this.watch("b", "".substring); -} catch(exc1) {} eval("\ var URI = '';\ test();\ diff --git a/js/src/jit-test/tests/basic/bug831846.js b/js/src/jit-test/tests/basic/bug831846.js deleted file mode 100644 index 30bb3aa86..000000000 --- a/js/src/jit-test/tests/basic/bug831846.js +++ /dev/null @@ -1,3 +0,0 @@ -// |jit-test| error:TypeError - -evalcx('').watch("", /()/); diff --git a/js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js b/js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js deleted file mode 100644 index c22eabed0..000000000 --- a/js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js +++ /dev/null @@ -1,7 +0,0 @@ -var o = {}; -o.watch("p", function() { }); - -for (var i = 0; i < 10; i++) { - o.p = 123; - delete o.p; -} diff --git a/js/src/jit-test/tests/basic/testBug566556.js b/js/src/jit-test/tests/basic/testBug566556.js deleted file mode 100644 index 244be57d2..000000000 --- a/js/src/jit-test/tests/basic/testBug566556.js +++ /dev/null @@ -1,9 +0,0 @@ -var msg = ""; -try { - this.__defineSetter__('x', Object.create); - this.watch('x', function() {}); - x = 3; -} catch (e) { - msg = e.toString(); -} -assertEq(msg, "TypeError: undefined is not an object or null"); diff --git a/js/src/jit-test/tests/basic/testBug578044.js b/js/src/jit-test/tests/basic/testBug578044.js deleted file mode 100644 index c5b811dc9..000000000 --- a/js/src/jit-test/tests/basic/testBug578044.js +++ /dev/null @@ -1,13 +0,0 @@ -this.watch("x", Object.create) -try { - (function() { - this.__defineGetter__("x", - function() { - return this - }) - })() -} catch(e) {} -Object.defineProperty(x, "x", ({ - set: Uint16Array -})) - diff --git a/js/src/jit-test/tests/basic/testBug584650.js b/js/src/jit-test/tests/basic/testBug584650.js deleted file mode 100644 index b6c9d8ab7..000000000 --- a/js/src/jit-test/tests/basic/testBug584650.js +++ /dev/null @@ -1,9 +0,0 @@ -if (typeof gczeal != "function") - gczeal = function() {} - -// don't crash -x = (evalcx('lazy')) -x.watch("", function () {}) -gczeal(1) -for (w in x) {} - diff --git a/js/src/jit-test/tests/basic/testBug780288-1.js b/js/src/jit-test/tests/basic/testBug780288-1.js deleted file mode 100644 index 90746a04a..000000000 --- a/js/src/jit-test/tests/basic/testBug780288-1.js +++ /dev/null @@ -1,20 +0,0 @@ -s = newGlobal() -try { - evalcx("\ - Object.defineProperty(this,\"i\",{enumerable:true,get:function(){t}});\ - for each(y in this)true\ - ", s) -} catch (e) {} -try { - evalcx("\ - for(z=0,(7).watch(\"\",eval);;g){\ - if(z=1){({t:function(){}})\ - }\ - ", s) -} catch (e) {} -try { - evalcx("\ - Object.defineProperty(this,\"g2\",{get:function(){return this}});\ - g2.y()\ - ", s) -} catch (e) {} diff --git a/js/src/jit-test/tests/basic/testBug780288-2.js b/js/src/jit-test/tests/basic/testBug780288-2.js deleted file mode 100644 index 8c4c1737c..000000000 --- a/js/src/jit-test/tests/basic/testBug780288-2.js +++ /dev/null @@ -1,20 +0,0 @@ -s = newGlobal() -try { - evalcx("\ - Object.defineProperty(this,\"i\",{enumerable:true,get:function(){t}});\ - for each(y in this)true\ - ", s) -} catch (e) {} -try { - evalcx("\ - for(z=0,(7).watch(\"\",eval);;g){\ - if(z=1){({t:function(){}})\ - }\ - ", s) -} catch (e) {} -try { - evalcx("\ - Object.defineProperty(this,\"g2\",{get:function(){return this}});\ - g2.y(\"\")\ - ", s) -} catch (e) {} diff --git a/js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js b/js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js deleted file mode 100644 index bcd60fd80..000000000 --- a/js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js +++ /dev/null @@ -1,3 +0,0 @@ -this.__defineSetter__("x", function(){}); -this.watch("x", eval); -x = 0; diff --git a/js/src/jit-test/tests/basic/testNonStubGetter.js b/js/src/jit-test/tests/basic/testNonStubGetter.js deleted file mode 100644 index 58a698eb4..000000000 --- a/js/src/jit-test/tests/basic/testNonStubGetter.js +++ /dev/null @@ -1,7 +0,0 @@ -function testNonStubGetter() { - { let [] = []; (this.watch("x", function(p, o, n) { return /a/g.exec(p, o, n); })); }; - (function () { (eval("(function(){for each (x in [1, 2, 2]);});"))(); })(); - this.unwatch("x"); - return "ok"; -} -assertEq(testNonStubGetter(), "ok"); diff --git a/js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js b/js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js deleted file mode 100644 index 78c281f05..000000000 --- a/js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js +++ /dev/null @@ -1,7 +0,0 @@ -for (var i = 0; i < 5; ++i) { - var o = {} - Object.defineProperty(o, 'x', { value:"cow", writable:false }); - var r = o.watch('x', function() {}); - assertEq(r, undefined); - o.x = 4; -} diff --git a/js/src/jit-test/tests/basic/testTrueShiftTrue.js b/js/src/jit-test/tests/basic/testTrueShiftTrue.js deleted file mode 100644 index 44c1290d8..000000000 --- a/js/src/jit-test/tests/basic/testTrueShiftTrue.js +++ /dev/null @@ -1,16 +0,0 @@ -// Test no assert or crash from outer recorders (bug 465145) -function testBug465145() { - this.__defineSetter__("x", function(){}); - this.watch("x", function(){}); - y = this; - for (var z = 0; z < 2; ++z) { x = y }; - this.__defineSetter__("x", function(){}); - for (var z = 0; z < 2; ++z) { x = y }; -} - -function testTrueShiftTrue() { - var a = new Array(5); - for (var i=0;i<5;++i) a[i] = "" + (true << true); - return a.join(","); -} -assertEq(testTrueShiftTrue(), "2,2,2,2,2"); diff --git a/js/src/jit-test/tests/basic/testWatchRecursion.js b/js/src/jit-test/tests/basic/testWatchRecursion.js deleted file mode 100644 index e5d5877df..000000000 --- a/js/src/jit-test/tests/basic/testWatchRecursion.js +++ /dev/null @@ -1,63 +0,0 @@ -// Test that the watch handler is not called recursively for the same object -// and property. -(function() { - var obj1 = {}, obj2 = {}; - var handler_entry_count = 0; - var handler_exit_count = 0; - - obj1.watch('x', handler); - obj1.watch('y', handler); - obj2.watch('x', handler); - obj1.x = 1; - assertEq(handler_entry_count, 3); - assertEq(handler_exit_count, 3); - - function handler(id) { - handler_entry_count++; - assertEq(handler_exit_count, 0); - switch (true) { - case this === obj1 && id === "x": - assertEq(handler_entry_count, 1); - obj2.x = 3; - assertEq(handler_exit_count, 2); - break; - case this === obj2 && id === "x": - assertEq(handler_entry_count, 2); - obj1.y = 4; - assertEq(handler_exit_count, 1); - break; - default: - assertEq(this, obj1); - assertEq(id, "y"); - assertEq(handler_entry_count, 3); - - // We expect no more watch handler invocations - obj1.x = 5; - obj1.y = 6; - obj2.x = 7; - assertEq(handler_exit_count, 0); - break; - } - ++handler_exit_count; - assertEq(handler_entry_count, 3); - } -})(); - - -// Test that run-away recursion in watch handlers is properly handled. -(function() { - var obj = {}; - var i = 0; - try { - handler(); - throw new Error("Unreachable"); - } catch(e) { - assertEq(e instanceof InternalError, true); - } - - function handler() { - var prop = "a" + ++i; - obj.watch(prop, handler); - obj[prop] = 2; - } -})(); diff --git a/js/src/jit-test/tests/ctypes/function-definition.js b/js/src/jit-test/tests/ctypes/function-definition.js index 4df317a09..5882ba889 100644 --- a/js/src/jit-test/tests/ctypes/function-definition.js +++ b/js/src/jit-test/tests/ctypes/function-definition.js @@ -27,7 +27,7 @@ function test() { let lib; try { - lib = ctypes.open(ctypes.libraryName("c")); + lib = ctypes.open(ctypes.libraryName("m")); } catch (e) { } if (!lib) diff --git a/js/src/jit-test/tests/gc/bug-900405.js b/js/src/jit-test/tests/gc/bug-900405.js deleted file mode 100644 index eeec6f25f..000000000 --- a/js/src/jit-test/tests/gc/bug-900405.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() { - [{ "9": [] }.watch([], function(){})] -})() diff --git a/js/src/jit-test/tests/gc/bug-913261.js b/js/src/jit-test/tests/gc/bug-913261.js deleted file mode 100644 index 43066053f..000000000 --- a/js/src/jit-test/tests/gc/bug-913261.js +++ /dev/null @@ -1,5 +0,0 @@ -// |jit-test| error: InternalError: too much recursion -(function f() { - "".watch(2, function() {}); - f(); -})() diff --git a/js/src/jit-test/tests/gc/bug-986864.js b/js/src/jit-test/tests/gc/bug-986864.js deleted file mode 100644 index abb8de6b2..000000000 --- a/js/src/jit-test/tests/gc/bug-986864.js +++ /dev/null @@ -1,8 +0,0 @@ -// |jit-test| slow -function x() {} -for (var j = 0; j < 9999; ++j) { - (function() { - x += x.watch("endsWith", ArrayBuffer); - return 0 >> Function(x) - })() -} diff --git a/js/src/jit-test/tests/ion/bug1063182.js b/js/src/jit-test/tests/ion/bug1063182.js deleted file mode 100644 index 9cda48099..000000000 --- a/js/src/jit-test/tests/ion/bug1063182.js +++ /dev/null @@ -1,8 +0,0 @@ -// |jit-test| error: ReferenceError - -eval("(function() { " + "\ -var o = {};\ -o.watch('p', function() { });\ -for (var i = 0; i < 10; \u5ede ++)\ - o.p = 123;\ -" + " })();"); diff --git a/js/src/jit-test/tests/ion/bug772901.js b/js/src/jit-test/tests/ion/bug772901.js index eb71f6afb..164afd151 100644 --- a/js/src/jit-test/tests/ion/bug772901.js +++ b/js/src/jit-test/tests/ion/bug772901.js @@ -4,4 +4,4 @@ function f(x) { delete ((x)++); arguments[0] !== undefined; } -f(1, x = [f.ArrayBuffer,unwatch.Int32Array], this, this, this) ; +f(1, x = [f.ArrayBuffer, undefined], this, this, this) ; diff --git a/js/src/jit-test/tests/ion/bug774257-1.js b/js/src/jit-test/tests/ion/bug774257-1.js deleted file mode 100644 index 9c998a028..000000000 --- a/js/src/jit-test/tests/ion/bug774257-1.js +++ /dev/null @@ -1,8 +0,0 @@ -Object.defineProperty(Object.prototype, 'x', { - set: function() { evalcx('lazy'); } -}); -var obj = {}; -obj.watch("x", function (id, oldval, newval) {}); -for (var str in 'A') { - obj.x = 1; -} diff --git a/js/src/jit-test/tests/ion/bug774257-2.js b/js/src/jit-test/tests/ion/bug774257-2.js deleted file mode 100644 index b31043b08..000000000 --- a/js/src/jit-test/tests/ion/bug774257-2.js +++ /dev/null @@ -1,10 +0,0 @@ -Object.defineProperty(Object.prototype, 'x', { - set: function() { evalcx('lazy'); } -}); -var obj = {}; -var prot = {}; -obj.__proto__ = prot; -obj.watch("x", function (id, oldval, newval) {}); -for (var str in 'A') { - obj.x = 1; -} diff --git a/js/src/jit-test/tests/ion/bug779631.js b/js/src/jit-test/tests/ion/bug779631.js deleted file mode 100644 index 087aa01ac..000000000 --- a/js/src/jit-test/tests/ion/bug779631.js +++ /dev/null @@ -1,9 +0,0 @@ -var flag = 0; -var a = {}; -Object.defineProperty(a, "value", {set: function(x) {}}); -a.watch("value", function(){flag++;}); - -for(var i = 0; i < 100; i++) { - a.value = i; - assertEq(flag, i+1); -} diff --git a/js/src/jit-test/tests/ion/bug783590.js b/js/src/jit-test/tests/ion/bug783590.js index d48cb609e..9d277e02c 100644 --- a/js/src/jit-test/tests/ion/bug783590.js +++ b/js/src/jit-test/tests/ion/bug783590.js @@ -7,7 +7,6 @@ Object.defineProperty(arr, 0, { glob.__proto__; }) }); -this.watch("s", function() {}); try { arr.pop(); } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/bug550665.js b/js/src/jit-test/tests/jaeger/bug550665.js deleted file mode 100644 index 816888b5e..000000000 --- a/js/src/jit-test/tests/jaeger/bug550665.js +++ /dev/null @@ -1,8 +0,0 @@ -(function () { - var a; - eval("for(w in ((function(x,y){b:0})())) ;"); -})(); - -this.__defineSetter__("l", function() { gc() }); -this.watch("l", function(x) { yield {} }); -l = true; diff --git a/js/src/jit-test/tests/jaeger/bug557063.js b/js/src/jit-test/tests/jaeger/bug557063.js deleted file mode 100644 index ea77fd2c8..000000000 --- a/js/src/jit-test/tests/jaeger/bug557063.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() { - for (a = 0; a < 2; a++) - ''.watch("", function() {}) -})() - -/* Don't crash or assert. */ - diff --git a/js/src/jit-test/tests/jaeger/bug588338.js b/js/src/jit-test/tests/jaeger/bug588338.js index 457be238a..c400d7687 100644 --- a/js/src/jit-test/tests/jaeger/bug588338.js +++ b/js/src/jit-test/tests/jaeger/bug588338.js @@ -9,7 +9,6 @@ function f() { } } })(/x/))) -for (z = 0; z < 100; x.unwatch(), z++) for (e in [0]) { gczeal(2) } ( [1,2,3])("") diff --git a/js/src/jit-test/tests/jaeger/bug625438.js b/js/src/jit-test/tests/jaeger/bug625438.js deleted file mode 100644 index 32586d8ab..000000000 --- a/js/src/jit-test/tests/jaeger/bug625438.js +++ /dev/null @@ -1,10 +0,0 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: - -var count = 0; -this.watch("x", function() { - count++; -}); -for(var i=0; i<10; i++) { - x = 2; -} -assertEq(count, 10); diff --git a/js/src/jit-test/tests/jaeger/bug630366.js b/js/src/jit-test/tests/jaeger/bug630366.js deleted file mode 100644 index acac8d3ef..000000000 --- a/js/src/jit-test/tests/jaeger/bug630366.js +++ /dev/null @@ -1,7 +0,0 @@ -var o = {}; -for(var i=0; i<5; i++) { - o.p = 2; - o.watch("p", function() { }); - o.p = 2; - delete o.p; -} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641225.js b/js/src/jit-test/tests/jaeger/recompile/bug641225.js index a6e3a86c7..7b7978197 100644 --- a/js/src/jit-test/tests/jaeger/recompile/bug641225.js +++ b/js/src/jit-test/tests/jaeger/recompile/bug641225.js @@ -118,7 +118,6 @@ for(var o2 in f5) { f2(o5); f2(o5); f0(o3); - o9.watch('p3', function() {}); o8[o8] = o8; f0(o5); f1(o6); diff --git a/js/src/jit-test/tests/pic/fuzz1.js b/js/src/jit-test/tests/pic/fuzz1.js deleted file mode 100644 index 2481a1314..000000000 --- a/js/src/jit-test/tests/pic/fuzz1.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {
- for (a = 0; a < 2; a++)
- ''.watch("", function() {})
-})()
diff --git a/js/src/jit-test/tests/pic/fuzz3.js b/js/src/jit-test/tests/pic/fuzz3.js deleted file mode 100644 index 17613b6f5..000000000 --- a/js/src/jit-test/tests/pic/fuzz3.js +++ /dev/null @@ -1,3 +0,0 @@ -for each(let w in [[], 0, [], 0]) {
- w.unwatch()
-}
diff --git a/js/src/jit-test/tests/pic/watch1.js b/js/src/jit-test/tests/pic/watch1.js deleted file mode 100644 index 09d6347bf..000000000 --- a/js/src/jit-test/tests/pic/watch1.js +++ /dev/null @@ -1,7 +0,0 @@ -// assignments to watched objects must not be cached -var obj = {x: 0}; -var hits = 0; -obj.watch("x", function (id, oldval, newval) { hits++; return newval; }); -for (var i = 0; i < 10; i++) - obj.x = i; -assertEq(hits, 10); diff --git a/js/src/jit-test/tests/pic/watch1a.js b/js/src/jit-test/tests/pic/watch1a.js deleted file mode 100644 index 4b404f507..000000000 --- a/js/src/jit-test/tests/pic/watch1a.js +++ /dev/null @@ -1,17 +0,0 @@ -// assignments to watched objects must not be traced -var hits = 0; -function counter(id, oldval, newval) { - hits++; - return newval; -} - -(function () { - var obj = {x: 0, y: 0}; - var a = ['x', 'y']; - obj.watch('z', counter); - for (var i = 0; i < 14; i++) { - obj.watch(a[+(i > 8)], counter); - obj.y = i; - } -})(); -assertEq(hits, 5); diff --git a/js/src/jit-test/tests/pic/watch2.js b/js/src/jit-test/tests/pic/watch2.js deleted file mode 100644 index fb3e29617..000000000 --- a/js/src/jit-test/tests/pic/watch2.js +++ /dev/null @@ -1,8 +0,0 @@ -// assignments to watched properties via ++ must not be cached -var obj = {x: 0}; -var hits = 0; -obj.watch("x", function (id, oldval, newval) { hits++; return newval; }); -for (var i = 0; i < 10; i++) - obj.x++; -assertEq(hits, 10); - diff --git a/js/src/jit-test/tests/pic/watch2a.js b/js/src/jit-test/tests/pic/watch2a.js deleted file mode 100644 index ce3294ba3..000000000 --- a/js/src/jit-test/tests/pic/watch2a.js +++ /dev/null @@ -1,18 +0,0 @@ -// assignments to watched properties via ++ must not be traced -var hits = 0; -function counter(id, oldval, newval) { - hits++; - return newval; -} - -(function () { - var obj = {x: 0, y: 0}; - var a = ['x', 'y']; - obj.watch('z', counter); - for (var i = 0; i < 14; i++) { - obj.watch(a[+(i > 8)], counter); - obj.y++; - } -})(); -assertEq(hits, 5); - diff --git a/js/src/jit-test/tests/pic/watch3.js b/js/src/jit-test/tests/pic/watch3.js deleted file mode 100644 index 4c5c93d8b..000000000 --- a/js/src/jit-test/tests/pic/watch3.js +++ /dev/null @@ -1,7 +0,0 @@ -// assignment to watched global properties must not be cached -x = 0; -var hits = 0; -this.watch("x", function (id, oldval, newval) { hits++; return newval; }); -for (var i = 0; i < 10; i++) - x = i; -assertEq(hits, 10); diff --git a/js/src/jit-test/tests/pic/watch3a.js b/js/src/jit-test/tests/pic/watch3a.js deleted file mode 100644 index 700daf6af..000000000 --- a/js/src/jit-test/tests/pic/watch3a.js +++ /dev/null @@ -1,19 +0,0 @@ -// assignment to watched global properties must not be traced -var hits = 0; -function counter(id, oldval, newval) { - hits++; - return newval; -} - -var x = 0; -var y = 0; -(function () { - var a = ['x', 'y']; - this.watch('z', counter); - for (var i = 0; i < 14; i++) { - this.watch(a[+(i > 8)], counter); - y = 1; - } -})(); -assertEq(hits, 5); - diff --git a/js/src/jit-test/tests/pic/watch3b.js b/js/src/jit-test/tests/pic/watch3b.js deleted file mode 100644 index 9b0dc8cc9..000000000 --- a/js/src/jit-test/tests/pic/watch3b.js +++ /dev/null @@ -1,20 +0,0 @@ -// assignment to watched global properties must not be traced -var hits = 0; -function counter(id, oldval, newval) { - hits++; - return newval; -} - -var x = 0; -var y = 0; -function f() { - var a = [{}, this]; - for (var i = 0; i < 14; i++) { - print(shapeOf(this)); - Object.prototype.watch.call(a[+(i > 8)], "y", counter); - y++; - } -} -f(); -assertEq(hits, 5); - diff --git a/js/src/jit-test/tests/pic/watch4.js b/js/src/jit-test/tests/pic/watch4.js deleted file mode 100644 index 4b640c4df..000000000 --- a/js/src/jit-test/tests/pic/watch4.js +++ /dev/null @@ -1,9 +0,0 @@ -// adding assignment + watchpoint vs. caching -var hits = 0; -var obj = {}; -obj.watch("x", function (id, oldval, newval) { hits++; return newval; }); -for (var i = 0; i < 10; i++) { - obj.x = 1; - delete obj.x; -} -assertEq(hits, 10); diff --git a/js/src/jit-test/tests/pic/watch5.js b/js/src/jit-test/tests/pic/watch5.js deleted file mode 100644 index 6b22951a4..000000000 --- a/js/src/jit-test/tests/pic/watch5.js +++ /dev/null @@ -1,27 +0,0 @@ -// test against future pic support for symbols - -// assignments to watched objects must not be cached -var obj = {}; -var x = Symbol.for("x"); -obj[x] = 0; -var hits = 0; -obj.watch(x, function (id, oldval, newval) { hits++; return newval; }); -for (var i = 0; i < 10; i++) - obj[x] = i; -assertEq(hits, 10); - -// assignments to watched properties via ++ must not be cached -hits = 0; -for (var i = 0; i < 10; i++) - obj[x]++; -assertEq(hits, 10); - -// adding assignment + watchpoint vs. caching -hits = 0; -obj = {}; -obj.watch(x, function (id, oldval, newval) { hits++; return newval; }); -for (var i = 0; i < 10; i++) { - obj[x] = 1; - delete obj[x]; -} -assertEq(hits, 10); diff --git a/js/src/jit-test/tests/profiler/bug1140643.js b/js/src/jit-test/tests/profiler/bug1140643.js deleted file mode 100644 index 1b171aea2..000000000 --- a/js/src/jit-test/tests/profiler/bug1140643.js +++ /dev/null @@ -1,14 +0,0 @@ -// |jit-test| allow-oom -enableSPSProfiling(); -loadFile('\ -for (var i = 0; i < 2; i++) {\ - obj = { m: function () {} };\ - obj.watch("m", function () { float32 = 0 + obj.foo; });\ - obj.m = 0;\ -}\ -'); -gcparam("maxBytes", gcparam("gcBytes") + (1)*1024); -newGlobal("same-compartment"); -function loadFile(lfVarx) { - evaluate(lfVarx, { noScriptRval : true, isRunOnce : true }); -} diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index a001357f8..9530f65fa 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -4053,9 +4053,6 @@ TryAttachSetValuePropStub(JSContext* cx, HandleScript script, jsbytecode* pc, IC { MOZ_ASSERT(!*attached); - if (obj->watched()) - return true; - RootedShape shape(cx); RootedObject holder(cx); if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &shape)) @@ -4151,9 +4148,6 @@ TryAttachSetAccessorPropStub(JSContext* cx, HandleScript script, jsbytecode* pc, MOZ_ASSERT(!*attached); MOZ_ASSERT(!*isTemporarilyUnoptimizable); - if (obj->watched()) - return true; - RootedShape shape(cx); RootedObject holder(cx); if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &shape)) diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index 5fc624fb1..ace6cd81e 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -4005,7 +4005,7 @@ jit::ConvertLinearInequality(TempAllocator& alloc, MBasicBlock* block, const Lin } static bool -AnalyzePoppedThis(JSContext* cx, ObjectGroup* group, +AnalyzePoppedThis(JSContext* cx, DPAConstraintInfo& constraintInfo, ObjectGroup* group, MDefinition* thisValue, MInstruction* ins, bool definitelyExecuted, HandlePlainObject baseobj, Vector<TypeNewScript::Initializer>* initializerList, @@ -4046,7 +4046,12 @@ AnalyzePoppedThis(JSContext* cx, ObjectGroup* group, return true; RootedId id(cx, NameToId(setprop->name())); - if (!AddClearDefiniteGetterSetterForPrototypeChain(cx, group, id)) { + bool added = false; + if (!AddClearDefiniteGetterSetterForPrototypeChain(cx, constraintInfo, + group, id, &added)) { + return false; + } + if (!added) { // The prototype chain already contains a getter/setter for this // property, or type information is too imprecise. return true; @@ -4106,7 +4111,12 @@ AnalyzePoppedThis(JSContext* cx, ObjectGroup* group, if (!baseobj->lookup(cx, id) && !accessedProperties->append(get->name())) return false; - if (!AddClearDefiniteGetterSetterForPrototypeChain(cx, group, id)) { + bool added = false; + if (!AddClearDefiniteGetterSetterForPrototypeChain(cx, constraintInfo, + group, id, &added)) { + return false; + } + if (!added) { // The |this| value can escape if any property reads it does go // through a getter. return true; @@ -4132,8 +4142,11 @@ CmpInstructions(const void* a, const void* b) } bool -jit::AnalyzeNewScriptDefiniteProperties(JSContext* cx, HandleFunction fun, - ObjectGroup* group, HandlePlainObject baseobj, +jit::AnalyzeNewScriptDefiniteProperties(JSContext* cx, + DPAConstraintInfo& constraintInfo, + HandleFunction fun, + ObjectGroup* group, + HandlePlainObject baseobj, Vector<TypeNewScript::Initializer>* initializerList) { MOZ_ASSERT(cx->zone()->types.activeAnalysis); @@ -4293,7 +4306,7 @@ jit::AnalyzeNewScriptDefiniteProperties(JSContext* cx, HandleFunction fun, bool handled = false; size_t slotSpan = baseobj->slotSpan(); - if (!AnalyzePoppedThis(cx, group, thisValue, ins, definitelyExecuted, + if (!AnalyzePoppedThis(cx, constraintInfo, group, thisValue, ins, definitelyExecuted, baseobj, initializerList, &accessedProperties, &handled)) { return false; @@ -4312,7 +4325,6 @@ jit::AnalyzeNewScriptDefiniteProperties(JSContext* cx, HandleFunction fun, // contingent on the correct frames being inlined. Add constraints to // invalidate the definite properties if additional functions could be // called at the inline frame sites. - Vector<MBasicBlock*> exitBlocks(cx); for (MBasicBlockIterator block(graph.begin()); block != graph.end(); block++) { // Inlining decisions made after the last new property was added to // the object don't need to be frozen. @@ -4320,9 +4332,11 @@ jit::AnalyzeNewScriptDefiniteProperties(JSContext* cx, HandleFunction fun, break; if (MResumePoint* rp = block->callerResumePoint()) { if (block->numPredecessors() == 1 && block->getPredecessor(0) == rp->block()) { - JSScript* script = rp->block()->info().script(); - if (!AddClearDefiniteFunctionUsesInScript(cx, group, script, block->info().script())) + JSScript* caller = rp->block()->info().script(); + JSScript* callee = block->info().script(); + if (!constraintInfo.addInliningConstraint(caller, callee)) { return false; + } } } } diff --git a/js/src/jit/IonAnalysis.h b/js/src/jit/IonAnalysis.h index efd31415b..49bc0b591 100644 --- a/js/src/jit/IonAnalysis.h +++ b/js/src/jit/IonAnalysis.h @@ -196,8 +196,11 @@ MCompare* ConvertLinearInequality(TempAllocator& alloc, MBasicBlock* block, const LinearSum& sum); MOZ_MUST_USE bool -AnalyzeNewScriptDefiniteProperties(JSContext* cx, HandleFunction fun, - ObjectGroup* group, HandlePlainObject baseobj, +AnalyzeNewScriptDefiniteProperties(JSContext* cx, + DPAConstraintInfo& constraintInfo, + HandleFunction fun, + ObjectGroup* group, + HandlePlainObject baseobj, Vector<TypeNewScript::Initializer>* initializerList); MOZ_MUST_USE bool diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 2d053de5a..0c69729a4 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -8895,10 +8895,8 @@ IonBuilder::jsop_getimport(PropertyName* name) if (!emitted) { // This can happen if we don't have type information. - TypeSet::ObjectKey* staticKey = TypeSet::ObjectKey::get(targetEnv); TemporaryTypeSet* types = bytecodeTypes(pc); - BarrierKind barrier = PropertyReadNeedsTypeBarrier(analysisContext, constraints(), staticKey, - name, types, /* updateObserved = */ true); + BarrierKind barrier = BarrierKind::TypeSet; if (!loadStaticSlot(targetEnv, barrier, types, shape->slot())) return false; diff --git a/js/src/jit/IonCaches.cpp b/js/src/jit/IonCaches.cpp index 48e0792bb..fb4291188 100644 --- a/js/src/jit/IonCaches.cpp +++ b/js/src/jit/IonCaches.cpp @@ -3232,7 +3232,7 @@ SetPropertyIC::tryAttachStub(JSContext* cx, HandleScript outerScript, IonScript* MOZ_ASSERT(!*emitted); MOZ_ASSERT(!*tryNativeAddSlot); - if (!canAttachStub() || obj->watched()) + if (!canAttachStub()) return true; // Fail cache emission if the object is frozen @@ -3897,9 +3897,6 @@ IsDenseElementSetInlineable(JSObject* obj, const Value& idval, const ConstantOrR if (!obj->is<ArrayObject>()) return false; - if (obj->watched()) - return false; - if (!idval.isInt32()) return false; diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp index a4161ab00..3421001f7 100644 --- a/js/src/jit/arm/MacroAssembler-arm.cpp +++ b/js/src/jit/arm/MacroAssembler-arm.cpp @@ -3462,8 +3462,8 @@ MacroAssemblerARMCompat::storePayload(const Value& val, const Address& dest) ScratchRegisterScope scratch(asMasm()); SecondScratchRegisterScope scratch2(asMasm()); - if (val.isMarkable()) - ma_mov(ImmGCPtr(val.toMarkablePointer()), scratch); + if (val.isGCThing()) + ma_mov(ImmGCPtr(val.toGCThing()), scratch); else ma_mov(Imm32(val.toNunboxPayload()), scratch); ma_str(scratch, ToPayload(dest), scratch2); diff --git a/js/src/js.msg b/js/src/js.msg index f57b36a90..1612c831d 100644 --- a/js/src/js.msg +++ b/js/src/js.msg @@ -47,7 +47,6 @@ MSG_DEF(JSMSG_MORE_ARGS_NEEDED, 3, JSEXN_TYPEERR, "{0} requires more than MSG_DEF(JSMSG_INCOMPATIBLE_PROTO, 3, JSEXN_TYPEERR, "{0}.prototype.{1} called on incompatible {2}") MSG_DEF(JSMSG_NO_CONSTRUCTOR, 1, JSEXN_TYPEERR, "{0} has no constructor") MSG_DEF(JSMSG_BAD_SORT_ARG, 0, JSEXN_TYPEERR, "invalid Array.prototype.sort argument") -MSG_DEF(JSMSG_CANT_WATCH, 1, JSEXN_TYPEERR, "can't watch non-native objects of class {0}") MSG_DEF(JSMSG_READ_ONLY, 1, JSEXN_TYPEERR, "{0} is read-only") MSG_DEF(JSMSG_CANT_DELETE, 1, JSEXN_TYPEERR, "property {0} is non-configurable and can't be deleted") MSG_DEF(JSMSG_CANT_TRUNCATE_ARRAY, 0, JSEXN_TYPEERR, "can't delete non-configurable array element") @@ -72,7 +71,6 @@ MSG_DEF(JSMSG_UNDEFINED_PROP, 1, JSEXN_REFERENCEERR, "reference to unde MSG_DEF(JSMSG_INVALID_MAP_ITERABLE, 1, JSEXN_TYPEERR, "iterable for {0} should have array-like objects") MSG_DEF(JSMSG_NESTING_GENERATOR, 0, JSEXN_TYPEERR, "already executing generator") MSG_DEF(JSMSG_INCOMPATIBLE_METHOD, 3, JSEXN_TYPEERR, "{0} {1} called on incompatible {2}") -MSG_DEF(JSMSG_OBJECT_WATCH_DEPRECATED, 0, JSEXN_WARN, "Object.prototype.watch and unwatch are very slow, non-standard, and deprecated; use a getter/setter instead") MSG_DEF(JSMSG_ARRAYBUFFER_SLICE_DEPRECATED, 0, JSEXN_WARN, "ArrayBuffer.slice is deprecated; use ArrayBuffer.prototype.slice instead") MSG_DEF(JSMSG_BAD_SURROGATE_CHAR, 1, JSEXN_TYPEERR, "bad surrogate character {0}") MSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE, 1, JSEXN_TYPEERR, "UTF-8 character {0} too large") diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 84a315587..f9a0c6a6b 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -39,7 +39,6 @@ #include "jsstr.h" #include "jstypes.h" #include "jsutil.h" -#include "jswatchpoint.h" #include "jsweakmap.h" #include "jswrapper.h" @@ -2011,6 +2010,28 @@ JS_GetOwnUCPropertyDescriptor(JSContext* cx, HandleObject obj, const char16_t* n } JS_PUBLIC_API(bool) +JS_GetOwnElement(JSContext* cx, JS::HandleObject obj, uint32_t index, JS::MutableHandleValue vp) +{ + RootedId id(cx); + if (!IndexToId(cx, index, &id)) { + return false; + } + + Rooted<PropertyDescriptor> desc(cx); + if (!JS_GetOwnPropertyDescriptorById(cx, obj, id, &desc)) { + return false; + } + + if (desc.object() && desc.isDataDescriptor()) { + vp.set(desc.value()); + } else { + vp.setUndefined(); + } + + return true; +} + +JS_PUBLIC_API(bool) JS_GetPropertyDescriptorById(JSContext* cx, HandleObject obj, HandleId id, MutableHandle<PropertyDescriptor> desc) { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 67b3d4267..dc00c650d 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -2922,6 +2922,9 @@ extern JS_PUBLIC_API(bool) JS_GetOwnUCPropertyDescriptor(JSContext* cx, JS::HandleObject obj, const char16_t* name, size_t namelen, JS::MutableHandle<JS::PropertyDescriptor> desc); +extern JS_PUBLIC_API(bool) +JS_GetOwnElement(JSContext* cx, JS::HandleObject obj, uint32_t index, JS::MutableHandleValue vp); + /** * Like JS_GetOwnPropertyDescriptorById, but also searches the prototype chain * if no own property is found directly on obj. The object on which the diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index e505a4b34..23b9d27ae 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -37,7 +37,6 @@ #include "jsscript.h" #include "jsstr.h" #include "jstypes.h" -#include "jswatchpoint.h" #include "gc/Marking.h" #include "jit/Ion.h" diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp index d0caeb558..8ba186b08 100644 --- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -13,7 +13,6 @@ #include "jsfriendapi.h" #include "jsgc.h" #include "jsiter.h" -#include "jswatchpoint.h" #include "jswrapper.h" #include "gc/Marking.h" @@ -76,7 +75,6 @@ JSCompartment::JSCompartment(Zone* zone, const JS::CompartmentOptions& options = gcIncomingGrayPointers(nullptr), debugModeBits(0), randomKeyGenerator_(runtime_->forkRandomKeyGenerator()), - watchpointMap(nullptr), scriptCountsMap(nullptr), debugScriptMap(nullptr), debugEnvs(nullptr), @@ -103,7 +101,6 @@ JSCompartment::~JSCompartment() rt->lcovOutput.writeLCovResult(lcovOutput); js_delete(jitCompartment_); - js_delete(watchpointMap); js_delete(scriptCountsMap); js_delete(debugScriptMap); js_delete(debugEnvs); @@ -662,12 +659,6 @@ JSCompartment::traceRoots(JSTracer* trc, js::gc::GCRuntime::TraceOrMarkRuntime t if (traceOrMark == js::gc::GCRuntime::MarkRuntime && !zone()->isCollecting()) return; - // During a GC, these are treated as weak pointers. - if (traceOrMark == js::gc::GCRuntime::TraceRuntime) { - if (watchpointMap) - watchpointMap->markAll(trc); - } - /* Mark debug scopes, if present */ if (debugEnvs) debugEnvs->mark(trc); @@ -712,9 +703,6 @@ JSCompartment::traceRoots(JSTracer* trc, js::gc::GCRuntime::TraceOrMarkRuntime t void JSCompartment::finishRoots() { - if (watchpointMap) - watchpointMap->clear(); - if (debugEnvs) debugEnvs->finish(); diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index 83c15da3b..05ff40b43 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -282,7 +282,6 @@ class MOZ_RAII AutoSetNewObjectMetadata : private JS::CustomAutoRooter namespace js { class DebugEnvironments; class ObjectWeakMap; -class WatchpointMap; class WeakMapBase; } // namespace js @@ -811,8 +810,6 @@ struct JSCompartment void sweepBreakpoints(js::FreeOp* fop); public: - js::WatchpointMap* watchpointMap; - js::ScriptCountsMap* scriptCountsMap; js::DebugScriptMap* debugScriptMap; diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 65cc81a1a..3fc9200c1 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -205,7 +205,12 @@ size_t ExtraMallocSize(JSErrorReport* report) { if (report->linebuf()) - return (report->linebufLength() + 1) * sizeof(char16_t); + /* + * Mozilla bug 1352449. Count with null + * terminator and alignment. See CopyExtraData for + * the details about alignment. + */ + return (report->linebufLength() + 1) * sizeof(char16_t) + 1; return 0; } @@ -220,10 +225,20 @@ bool CopyExtraData(JSContext* cx, uint8_t** cursor, JSErrorReport* copy, JSErrorReport* report) { if (report->linebuf()) { + /* + * Make sure cursor is properly aligned for char16_t for platforms + * which need it and it's at the end of the buffer on exit. + */ + size_t alignment_backlog = 0; + if (size_t(*cursor) % 2) + (*cursor)++; + else + alignment_backlog = 1; + size_t linebufSize = (report->linebufLength() + 1) * sizeof(char16_t); const char16_t* linebufCopy = (const char16_t*)(*cursor); js_memcpy(*cursor, report->linebuf(), linebufSize); - *cursor += linebufSize; + *cursor += linebufSize + alignment_backlog; copy->initBorrowedLinebuf(linebufCopy, report->linebufLength(), report->tokenOffset()); } diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index f7622cb44..bdb3c0a4d 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -15,7 +15,6 @@ #include "jsgc.h" #include "jsobj.h" #include "jsprf.h" -#include "jswatchpoint.h" #include "jsweakmap.h" #include "jswrapper.h" @@ -579,7 +578,6 @@ void js::TraceWeakMaps(WeakMapTracer* trc) { WeakMapBase::traceAllMappings(trc); - WatchpointMap::traceAll(trc); } extern JS_FRIEND_API(bool) diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 351667fb3..491215456 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -2110,30 +2110,6 @@ JS_FRIEND_API(void*) JS_GetDataViewData(JSObject* obj, const JS::AutoCheckCannotGC&); namespace js { - -/** - * Add a watchpoint -- in the Object.prototype.watch sense -- to |obj| for the - * property |id|, using the callable object |callable| as the function to be - * called for notifications. - * - * This is an internal function exposed -- temporarily -- only so that DOM - * proxies can be watchable. Don't use it! We'll soon kill off the - * Object.prototype.{,un}watch functions, at which point this will go too. - */ -extern JS_FRIEND_API(bool) -WatchGuts(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject callable); - -/** - * Remove a watchpoint -- in the Object.prototype.watch sense -- from |obj| for - * the property |id|. - * - * This is an internal function exposed -- temporarily -- only so that DOM - * proxies can be watchable. Don't use it! We'll soon kill off the - * Object.prototype.{,un}watch functions, at which point this will go too. - */ -extern JS_FRIEND_API(bool) -UnwatchGuts(JSContext* cx, JS::HandleObject obj, JS::HandleId id); - namespace jit { enum class InlinableNative : uint16_t; diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index b2ee8d67b..5a9d732b6 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -207,7 +207,6 @@ #include "jsscript.h" #include "jstypes.h" #include "jsutil.h" -#include "jswatchpoint.h" #include "jsweakmap.h" #ifdef XP_WIN # include "jswin.h" @@ -2392,11 +2391,6 @@ GCRuntime::updatePointersToRelocatedCells(Zone* zone, AutoLockForExclusiveAccess Debugger::markIncomingCrossCompartmentEdges(&trc); WeakMapBase::markAll(zone, &trc); - for (CompartmentsInZoneIter c(zone); !c.done(); c.next()) { - c->trace(&trc); - if (c->watchpointMap) - c->watchpointMap->markAll(&trc); - } // Mark all gray roots, making sure we call the trace callback to get the // current set. @@ -2405,7 +2399,6 @@ GCRuntime::updatePointersToRelocatedCells(Zone* zone, AutoLockForExclusiveAccess } // Sweep everything to fix up weak pointers - WatchpointMap::sweepAll(rt); Debugger::sweepAll(rt->defaultFreeOp()); jit::JitRuntime::SweepJitcodeGlobalTable(rt); rt->gc.sweepZoneAfterCompacting(zone); @@ -3850,10 +3843,6 @@ GCRuntime::markWeakReferences(gcstats::Phase phase) for (ZoneIterT zone(rt); !zone.done(); zone.next()) markedAny |= WeakMapBase::markZoneIteratively(zone, &marker); } - for (CompartmentsIterT<ZoneIterT> c(rt); !c.done(); c.next()) { - if (c->watchpointMap) - markedAny |= c->watchpointMap->markIteratively(&marker); - } markedAny |= Debugger::markAllIteratively(&marker); markedAny |= jit::JitRuntime::MarkJitcodeGlobalTableIteratively(&marker); @@ -4625,9 +4614,6 @@ GCRuntime::beginSweepingZoneGroup(AutoLockForExclusiveAccess& lock) // Bug 1071218: the following two methods have not yet been // refactored to work on a single zone-group at once. - // Collect watch points associated with unreachable objects. - WatchpointMap::sweepAll(rt); - // Detach unreachable debuggers and global objects from each other. Debugger::sweepAll(&fop); diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 98f8fc741..4e96e01e8 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -26,11 +26,7 @@ # include <sys/syscall.h> # include <sys/types.h> # include <unistd.h> -static pid_t -gettid() -{ - return syscall(__NR_gettid); -} +# define gettid() static_cast<pid_t>(syscall(SYS_gettid)) # endif #else @@ -71,6 +67,20 @@ js::GetNativeStackBaseImpl() # endif } +#elif defined(XP_SOLARIS) + +#include <ucontext.h> + +JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0); + +void* +js::GetNativeStackBaseImpl() +{ + stack_t st; + stack_getbounds(&st); + return static_cast<char*>(st.ss_sp) + st.ss_size; +} + #elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__) void* js::GetNativeStackBaseImpl() diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 6f9596924..ef1291079 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -33,7 +33,6 @@ #include "jsstr.h" #include "jstypes.h" #include "jsutil.h" -#include "jswatchpoint.h" #include "jswin.h" #include "jswrapper.h" @@ -1011,13 +1010,7 @@ js::CreateThisForFunction(JSContext* cx, HandleObject callee, HandleObject newTa JSObject::nonNativeSetProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v, HandleValue receiver, ObjectOpResult& result) { - RootedValue value(cx, v); - if (MOZ_UNLIKELY(obj->watched())) { - WatchpointMap* wpmap = cx->compartment()->watchpointMap; - if (wpmap && !wpmap->triggerWatchpoint(cx, obj, id, &value)) - return false; - } - return obj->getOpsSetProperty()(cx, obj, id, value, receiver, result); + return obj->getOpsSetProperty()(cx, obj, id, v, receiver, result); } /* static */ bool @@ -2795,68 +2788,6 @@ js::GetPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id, return true; } -bool -js::WatchGuts(JSContext* cx, JS::HandleObject origObj, JS::HandleId id, JS::HandleObject callable) -{ - RootedObject obj(cx, ToWindowIfWindowProxy(origObj)); - if (obj->isNative()) { - // Use sparse indexes for watched objects, as dense elements can be - // written to without checking the watchpoint map. - if (!NativeObject::sparsifyDenseElements(cx, obj.as<NativeObject>())) - return false; - - MarkTypePropertyNonData(cx, obj, id); - } - - WatchpointMap* wpmap = cx->compartment()->watchpointMap; - if (!wpmap) { - wpmap = cx->runtime()->new_<WatchpointMap>(); - if (!wpmap || !wpmap->init()) { - ReportOutOfMemory(cx); - js_delete(wpmap); - return false; - } - cx->compartment()->watchpointMap = wpmap; - } - - return wpmap->watch(cx, obj, id, js::WatchHandler, callable); -} - -bool -js::UnwatchGuts(JSContext* cx, JS::HandleObject origObj, JS::HandleId id) -{ - // Looking in the map for an unsupported object will never hit, so we don't - // need to check for nativeness or watchable-ness here. - RootedObject obj(cx, ToWindowIfWindowProxy(origObj)); - if (WatchpointMap* wpmap = cx->compartment()->watchpointMap) - wpmap->unwatch(obj, id, nullptr, nullptr); - return true; -} - -bool -js::WatchProperty(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable) -{ - if (WatchOp op = obj->getOpsWatch()) - return op(cx, obj, id, callable); - - if (!obj->isNative() || obj->is<TypedArrayObject>()) { - JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_WATCH, - obj->getClass()->name); - return false; - } - - return WatchGuts(cx, obj, id, callable); -} - -bool -js::UnwatchProperty(JSContext* cx, HandleObject obj, HandleId id) -{ - if (UnwatchOp op = obj->getOpsUnwatch()) - return op(cx, obj, id); - - return UnwatchGuts(cx, obj, id); -} - const char* js::GetObjectClassName(JSContext* cx, HandleObject obj) { @@ -3416,7 +3347,6 @@ JSObject::dump(FILE* fp) const if (obj->isBoundFunction()) fprintf(fp, " bound_function"); if (obj->isQualifiedVarObj()) fprintf(fp, " varobj"); if (obj->isUnqualifiedVarObj()) fprintf(fp, " unqualified_varobj"); - if (obj->watched()) fprintf(fp, " watched"); if (obj->isIteratedSingleton()) fprintf(fp, " iterated_singleton"); if (obj->isNewGroupUnknown()) fprintf(fp, " new_type_unknown"); if (obj->hasUncacheableProto()) fprintf(fp, " has_uncacheable_proto"); diff --git a/js/src/jsobj.h b/js/src/jsobj.h index db2c22b76..01845d7e6 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -141,8 +141,6 @@ class JSObject : public js::gc::Cell js::GetOwnPropertyOp getOpsGetOwnPropertyDescriptor() const { return getClass()->getOpsGetOwnPropertyDescriptor(); } js::DeletePropertyOp getOpsDeleteProperty() const { return getClass()->getOpsDeleteProperty(); } - js::WatchOp getOpsWatch() const { return getClass()->getOpsWatch(); } - js::UnwatchOp getOpsUnwatch() const { return getClass()->getOpsUnwatch(); } js::GetElementsOp getOpsGetElements() const { return getClass()->getOpsGetElements(); } JSNewEnumerateOp getOpsEnumerate() const { return getClass()->getOpsEnumerate(); } JSFunToStringOp getOpsFunToString() const { return getClass()->getOpsFunToString(); } @@ -221,11 +219,6 @@ class JSObject : public js::gc::Cell inline bool isBoundFunction() const; inline bool hasSpecialEquality() const; - inline bool watched() const; - static bool setWatched(js::ExclusiveContext* cx, JS::HandleObject obj) { - return setFlags(cx, obj, js::BaseShape::WATCHED, GENERATE_SHAPE); - } - // A "qualified" varobj is the object on which "qualified" variable // declarations (i.e., those defined with "var") are kept. // @@ -1032,21 +1025,6 @@ extern bool DefineFunctions(JSContext* cx, HandleObject obj, const JSFunctionSpec* fs, DefineAsIntrinsic intrinsic); -/* - * Set a watchpoint: a synchronous callback when the given property of the - * given object is set. - * - * Watchpoints are nonstandard and do not fit in well with the way ES6 - * specifies [[Set]]. They are also insufficient for implementing - * Object.observe. - */ -extern bool -WatchProperty(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable); - -/* Clear a watchpoint. */ -extern bool -UnwatchProperty(JSContext* cx, HandleObject obj, HandleId id); - /* ES6 draft rev 36 (2015 March 17) 7.1.1 ToPrimitive(vp[, preferredType]) */ extern bool ToPrimitiveSlow(JSContext* cx, JSType hint, MutableHandleValue vp); diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index c132ee6b2..98e740142 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -464,12 +464,6 @@ JSObject::isBoundFunction() const } inline bool -JSObject::watched() const -{ - return hasAllFlags(js::BaseShape::WATCHED); -} - -inline bool JSObject::isDelegate() const { return hasAllFlags(js::BaseShape::DELEGATE); diff --git a/js/src/jsversion.h b/js/src/jsversion.h index 8bdfe47b6..cf4c6e73a 100644 --- a/js/src/jsversion.h +++ b/js/src/jsversion.h @@ -12,7 +12,6 @@ */ #define JS_HAS_STR_HTML_HELPERS 1 /* (no longer used) */ #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ -#define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ diff --git a/js/src/jswatchpoint.cpp b/js/src/jswatchpoint.cpp deleted file mode 100644 index 34479a990..000000000 --- a/js/src/jswatchpoint.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "jswatchpoint.h" - -#include "jsatom.h" -#include "jscompartment.h" -#include "jsfriendapi.h" - -#include "gc/Marking.h" -#include "vm/Shape.h" - -#include "jsgcinlines.h" - -using namespace js; -using namespace js::gc; - -inline HashNumber -WatchKeyHasher::hash(const Lookup& key) -{ - return MovableCellHasher<PreBarrieredObject>::hash(key.object) ^ HashId(key.id); -} - -namespace { - -class AutoEntryHolder { - typedef WatchpointMap::Map Map; - Generation gen; - Map& map; - Map::Ptr p; - RootedObject obj; - RootedId id; - - public: - AutoEntryHolder(JSContext* cx, Map& map, Map::Ptr p) - : gen(map.generation()), map(map), p(p), obj(cx, p->key().object), id(cx, p->key().id) - { - MOZ_ASSERT(!p->value().held); - p->value().held = true; - } - - ~AutoEntryHolder() { - if (gen != map.generation()) - p = map.lookup(WatchKey(obj, id)); - if (p) - p->value().held = false; - } -}; - -} /* anonymous namespace */ - -bool -WatchpointMap::init() -{ - return map.init(); -} - -bool -WatchpointMap::watch(JSContext* cx, HandleObject obj, HandleId id, - JSWatchPointHandler handler, HandleObject closure) -{ - MOZ_ASSERT(JSID_IS_STRING(id) || JSID_IS_INT(id) || JSID_IS_SYMBOL(id)); - - if (!JSObject::setWatched(cx, obj)) - return false; - - Watchpoint w(handler, closure, false); - if (!map.put(WatchKey(obj, id), w)) { - ReportOutOfMemory(cx); - return false; - } - /* - * For generational GC, we don't need to post-barrier writes to the - * hashtable here because we mark all watchpoints as part of root marking in - * markAll(). - */ - return true; -} - -void -WatchpointMap::unwatch(JSObject* obj, jsid id, - JSWatchPointHandler* handlerp, JSObject** closurep) -{ - if (Map::Ptr p = map.lookup(WatchKey(obj, id))) { - if (handlerp) - *handlerp = p->value().handler; - if (closurep) { - // Read barrier to prevent an incorrectly gray closure from escaping the - // watchpoint. See the comment before UnmarkGrayChildren in gc/Marking.cpp - JS::ExposeObjectToActiveJS(p->value().closure); - *closurep = p->value().closure; - } - map.remove(p); - } -} - -void -WatchpointMap::unwatchObject(JSObject* obj) -{ - for (Map::Enum e(map); !e.empty(); e.popFront()) { - Map::Entry& entry = e.front(); - if (entry.key().object == obj) - e.removeFront(); - } -} - -void -WatchpointMap::clear() -{ - map.clear(); -} - -bool -WatchpointMap::triggerWatchpoint(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp) -{ - Map::Ptr p = map.lookup(WatchKey(obj, id)); - if (!p || p->value().held) - return true; - - AutoEntryHolder holder(cx, map, p); - - /* Copy the entry, since GC would invalidate p. */ - JSWatchPointHandler handler = p->value().handler; - RootedObject closure(cx, p->value().closure); - - /* Determine the property's old value. */ - Value old; - old.setUndefined(); - if (obj->isNative()) { - NativeObject* nobj = &obj->as<NativeObject>(); - if (Shape* shape = nobj->lookup(cx, id)) { - if (shape->hasSlot()) - old = nobj->getSlot(shape->slot()); - } - } - - // Read barrier to prevent an incorrectly gray closure from escaping the - // watchpoint. See the comment before UnmarkGrayChildren in gc/Marking.cpp - JS::ExposeObjectToActiveJS(closure); - - /* Call the handler. */ - return handler(cx, obj, id, old, vp.address(), closure); -} - -bool -WatchpointMap::markIteratively(JSTracer* trc) -{ - bool marked = false; - for (Map::Enum e(map); !e.empty(); e.popFront()) { - Map::Entry& entry = e.front(); - JSObject* priorKeyObj = entry.key().object; - jsid priorKeyId(entry.key().id.get()); - bool objectIsLive = - IsMarked(trc->runtime(), const_cast<PreBarrieredObject*>(&entry.key().object)); - if (objectIsLive || entry.value().held) { - if (!objectIsLive) { - TraceEdge(trc, const_cast<PreBarrieredObject*>(&entry.key().object), - "held Watchpoint object"); - marked = true; - } - - MOZ_ASSERT(JSID_IS_STRING(priorKeyId) || - JSID_IS_INT(priorKeyId) || - JSID_IS_SYMBOL(priorKeyId)); - TraceEdge(trc, const_cast<PreBarrieredId*>(&entry.key().id), "WatchKey::id"); - - if (entry.value().closure && !IsMarked(trc->runtime(), &entry.value().closure)) { - TraceEdge(trc, &entry.value().closure, "Watchpoint::closure"); - marked = true; - } - - /* We will sweep this entry in sweepAll if !objectIsLive. */ - if (priorKeyObj != entry.key().object || priorKeyId != entry.key().id) - e.rekeyFront(WatchKey(entry.key().object, entry.key().id)); - } - } - return marked; -} - -void -WatchpointMap::markAll(JSTracer* trc) -{ - for (Map::Enum e(map); !e.empty(); e.popFront()) { - Map::Entry& entry = e.front(); - JSObject* object = entry.key().object; - jsid id = entry.key().id; - JSObject* priorObject = object; - jsid priorId = id; - MOZ_ASSERT(JSID_IS_STRING(priorId) || JSID_IS_INT(priorId) || JSID_IS_SYMBOL(priorId)); - - TraceManuallyBarrieredEdge(trc, &object, "held Watchpoint object"); - TraceManuallyBarrieredEdge(trc, &id, "WatchKey::id"); - TraceEdge(trc, &entry.value().closure, "Watchpoint::closure"); - - if (priorObject != object || priorId != id) - e.rekeyFront(WatchKey(object, id)); - } -} - -void -WatchpointMap::sweepAll(JSRuntime* rt) -{ - for (GCCompartmentsIter c(rt); !c.done(); c.next()) { - if (WatchpointMap* wpmap = c->watchpointMap) - wpmap->sweep(); - } -} - -void -WatchpointMap::sweep() -{ - for (Map::Enum e(map); !e.empty(); e.popFront()) { - Map::Entry& entry = e.front(); - JSObject* obj(entry.key().object); - if (IsAboutToBeFinalizedUnbarriered(&obj)) { - MOZ_ASSERT(!entry.value().held); - e.removeFront(); - } else if (obj != entry.key().object) { - e.rekeyFront(WatchKey(obj, entry.key().id)); - } - } -} - -void -WatchpointMap::traceAll(WeakMapTracer* trc) -{ - JSRuntime* rt = trc->context; - for (CompartmentsIter comp(rt, SkipAtoms); !comp.done(); comp.next()) { - if (WatchpointMap* wpmap = comp->watchpointMap) - wpmap->trace(trc); - } -} - -void -WatchpointMap::trace(WeakMapTracer* trc) -{ - for (Map::Range r = map.all(); !r.empty(); r.popFront()) { - Map::Entry& entry = r.front(); - trc->trace(nullptr, - JS::GCCellPtr(entry.key().object.get()), - JS::GCCellPtr(entry.value().closure.get())); - } -} diff --git a/js/src/jswatchpoint.h b/js/src/jswatchpoint.h deleted file mode 100644 index bba6c38ce..000000000 --- a/js/src/jswatchpoint.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef jswatchpoint_h -#define jswatchpoint_h - -#include "jsalloc.h" - -#include "gc/Barrier.h" -#include "js/HashTable.h" - -namespace js { - -struct WeakMapTracer; - -struct WatchKey { - WatchKey() {} - WatchKey(JSObject* obj, jsid id) : object(obj), id(id) {} - WatchKey(const WatchKey& key) : object(key.object.get()), id(key.id.get()) {} - - // These are traced unconditionally during minor GC, so do not require - // post-barriers. - PreBarrieredObject object; - PreBarrieredId id; - - bool operator!=(const WatchKey& other) const { - return object != other.object || id != other.id; - } -}; - -typedef bool -(* JSWatchPointHandler)(JSContext* cx, JSObject* obj, jsid id, const JS::Value& old, - JS::Value* newp, void* closure); - -struct Watchpoint { - JSWatchPointHandler handler; - PreBarrieredObject closure; /* This is always marked in minor GCs and so doesn't require a postbarrier. */ - bool held; /* true if currently running handler */ - Watchpoint(JSWatchPointHandler handler, JSObject* closure, bool held) - : handler(handler), closure(closure), held(held) {} -}; - -struct WatchKeyHasher -{ - typedef WatchKey Lookup; - static inline js::HashNumber hash(const Lookup& key); - - static bool match(const WatchKey& k, const Lookup& l) { - return MovableCellHasher<PreBarrieredObject>::match(k.object, l.object) && - DefaultHasher<PreBarrieredId>::match(k.id, l.id); - } - - static void rekey(WatchKey& k, const WatchKey& newKey) { - k.object.unsafeSet(newKey.object); - k.id.unsafeSet(newKey.id); - } -}; - -class WatchpointMap { - public: - typedef HashMap<WatchKey, Watchpoint, WatchKeyHasher, SystemAllocPolicy> Map; - - bool init(); - bool watch(JSContext* cx, HandleObject obj, HandleId id, - JSWatchPointHandler handler, HandleObject closure); - void unwatch(JSObject* obj, jsid id, - JSWatchPointHandler* handlerp, JSObject** closurep); - void unwatchObject(JSObject* obj); - void clear(); - - bool triggerWatchpoint(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp); - - bool markIteratively(JSTracer* trc); - void markAll(JSTracer* trc); - static void sweepAll(JSRuntime* rt); - void sweep(); - - static void traceAll(WeakMapTracer* trc); - void trace(WeakMapTracer* trc); - - private: - Map map; -}; - -} // namespace js - -#endif /* jswatchpoint_h */ diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index 5f3704e32..32336c68b 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -315,13 +315,6 @@ class JS_FRIEND_API(SecurityWrapper) : public Base virtual bool regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g) const override; virtual bool boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp) const override; - // Allow isCallable and isConstructor. They used to be class-level, and so could not be guarded - // against. - - virtual bool watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, - JS::HandleObject callable) const override; - virtual bool unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id) const override; - /* * Allow our subclasses to select the superclass behavior they want without * needing to specify an exact superclass. diff --git a/js/src/moz.build b/js/src/moz.build index a0f074d1c..d1e80b4ce 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -291,7 +291,6 @@ UNIFIED_SOURCES += [ 'jspropertytree.cpp', 'jsscript.cpp', 'jsstr.cpp', - 'jswatchpoint.cpp', 'jsweakmap.cpp', 'perf/jsperf.cpp', 'proxy/BaseProxyHandler.cpp', @@ -721,6 +720,14 @@ if CONFIG['OS_ARCH'] == 'Linux': 'dl', ] +if CONFIG['OS_ARCH'] == 'SunOS': + OS_LIBS += [ + 'posix4', + 'dl', + 'nsl', + 'socket', + ] + OS_LIBS += CONFIG['REALTIME_LIBS'] CFLAGS += CONFIG['MOZ_ICU_CFLAGS'] diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 45108ee59..6566ce05e 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -923,6 +923,14 @@ case "$target" in fi ;; +i*86-*-solaris*) + MOZ_FIX_LINK_PATHS="-L${DIST}/bin -R'\$\$ORIGIN':/usr/gcc/7/lib" + ;; + +x86_64-*-solaris*) + MOZ_FIX_LINK_PATHS="-L${DIST}/bin -R'\$\$ORIGIN':/usr/gcc/7/lib/amd64" + ;; + esac dnl Only one oddball right now (QNX), but this gives us flexibility diff --git a/js/src/proxy/BaseProxyHandler.cpp b/js/src/proxy/BaseProxyHandler.cpp index 8d5f30a19..423aa8671 100644 --- a/js/src/proxy/BaseProxyHandler.cpp +++ b/js/src/proxy/BaseProxyHandler.cpp @@ -419,20 +419,6 @@ BaseProxyHandler::setImmutablePrototype(JSContext* cx, HandleObject proxy, bool* } bool -BaseProxyHandler::watch(JSContext* cx, HandleObject proxy, HandleId id, HandleObject callable) const -{ - JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_WATCH, - proxy->getClass()->name); - return false; -} - -bool -BaseProxyHandler::unwatch(JSContext* cx, HandleObject proxy, HandleId id) const -{ - return true; -} - -bool BaseProxyHandler::getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end, ElementAdder* adder) const { diff --git a/js/src/proxy/Proxy.cpp b/js/src/proxy/Proxy.cpp index 2c1cffb77..6b3a3d1e9 100644 --- a/js/src/proxy/Proxy.cpp +++ b/js/src/proxy/Proxy.cpp @@ -505,20 +505,6 @@ Proxy::boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp JSObject * const TaggedProto::LazyProto = reinterpret_cast<JSObject*>(0x1); /* static */ bool -Proxy::watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleObject callable) -{ - JS_CHECK_RECURSION(cx, return false); - return proxy->as<ProxyObject>().handler()->watch(cx, proxy, id, callable); -} - -/* static */ bool -Proxy::unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id) -{ - JS_CHECK_RECURSION(cx, return false); - return proxy->as<ProxyObject>().handler()->unwatch(cx, proxy, id); -} - -/* static */ bool Proxy::getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end, ElementAdder* adder) { @@ -699,18 +685,6 @@ js::proxy_Construct(JSContext* cx, unsigned argc, Value* vp) } bool -js::proxy_Watch(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable) -{ - return Proxy::watch(cx, obj, id, callable); -} - -bool -js::proxy_Unwatch(JSContext* cx, HandleObject obj, HandleId id) -{ - return Proxy::unwatch(cx, obj, id); -} - -bool js::proxy_GetElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end, ElementAdder* adder) { @@ -750,7 +724,6 @@ const ObjectOps js::ProxyObjectOps = { js::proxy_SetProperty, js::proxy_GetOwnPropertyDescriptor, js::proxy_DeleteProperty, - js::proxy_Watch, js::proxy_Unwatch, js::proxy_GetElements, nullptr, /* enumerate */ js::proxy_FunToString diff --git a/js/src/proxy/Proxy.h b/js/src/proxy/Proxy.h index 89909a085..4a8ecf8ab 100644 --- a/js/src/proxy/Proxy.h +++ b/js/src/proxy/Proxy.h @@ -65,9 +65,6 @@ class Proxy static bool regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g); static bool boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp); - static bool watch(JSContext* cx, HandleObject proxy, HandleId id, HandleObject callable); - static bool unwatch(JSContext* cx, HandleObject proxy, HandleId id); - static bool getElements(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end, ElementAdder* adder); diff --git a/js/src/proxy/SecurityWrapper.cpp b/js/src/proxy/SecurityWrapper.cpp index 710faf9b0..71d22fca6 100644 --- a/js/src/proxy/SecurityWrapper.cpp +++ b/js/src/proxy/SecurityWrapper.cpp @@ -130,24 +130,5 @@ SecurityWrapper<Base>::defineProperty(JSContext* cx, HandleObject wrapper, Handl return Base::defineProperty(cx, wrapper, id, desc, result); } -template <class Base> -bool -SecurityWrapper<Base>::watch(JSContext* cx, HandleObject proxy, - HandleId id, HandleObject callable) const -{ - ReportUnwrapDenied(cx); - return false; -} - -template <class Base> -bool -SecurityWrapper<Base>::unwatch(JSContext* cx, HandleObject proxy, - HandleId id) const -{ - ReportUnwrapDenied(cx); - return false; -} - - template class js::SecurityWrapper<Wrapper>; template class js::SecurityWrapper<CrossCompartmentWrapper>; diff --git a/js/src/shell/OSObject.cpp b/js/src/shell/OSObject.cpp index 846ec7b15..4fb3d4e77 100644 --- a/js/src/shell/OSObject.cpp +++ b/js/src/shell/OSObject.cpp @@ -184,6 +184,11 @@ FileAsTypedArray(JSContext* cx, JS::HandleString pathnameStr) return nullptr; JS_ReportErrorUTF8(cx, "can't seek start of %s", pathname.ptr()); } else { + if (len > INT32_MAX) { + JS_ReportErrorUTF8(cx, "file %s is too large for a Uint8Array", + pathname.ptr()); + return nullptr; + } obj = JS_NewUint8Array(cx, len); if (!obj) return nullptr; diff --git a/js/src/tests/Intl/DateTimeFormat/timeZone_backward_links.js b/js/src/tests/Intl/DateTimeFormat/timeZone_backward_links.js index 8cda44d87..8bd0512c5 100644 --- a/js/src/tests/Intl/DateTimeFormat/timeZone_backward_links.js +++ b/js/src/tests/Intl/DateTimeFormat/timeZone_backward_links.js @@ -1,7 +1,7 @@ // |reftest| skip-if(!this.hasOwnProperty("Intl")) // Generated by make_intl_data.py. DO NOT EDIT. -// tzdata version = 2019a +// tzdata version = 2019c const tzMapper = [ x => x, diff --git a/js/src/tests/Intl/DateTimeFormat/timeZone_backzone.js b/js/src/tests/Intl/DateTimeFormat/timeZone_backzone.js index a3efe0310..c760fd85e 100644 --- a/js/src/tests/Intl/DateTimeFormat/timeZone_backzone.js +++ b/js/src/tests/Intl/DateTimeFormat/timeZone_backzone.js @@ -1,7 +1,7 @@ // |reftest| skip-if(!this.hasOwnProperty("Intl")) // Generated by make_intl_data.py. DO NOT EDIT. -// tzdata version = 2019a +// tzdata version = 2019c const tzMapper = [ x => x, diff --git a/js/src/tests/Intl/DateTimeFormat/timeZone_backzone_links.js b/js/src/tests/Intl/DateTimeFormat/timeZone_backzone_links.js index b61593f78..38db5e77d 100644 --- a/js/src/tests/Intl/DateTimeFormat/timeZone_backzone_links.js +++ b/js/src/tests/Intl/DateTimeFormat/timeZone_backzone_links.js @@ -1,7 +1,7 @@ // |reftest| skip-if(!this.hasOwnProperty("Intl")) // Generated by make_intl_data.py. DO NOT EDIT. -// tzdata version = 2019a +// tzdata version = 2019c const tzMapper = [ x => x, diff --git a/js/src/tests/Intl/DateTimeFormat/timeZone_notbackward_links.js b/js/src/tests/Intl/DateTimeFormat/timeZone_notbackward_links.js index 12b55c214..64a25c241 100644 --- a/js/src/tests/Intl/DateTimeFormat/timeZone_notbackward_links.js +++ b/js/src/tests/Intl/DateTimeFormat/timeZone_notbackward_links.js @@ -1,7 +1,7 @@ // |reftest| skip-if(!this.hasOwnProperty("Intl")) // Generated by make_intl_data.py. DO NOT EDIT. -// tzdata version = 2019a +// tzdata version = 2019c const tzMapper = [ x => x, diff --git a/js/src/tests/ecma_5/Array/frozen-dense-array.js b/js/src/tests/ecma_5/Array/frozen-dense-array.js index 9db63036f..cdb86daa3 100644 --- a/js/src/tests/ecma_5/Array/frozen-dense-array.js +++ b/js/src/tests/ecma_5/Array/frozen-dense-array.js @@ -38,24 +38,5 @@ assertEq(delete a[0], false); assertArrayIsExpected(); -var watchpointCalled = false; -// NOTE: Be careful with the position of this test, since this sparsifies the -// elements and you might not test what you think you're testing otherwise. -a.watch(2, function(prop, oldValue, newValue) { - watchpointCalled = true; - assertEq(prop, 2); - assertEq(oldValue, 1); - assertEq(newValue, "foo"); -}); - -assertArrayIsExpected(); - -a.length = 5; -a[2] = "foo"; -assertEq(watchpointCalled, true); -assertEq(delete a[0], false); - -assertArrayIsExpected(); - if (typeof reportCompare === "function") reportCompare(true, true); diff --git a/js/src/tests/ecma_5/extensions/watch-array-length.js b/js/src/tests/ecma_5/extensions/watch-array-length.js deleted file mode 100644 index e9b356efa..000000000 --- a/js/src/tests/ecma_5/extensions/watch-array-length.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -var hitCount; -function watcher(p,o,n) { hitCount++; return n; } - -var a = [1]; -a.watch('length', watcher); -hitCount = 0; -a.length = 0; -reportCompare(1, hitCount, "lenient; configurable: watchpoint hit"); - -var b = Object.defineProperty([1],'0',{configurable:false}); -b.watch('length', watcher); -hitCount = 0; -var result; -try { - b.length = 0; - result = "no error"; -} catch (x) { - result = x.toString(); -} -reportCompare(1, hitCount, "lenient; non-configurable: watchpoint hit"); -reportCompare(1, b.length, "lenient; non-configurable: length unchanged"); -reportCompare("no error", result, "lenient; non-configurable: no error thrown"); - -var c = Object.defineProperty([1],'0',{configurable:false}); -c.watch('length', watcher); -hitCount = 0; -var threwTypeError; -try { - (function(){'use strict'; c.length = 0;})(); - threwTypeError = false; -} catch (x) { - threwTypeError = x instanceof TypeError; -} -reportCompare(1, hitCount, "strict; non-configurable: watchpoint hit"); -reportCompare(1, c.length, "strict; non-configurable: length unchanged"); -reportCompare(true, threwTypeError, "strict; non-configurable: TypeError thrown"); diff --git a/js/src/tests/ecma_5/extensions/watch-inherited-property.js b/js/src/tests/ecma_5/extensions/watch-inherited-property.js deleted file mode 100644 index 1a0ad566b..000000000 --- a/js/src/tests/ecma_5/extensions/watch-inherited-property.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -/* Create a prototype object with a setter property. */ -var protoSetterCount; -var proto = ({ set x(v) { protoSetterCount++; } }); - -/* Put a watchpoint on that setter. */ -var protoWatchCount; -proto.watch('x', function() { protoWatchCount++; }); - -/* Make an object with the above as its prototype. */ -function C() { } -C.prototype = proto; -var o = new C(); - -/* - * Set a watchpoint on the property in the inheriting object. We have - * defined this to mean "duplicate the property, setter and all, in the - * inheriting object." I don't think debugging observation mechanisms - * should mutate the program being run, but that's what we've got. - */ -var oWatchCount; -o.watch('x', function() { oWatchCount++; }); - -/* - * Assign to the property. This should trip the watchpoint on the inheriting object and - * the setter. - */ -protoSetterCount = protoWatchCount = oWatchCount = 0; -o.x = 1; -assertEq(protoWatchCount, 0); -assertEq(oWatchCount, 1); -assertEq(protoSetterCount, 1); - -reportCompare(true, true); diff --git a/js/src/tests/ecma_5/extensions/watch-replaced-setter.js b/js/src/tests/ecma_5/extensions/watch-replaced-setter.js deleted file mode 100644 index 05cf60aff..000000000 --- a/js/src/tests/ecma_5/extensions/watch-replaced-setter.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -/* A stock watcher function. */ -var watcherCount; -function watcher(id, oldval, newval) { watcherCount++; return newval; } - -/* Create an object with a JavaScript setter. */ -var setterCount; -var o = { w:2, set x(v) { setterCount++; } }; - -/* - * Put the object in dictionary mode, so that JSObject::putProperty will - * mutate its shapes instead of creating new ones. - */ -delete o.w; - -/* - * Place a watchpoint on the property. The watchpoint structure holds the - * original JavaScript setter, and a pointer to the shape. - */ -o.watch('x', watcher); - -/* - * Replace the accessor property with a value property. The shape's setter - * should become a non-JS setter, js_watch_set, and the watchpoint - * structure's saved setter should be updated (in this case, cleared). - */ -Object.defineProperty(o, 'x', { value:3, - writable:true, - enumerable:true, - configurable:true }); - -/* - * Assign to the property. This should trigger js_watch_set, which should - * call the handler, and then see that there is no JS-level setter to pass - * control on to, and return. - */ -watcherCount = setterCount = 0; -o.x = 3; -assertEq(watcherCount, 1); -assertEq(setterCount, 0); - -reportCompare(true, true); diff --git a/js/src/tests/ecma_5/extensions/watch-setter-become-setter.js b/js/src/tests/ecma_5/extensions/watch-setter-become-setter.js deleted file mode 100644 index f5eff98b8..000000000 --- a/js/src/tests/ecma_5/extensions/watch-setter-become-setter.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -/* Create an object with a JavaScript setter. */ -var firstSetterCount; -var o = { w:2, set x(v) { firstSetterCount++; } }; - -/* - * Put the object in dictionary mode, so that JSObject::putProperty will - * mutate its shapes instead of creating new ones. - */ -delete o.w; - -/* A stock watcher function. */ -var watcherCount; -function watcher(id, oldval, newval) { watcherCount++; return newval; } - -/* - * Place a watchpoint on the property. The property's shape now has the - * watchpoint setter, with the original setter saved in the watchpoint - * structure. - */ -o.watch('x', watcher); - -/* - * Replace the setter with a new setter. The shape should get updated to - * refer to the new setter, and then the watchpoint setter should be - * re-established. - */ -var secondSetterCount; -Object.defineProperty(o, 'x', { set: function () { secondSetterCount++ } }); - -/* - * Assign to the property. This should trigger the watchpoint and the new setter. - */ -watcherCount = firstSetterCount = secondSetterCount = 0; -o.x = 3; -assertEq(watcherCount, 1); -assertEq(firstSetterCount, 0); -assertEq(secondSetterCount, 1); - -reportCompare(true, true); diff --git a/js/src/tests/ecma_5/extensions/watch-value-prop-becoming-setter.js b/js/src/tests/ecma_5/extensions/watch-value-prop-becoming-setter.js deleted file mode 100644 index 03cdd788e..000000000 --- a/js/src/tests/ecma_5/extensions/watch-value-prop-becoming-setter.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -/* A stock watcher function. */ -var watcherCount; -function watcher(id, old, newval) { - watcherCount++; - return newval; -} - -/* Create an object with a value property. */ -var o = { w:2, x:3 }; - -/* - * Place a watchpoint on the value property. The watchpoint structure holds - * the original JavaScript setter, and a pointer to the shape. - */ -o.watch('x', watcher); - -/* - * Put the object in dictionary mode, so that JSObject::putProperty will - * mutate its shapes instead of creating new ones. - */ -delete o.w; - -/* - * Replace the value property with a setter. - */ -var setterCount; -o.__defineSetter__('x', function() { setterCount++; }); - -/* - * Trigger the watchpoint. The watchpoint handler should run, and then the - * setter should run. - */ -watcherCount = setterCount = 0; -o.x = 4; -assertEq(watcherCount, 1); -assertEq(setterCount, 1); - -reportCompare(true, true); diff --git a/js/src/tests/ecma_5/extensions/watchpoint-deletes-JSPropertyOp-setter.js b/js/src/tests/ecma_5/extensions/watchpoint-deletes-JSPropertyOp-setter.js deleted file mode 100644 index 85410bbd4..000000000 --- a/js/src/tests/ecma_5/extensions/watchpoint-deletes-JSPropertyOp-setter.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -function make_watcher(name) { - return function (id, oldv, newv) { - print("watched " + name + "[0]"); - }; -} - -var o, p; -function f(flag) { - if (flag) { - o = arguments; - } else { - p = arguments; - o.watch(0, make_watcher('o')); - p.watch(0, make_watcher('p')); - - /* - * Previously, the watchpoint implementation actually substituted its magic setter - * functions for the setters of shared shapes, and then 1) carefully ignored calls - * to its magic setter from unrelated objects, and 2) avoided restoring the - * original setter until all watchpoints on that shape had been removed. - * - * However, when the watchpoint code began using JSObject::changeProperty and - * js_ChangeNativePropertyAttrs to change shapes' setters, the shape tree code - * became conscious of the presence of watchpoints, and shared shapes between - * objects only when their watchpoint nature coincided. Clearing the magic setter - * from one object's shape would not affect other objects, because the - * watchpointed and non-watchpointed shapes were distinct if they were shared. - * - * Thus, the first unwatch call must go ahead and fix p's shape, even though a - * watchpoint exists on the same shape in o. o's watchpoint's presence shouldn't - * cause 'unwatch' to leave p's magic setter in place. - */ - - /* DropWatchPointAndUnlock would see o's watchpoint, and not change p's property. */ - p.unwatch(0); - - /* DropWatchPointAndUnlock would fix o's property, but not p's; p's setter would be gone. */ - o.unwatch(0); - - /* This would fail to invoke the arguments object's setter. */ - p[0] = 4; - - /* And the formal parameter would not get updated. */ - assertEq(flag, 4); - } -} - -f(true); -f(false); - -reportCompare(true, true); diff --git a/js/src/tests/js1_5/Object/regress-362872-01.js b/js/src/tests/js1_5/Object/regress-362872-01.js deleted file mode 100644 index 0808ee82b..000000000 --- a/js/src/tests/js1_5/Object/regress-362872-01.js +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 362872; -var summary = 'script should not drop watchpoint that is in use'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - function exploit() { - var rooter = {}, object = {}, filler1 = "", filler2 = "\u5555"; - for(var i = 0; i < 32/2-2; i++) { filler1 += "\u5050"; } - object.watch("foo", function(){ - object.unwatch("foo"); - object.unwatch("foo"); - for(var i = 0; i < 8 * 1024; i++) { - rooter[i] = filler1 + filler2; - } - }); - object.foo = "bar"; - } - exploit(); - - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/Object/regress-362872-02.js b/js/src/tests/js1_5/Object/regress-362872-02.js deleted file mode 100644 index edee43a4a..000000000 --- a/js/src/tests/js1_5/Object/regress-362872-02.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - * Contributor: Blake Kaplan - */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 362872; -var summary = 'script should not drop watchpoint that is in use'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -this.watch('x', function f() { - print("before"); - x = 3; - print("after"); - }); -x = 3; - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/Regress/regress-127243.js b/js/src/tests/js1_5/Regress/regress-127243.js deleted file mode 100644 index 11779f803..000000000 --- a/js/src/tests/js1_5/Regress/regress-127243.js +++ /dev/null @@ -1,75 +0,0 @@ -// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 127243; -var summary = 'Do not crash on watch'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -if (typeof window != 'undefined' && typeof document != 'undefined') -{ - // delay test driver end - gDelayTestDriverEnd = true; - window.addEventListener('load', handleLoad, false); -} -else -{ - printStatus('This test must be run in the browser'); - reportCompare(expect, actual, summary); - -} - -var div; - -function handleLoad() -{ - div = document.createElement('div'); - document.body.appendChild(div); - div.setAttribute('id', 'id1'); - div.style.width = '50px'; - div.style.height = '100px'; - div.style.overflow = 'auto'; - - for (var i = 0; i < 5; i++) - { - var p = document.createElement('p'); - var t = document.createTextNode('blah'); - p.appendChild(t); - div.appendChild(p); - } - - div.watch('scrollTop', wee); - - setTimeout('setScrollTop()', 1000); -} - -function wee(id, oldval, newval) -{ - var t = document.createTextNode('setting ' + id + - ' value ' + div.scrollTop + - ' oldval ' + oldval + - ' newval ' + newval); - var p = document.createElement('p'); - p.appendChild(t); - document.body.appendChild(p); - - return newval; -} - -function setScrollTop() -{ - div.scrollTop = 42; - - reportCompare(expect, actual, summary); - - gDelayTestDriverEnd = false; - jsTestDriverEnd(); - -} diff --git a/js/src/tests/js1_5/Regress/regress-213482.js b/js/src/tests/js1_5/Regress/regress-213482.js deleted file mode 100644 index 26ed7e894..000000000 --- a/js/src/tests/js1_5/Regress/regress-213482.js +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 213482; -var summary = 'Do not crash watching property when watcher sets property'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -var testobj = {value: 'foo'}; - -function watched (a, b, c) { - testobj.value = (new Date()).getTime(); -} - -function setTest() { - testobj.value = 'b'; -} - -testobj.watch("value", watched); - -setTest(); - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/Regress/regress-240577.js b/js/src/tests/js1_5/Regress/regress-240577.js deleted file mode 100644 index ba8330aa0..000000000 --- a/js/src/tests/js1_5/Regress/regress-240577.js +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - * Contributor: Bob Clary - */ - -//----------------------------------------------------------------------------- -// originally reported by Jens Thiele <karme@unforgettable.com> in -var BUGNUMBER = 240577; -var summary = 'object.watch execution context'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -var createWatcher = function ( watchlabel ) -{ - var watcher = function (property, oldvalue, newvalue) - { - actual += watchlabel; return newvalue; - }; - return watcher; -}; - -var watcher1 = createWatcher('watcher1'); - -var object = {property: 'value'}; - -object.watch('property', watcher1); - -object.property = 'newvalue'; - -expect = 'watcher1'; - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/Regress/regress-355341.js b/js/src/tests/js1_5/Regress/regress-355341.js deleted file mode 100644 index ab2a4b884..000000000 --- a/js/src/tests/js1_5/Regress/regress-355341.js +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 355341; -var summary = 'Do not crash with watch and setter'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - Object.defineProperty(this, "x", { set: Function, enumerable: true, configurable: true }); - this.watch('x', function () { }); x = 3; - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/Regress/regress-355344.js b/js/src/tests/js1_5/Regress/regress-355344.js deleted file mode 100644 index 00bd39147..000000000 --- a/js/src/tests/js1_5/Regress/regress-355344.js +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 355344; -var summary = 'Exceptions thrown by watch point'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - var o = {}; - - expect = 'setter: yikes'; - - o.watch('x', function(){throw 'yikes'}); - try - { - o.x = 3; - } - catch(ex) - { - actual = "setter: " + ex; - } - - try - { - eval("") ; - } - catch(e) - { - actual = "eval: " + e; - } - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/Regress/regress-361467.js b/js/src/tests/js1_5/Regress/regress-361467.js deleted file mode 100644 index 371c0a8b5..000000000 --- a/js/src/tests/js1_5/Regress/regress-361467.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361467; -var summary = 'Do not crash with certain watchers'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = actual = 'No Crash'; - - var x; - this.watch('x', print); - x = 5; - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/Regress/regress-361617.js b/js/src/tests/js1_5/Regress/regress-361617.js deleted file mode 100644 index 5d20fd78f..000000000 --- a/js/src/tests/js1_5/Regress/regress-361617.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361617; -var summary = 'Do not crash with getter, watch and gc'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - (function() { - Object.defineProperty(this, "x", { get: function(){}, enumerable: true, configurable: true }); - })(); - this.watch('x', print); - Object.defineProperty(this, "x", { get: function(){}, enumerable: true, configurable: true }); - gc(); - this.unwatch('x'); - x; - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/Regress/regress-385393-06.js b/js/src/tests/js1_5/Regress/regress-385393-06.js deleted file mode 100644 index 327103f39..000000000 --- a/js/src/tests/js1_5/Regress/regress-385393-06.js +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -//----------------------------------------------------------------------------- -var BUGNUMBER = 385393; -var summary = 'Regression test for bug 385393'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - reportCompare(expect, actual, summary); - - true.watch("x", function(){}); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/Regress/regress-506567.js b/js/src/tests/js1_5/Regress/regress-506567.js deleted file mode 100644 index e78dfe1db..000000000 --- a/js/src/tests/js1_5/Regress/regress-506567.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 506567; -var summary = 'Do not crash with watched variables'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - if (typeof clearInterval == 'undefined') - { - clearInterval = (function () {}); - } - - var obj = new Object(); - obj.test = null; - obj.watch("test", (function(prop, oldval, newval) - { - if(false) - { - var test = newval % oldval; - var func = (function(){clearInterval(myInterval);}); - } - })); - - obj.test = 'null'; - print(obj.test); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-303277.js b/js/src/tests/js1_5/extensions/regress-303277.js deleted file mode 100644 index 319d9a2ed..000000000 --- a/js/src/tests/js1_5/extensions/regress-303277.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 303277; -var summary = 'Do not crash with crash with a watchpoint for __proto__ property '; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -var o = {}; -o.watch("__proto__", function(){return null;}); -o.__proto__ = null; - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-355339.js b/js/src/tests/js1_5/extensions/regress-355339.js deleted file mode 100644 index 9b15bd742..000000000 --- a/js/src/tests/js1_5/extensions/regress-355339.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 355339; -var summary = 'Do not assert: sprop->setter != js_watch_set'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = actual = 'No Crash'; - o = {}; - o.watch("j", function(a,b,c) { print("*",a,b,c) }); - o.unwatch("j"); - o.watch("j", function(a,b,c) { print("*",a,b,c) }); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-361346.js b/js/src/tests/js1_5/extensions/regress-361346.js deleted file mode 100644 index 297c3b1f2..000000000 --- a/js/src/tests/js1_5/extensions/regress-361346.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361346; -var summary = 'Crash with setter, watch, GC'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -expect = actual = 'No Crash'; - -Object.defineProperty(this, "x", { set: new Function, enumerable: true, configurable: true }); -this.watch('x', function(){}); -gc(); -x = {}; - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-361360.js b/js/src/tests/js1_5/extensions/regress-361360.js deleted file mode 100644 index 98e6575d9..000000000 --- a/js/src/tests/js1_5/extensions/regress-361360.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361360; -var summary = 'Do not assert: !caller || caller->pc involving setter and watch'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = actual = 'No Crash'; - - this.__defineSetter__('x', eval); - this.watch('x', function(){}); - x = 3; - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-361552.js b/js/src/tests/js1_5/extensions/regress-361552.js deleted file mode 100644 index eed54e6dd..000000000 --- a/js/src/tests/js1_5/extensions/regress-361552.js +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361552; -var summary = 'Crash with setter, watch, Script'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -expect = actual = 'No Crash'; - -if (typeof Script == 'undefined') -{ - print('Test skipped. Script not defined.'); -} -else -{ - this.__defineSetter__('x', gc); - this.watch('x', new Script('')); - x = 3; -} -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-361558.js b/js/src/tests/js1_5/extensions/regress-361558.js deleted file mode 100644 index a9a3ae725..000000000 --- a/js/src/tests/js1_5/extensions/regress-361558.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361558; -var summary = 'Do not assert: sprop->setter != js_watch_set'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -expect = actual = 'No Crash'; - -({}.__proto__.watch('x', print)); ({}.watch('x', print)); - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-361571.js b/js/src/tests/js1_5/extensions/regress-361571.js deleted file mode 100644 index bf89d794b..000000000 --- a/js/src/tests/js1_5/extensions/regress-361571.js +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361571; -var summary = 'Do not assert: fp->scopeChain == parent'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - try - { - o = {}; - o.__defineSetter__('y', eval); - o.watch('y', function () { return "";}); - o.y = 1; - } - catch(ex) - { - printStatus('Note eval can no longer be called directly'); - expect = 'EvalError: function eval must be called directly, and not by way of a function of another name'; - actual = ex + ''; - } - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-361856.js b/js/src/tests/js1_5/extensions/regress-361856.js deleted file mode 100644 index e7e2f675b..000000000 --- a/js/src/tests/js1_5/extensions/regress-361856.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361856; -var summary = 'Do not assert: overwriting @ js_AddScopeProperty'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - function testit() { - var obj = {}; - obj.watch("foo", function(){}); - delete obj.foo; - obj = null; - gc(); - } - testit(); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-361964.js b/js/src/tests/js1_5/extensions/regress-361964.js deleted file mode 100644 index fcb8bba01..000000000 --- a/js/src/tests/js1_5/extensions/regress-361964.js +++ /dev/null @@ -1,54 +0,0 @@ -// |reftest| skip -- slow, alert not dismissed, now busted by harness -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 361964; -var summary = 'Crash [@ MarkGCThingChildren] involving watch and setter'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - var doc; - if (typeof document == 'undefined') - { - doc = {}; - } - else - { - doc = document; - } - - if (typeof alert == 'undefined') - { - alert = print; - } - -// Crash: - doc.watch("title", function(a,b,c,d) { - return { toString : function() { alert(1); } }; - }); - doc.title = "xxx"; - -// No crash: - doc.watch("title", function() { - return { toString : function() { alert(1); } }; - }); - doc.title = "xxx"; - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-385134.js b/js/src/tests/js1_5/extensions/regress-385134.js deleted file mode 100644 index 041f4d6e7..000000000 --- a/js/src/tests/js1_5/extensions/regress-385134.js +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 385134; -var summary = 'Do not crash with setter, watch, uneval'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - if (typeof this.__defineSetter__ != 'undefined' && - typeof this.watch != 'undefined' && - typeof uneval != 'undefined') - { - try { - this.__defineSetter__(0, function(){}); - } catch (exc) { - // In the browser, this fails. Ignore the error. - } - this.watch(0, function(){}); - uneval(this); - } - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-385393-09.js b/js/src/tests/js1_5/extensions/regress-385393-09.js deleted file mode 100644 index 42834824a..000000000 --- a/js/src/tests/js1_5/extensions/regress-385393-09.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -//----------------------------------------------------------------------------- -var BUGNUMBER = 385393; -var summary = 'Regression test for bug 385393'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -eval("this.__defineSetter__('x', gc); this.watch('x', [].slice); x = 1;"); - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-390597.js b/js/src/tests/js1_5/extensions/regress-390597.js deleted file mode 100644 index 9f8596adc..000000000 --- a/js/src/tests/js1_5/extensions/regress-390597.js +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 390597; -var summary = 'watch point + eval-as-setter allows access to dead JSStackFrame'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - function exploit() { - try - { - var obj = this, args = null; - obj.__defineSetter__("evil", eval); - obj.watch("evil", function() { return "args = arguments;"; }); - obj.evil = null; - eval("print(args[0]);"); - } - catch(ex) - { - print('Caught ' + ex); - } - } - exploit(); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-420612.js b/js/src/tests/js1_5/extensions/regress-420612.js deleted file mode 100644 index a4491095e..000000000 --- a/js/src/tests/js1_5/extensions/regress-420612.js +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 420612; -var summary = 'Do not assert: obj == pobj'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -var obj = Object.create([]); -obj.unwatch("x"); - -if (typeof reportCompare === "function") - reportCompare(true, true); - -print("Tests complete"); diff --git a/js/src/tests/js1_5/extensions/regress-435345-01.js b/js/src/tests/js1_5/extensions/regress-435345-01.js deleted file mode 100644 index 28beab473..000000000 --- a/js/src/tests/js1_5/extensions/regress-435345-01.js +++ /dev/null @@ -1,100 +0,0 @@ -// |reftest| fails -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 435345; -var summary = 'Watch the length property of arrays'; -var actual = ''; -var expect = ''; - -// see http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Object:watch - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - var arr; - - try - { - expect = 'watcher: propname=length, oldval=0, newval=1; '; - actual = ''; - arr = []; - arr.watch('length', watcher); - arr[0] = '0'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': 1'); - - try - { - expect = 'watcher: propname=length, oldval=1, newval=2; ' + - 'watcher: propname=length, oldval=2, newval=2; '; - actual = ''; - arr.push(5); - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': 2'); - - try - { - expect = 'watcher: propname=length, oldval=2, newval=1; '; - actual = ''; - arr.pop(); - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': 3'); - - try - { - expect = 'watcher: propname=length, oldval=1, newval=2; '; - actual = ''; - arr.length++; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': 4'); - - try - { - expect = 'watcher: propname=length, oldval=2, newval=5; '; - actual = ''; - arr.length = 5; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': 5'); - - exitFunc ('test'); -} - -function watcher(propname, oldval, newval) -{ - actual += 'watcher: propname=' + propname + ', oldval=' + oldval + - ', newval=' + newval + '; '; - - return newval; -} - diff --git a/js/src/tests/js1_5/extensions/regress-454040.js b/js/src/tests/js1_5/extensions/regress-454040.js deleted file mode 100644 index 63b5e1488..000000000 --- a/js/src/tests/js1_5/extensions/regress-454040.js +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 454040; -var summary = 'Do not crash @ js_ComputeFilename'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -try -{ - this.__defineGetter__("x", Function); - this.__defineSetter__("x", Function); - this.watch("x", x.__proto__); - x = 1; -} -catch(ex) -{ -} -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-454142.js b/js/src/tests/js1_5/extensions/regress-454142.js deleted file mode 100644 index 05f331278..000000000 --- a/js/src/tests/js1_5/extensions/regress-454142.js +++ /dev/null @@ -1,30 +0,0 @@ -// |reftest| skip-if(Android) -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 454142; -var summary = 'Do not crash with gczeal, setter, watch'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -this.watch("x", function(){}); -delete x; -if (typeof gczeal == 'function') -{ - gczeal(2); -} - -this.__defineSetter__("x", function(){}); - -if (typeof gczeal == 'function') -{ - gczeal(0); -} - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-455413.js b/js/src/tests/js1_5/extensions/regress-455413.js deleted file mode 100644 index d00ab135b..000000000 --- a/js/src/tests/js1_5/extensions/regress-455413.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 455413; -var summary = 'Do not assert with JIT: (m != JSVAL_INT) || isInt32(*vp)'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -printBugNumber(BUGNUMBER); -printStatus (summary); - - -this.watch('x', Math.pow); (function() { for(var j=0;j<4;++j){x=1;} })(); - - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-465145.js b/js/src/tests/js1_5/extensions/regress-465145.js deleted file mode 100644 index 84f81703b..000000000 --- a/js/src/tests/js1_5/extensions/regress-465145.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 465145; -var summary = 'Do not crash with watched defined setter'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - - -this.__defineSetter__("x", function(){}); -this.watch("x", function(){}); -y = this; -for (var z = 0; z < 2; ++z) { x = y }; -this.__defineSetter__("x", function(){}); -for (var z = 0; z < 2; ++z) { x = y }; - - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-472787.js b/js/src/tests/js1_5/extensions/regress-472787.js deleted file mode 100755 index d3196f05f..000000000 --- a/js/src/tests/js1_5/extensions/regress-472787.js +++ /dev/null @@ -1,31 +0,0 @@ -// |reftest| skip-if(Android) -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 472787; -var summary = 'Do not hang with gczeal, watch and concat'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -this.__defineSetter__("x", Math.sin); -this.watch("x", '' .concat); - -if (typeof gczeal == 'function') -{ - gczeal(2); -} - -x = 1; - -if (typeof gczeal == 'function') -{ - gczeal(0); -} - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-488995.js b/js/src/tests/js1_5/extensions/regress-488995.js deleted file mode 100644 index f7abbe439..000000000 --- a/js/src/tests/js1_5/extensions/regress-488995.js +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 488995; -var summary = 'Do not crash with watch, __defineSetter__ on svg'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - if (typeof document == 'undefined') - { - print('Test skipped: requires browser.'); - } - else - { - try - { - var o=document.createElementNS("http://www.w3.org/2000/svg", "svg"); - var p=o.y; - p.watch('animVal', function(id, oldvar, newval) {} ); - p.type='xxx'; - p.__defineSetter__('animVal', function() {}); - p.animVal=0; - } - catch(ex) - { - } - } - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_6/Regress/regress-476655.js b/js/src/tests/js1_6/Regress/regress-476655.js deleted file mode 100644 index 9077ba3a0..000000000 --- a/js/src/tests/js1_6/Regress/regress-476655.js +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 476655; -var summary = 'TM: Do not assert: count <= (size_t) (fp->regs->sp - StackBase(fp) - depth)'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - - try - { - eval( - "(function (){ for (var y in this) {} })();" + - "[''.watch(\"\", function(){}) for each (x in ['', '', eval, '', '']) if " + - "(x)].map(Function)" - ); - } - catch(ex) - { - } - - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_6/extensions/regress-457521.js b/js/src/tests/js1_6/extensions/regress-457521.js deleted file mode 100644 index 6f4fbda50..000000000 --- a/js/src/tests/js1_6/extensions/regress-457521.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 457521; -var summary = 'Do not crash @ js_DecompileValueGenerator'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -try -{ - this.__defineSetter__("x", [,,,].map); - this.watch("x", (new Function("var y, eval"))); - x = true; -} -catch(ex) -{ -} -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_6/extensions/regress-479567.js b/js/src/tests/js1_6/extensions/regress-479567.js deleted file mode 100644 index 6f3525130..000000000 --- a/js/src/tests/js1_6/extensions/regress-479567.js +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 479567; -var summary = 'Do not assert: thing'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - - -function f() -{ - (eval("(function(){for each (y in [false, false, false]);});"))(); -} - -try -{ - this.__defineGetter__("x", gc); - uneval(this.watch("y", this.toSource)) - f(); - throw x; -} -catch(ex) -{ -} - - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_7/extensions/regress-453955.js b/js/src/tests/js1_7/extensions/regress-453955.js deleted file mode 100644 index 454f712f3..000000000 --- a/js/src/tests/js1_7/extensions/regress-453955.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 453955; -var summary = 'Do not assert: sprop->setter != js_watch_set || pobj != obj'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var z = 0; z < 2; ++z) - { - [].filter.watch("9", function(y) { yield y; }); - } - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_7/extensions/regress-473282.js b/js/src/tests/js1_7/extensions/regress-473282.js deleted file mode 100644 index c50ac9234..000000000 --- a/js/src/tests/js1_7/extensions/regress-473282.js +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 473282; -var summary = 'Do not assert: thing'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -this.watch("b", "".substring); -this.__defineGetter__("a", gc); -for each (b in [this, null, null]); -a; - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_7/regress/regress-385133-01.js b/js/src/tests/js1_7/regress/regress-385133-01.js deleted file mode 100644 index 03b09f535..000000000 --- a/js/src/tests/js1_7/regress/regress-385133-01.js +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 385133; -var summary = 'Do not crash due to recursion with watch, setter, delete, generator'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - try - { - Object.defineProperty(this, "x", { set: {}.watch, enumerable: true, configurable: true }); - this.watch('x', 'foo'.split); - delete x; - function g(){ x = 1; yield; } - for (i in g()) { } - } - catch(ex) - { - } - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_8/extensions/regress-394709.js b/js/src/tests/js1_8/extensions/regress-394709.js deleted file mode 100644 index d04d8832f..000000000 --- a/js/src/tests/js1_8/extensions/regress-394709.js +++ /dev/null @@ -1,51 +0,0 @@ -// |reftest| skip-if(!xulRuntime.shell) -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 394709; -var summary = 'Do not leak with object.watch and closure'; -var actual = 'No Leak'; -var expect = 'No Leak'; - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - assertEq(finalizeCount(), 0, "invalid initial state"); - - runtest(); - gc(); - assertEq(finalizeCount(), 1, "leaked"); - - runtest(); - gc(); - assertEq(finalizeCount(), 2, "leaked"); - - runtest(); - gc(); - assertEq(finalizeCount(), 3, "leaked"); - - - function runtest () { - var obj = { b: makeFinalizeObserver() }; - obj.watch('b', watcher); - - function watcher(id, old, value) { - ++obj.n; - return value; - } - } - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_8/extensions/regress-481989.js b/js/src/tests/js1_8/extensions/regress-481989.js deleted file mode 100644 index 36efb7567..000000000 --- a/js/src/tests/js1_8/extensions/regress-481989.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 481989; -var summary = 'TM: Do not assert: SPROP_HAS_STUB_SETTER(sprop)'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - - -y = this.watch("x", function(){}); for each (let y in ['', '']) x = y; - - -reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_8_1/extensions/regress-452498-193.js b/js/src/tests/js1_8_1/extensions/regress-452498-193.js deleted file mode 100644 index 1397bf4bb..000000000 --- a/js/src/tests/js1_8_1/extensions/regress-452498-193.js +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 452498; -var summary = 'TM: upvar2 regression tests'; -var actual = ''; -var expect = ''; - -//------- Comment #193 From Gary Kwong - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - -// Assertion failure: afunbox->parent, at ../jsparse.cpp:1912 - - this.x = undefined; - this.watch("x", Function); - NaN = uneval({ get \u3056 (){ return undefined } }); - x+=NaN; - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_8_1/extensions/regress-452498-196.js b/js/src/tests/js1_8_1/extensions/regress-452498-196.js index 69d5a3586..5b9191199 100644 --- a/js/src/tests/js1_8_1/extensions/regress-452498-196.js +++ b/js/src/tests/js1_8_1/extensions/regress-452498-196.js @@ -21,15 +21,6 @@ function test() printBugNumber(BUGNUMBER); printStatus (summary); -// Assertion failure: localKind == JSLOCAL_VAR || localKind == JSLOCAL_CONST, at ../jsfun.cpp:916 - - this.x = undefined; - this.watch("x", Function); - NaN = uneval({ get \u3056 (){ return undefined } }); - x+=NaN; - - reportCompare(expect, actual, summary + ': 1'); - // Assertion failure: lexdep->isLet(), at ../jsparse.cpp:1900 (function (){ diff --git a/js/src/tests/js1_8_1/extensions/regress-520572.js b/js/src/tests/js1_8_1/extensions/regress-520572.js deleted file mode 100644 index 97f00029a..000000000 --- a/js/src/tests/js1_8_1/extensions/regress-520572.js +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - * Contributor: Blake Kaplan - */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 520572; -var summary = 'watch should innerize the object being watched'; -var actual = 0; -var expect = 2; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - if ("evalcx" in this) { - // shell - let s = evalcx("lazy"); - s.n = 0; - evalcx('this.watch("x", function(){ n++; }); this.x = 4; x = 6', s); - actual = s.n; - reportCompare(expect, actual, summary); - } else { - // browser - this.watch('x', function(){ actual++; }); - this.x = 4; - x = 6; - reportCompare(expect, actual, summary); - } - - exitFunc ('test'); -} diff --git a/js/src/tests/js1_8_1/regress/regress-452498-160.js b/js/src/tests/js1_8_1/regress/regress-452498-160.js index 6498a0b5a..305b41795 100644 --- a/js/src/tests/js1_8_1/regress/regress-452498-160.js +++ b/js/src/tests/js1_8_1/regress/regress-452498-160.js @@ -21,11 +21,6 @@ function test() printBugNumber(BUGNUMBER); printStatus (summary); -// crash [@ js_Interpret] - (eval("(function(){ this.watch(\"x\", function () { new function ()y } ); const y = undefined });"))(); - x = NaN; - reportCompare(expect, actual, summary + ': 2'); - // Assertion failure: JOF_OPTYPE(op) == JOF_ATOM, at ../jsemit.cpp:5916 ({ set z(v){}, set y(v)--x, set w(v)--w }); reportCompare(expect, actual, summary + ': 3'); diff --git a/js/src/tests/js1_8_5/extensions/regress-604781-1.js b/js/src/tests/js1_8_5/extensions/regress-604781-1.js deleted file mode 100644 index a7c43f95d..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-604781-1.js +++ /dev/null @@ -1,24 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var watcherCount, setterCount; -function watcher(id, oldval, newval) { watcherCount++; return newval; } -function setter(newval) { setterCount++; } - -var p = { set x(v) { setter(v); } }; -p.watch('x', watcher); - -watcherCount = setterCount = 0; -p.x = 2; -assertEq(setterCount, 1); -assertEq(watcherCount, 1); - -var o = Object.defineProperty({}, 'x', { set:setter, enumerable:true, configurable:true }); -o.watch('x', watcher); - -watcherCount = setterCount = 0; -o.x = 2; -assertEq(setterCount, 1); -assertEq(watcherCount, 1); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-604781-2.js b/js/src/tests/js1_8_5/extensions/regress-604781-2.js deleted file mode 100644 index 7aba4a274..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-604781-2.js +++ /dev/null @@ -1,13 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var log; -function watcher(id, old, newval) { log += 'watcher'; return newval; } -var o = { set x(v) { log += 'setter'; } }; -o.watch('x', watcher); -Object.defineProperty(o, 'x', {value: 3, writable: true}); -log = ''; -o.x = 3; -assertEq(log, 'watcher'); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-1.js b/js/src/tests/js1_8_5/extensions/regress-627984-1.js deleted file mode 100644 index a3726630a..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// See bug 627984, comment 17, item 1. -var obj; -var methods = []; -for (var i = 0; i < 2; i++) { - obj = {m: function () { return this.x; }}; - obj.watch("m", function (id, oldval, newval) { methods[i] = oldval; }); - obj.m = 0; -} -assertEq(typeof methods[0], "function"); -assertEq(typeof methods[1], "function"); -assertEq(methods[0] !== methods[1], true); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-2.js b/js/src/tests/js1_8_5/extensions/regress-627984-2.js deleted file mode 100644 index c4f1b508c..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-2.js +++ /dev/null @@ -1,15 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// See bug 627984, comment 17, item 2. -var obj = {}; -var x; -obj.watch("m", function (id, oldval, newval) { - x = this.m; - return newval; - }); -delete obj.m; -obj.m = function () { return this.method; }; -obj.m = 2; - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-3.js b/js/src/tests/js1_8_5/extensions/regress-627984-3.js deleted file mode 100644 index cbe4e10fa..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-3.js +++ /dev/null @@ -1,14 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// Don't write string value to method slot. -// See bug 627984, comment 17, item 2. -var obj = {}; -obj.watch("m", function (id, oldval, newval) { - return 'ok'; - }); -delete obj.m; -obj.m = function () { return this.x; }; -assertEq(obj.m, 'ok'); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-4.js b/js/src/tests/js1_8_5/extensions/regress-627984-4.js deleted file mode 100644 index bbc017ffb..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-4.js +++ /dev/null @@ -1,15 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// See bug 627984, comment 17, item 3. -var obj = {}; -obj.watch("m", function (id, oldval, newval) { - delete obj.m; - obj.m = function () {}; - return newval; - }); -delete obj.m; -obj.m = 1; -assertEq(obj.m, 1); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-5.js b/js/src/tests/js1_8_5/extensions/regress-627984-5.js deleted file mode 100644 index 704d8421c..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-5.js +++ /dev/null @@ -1,13 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// Bug 627984 comment 11. -var o = ({}); -o.p = function() {}; -o.watch('p', function() { }); -o.q = function() {} -delete o.p; -o.p = function() {}; -assertEq(o.p, void 0); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-6.js b/js/src/tests/js1_8_5/extensions/regress-627984-6.js deleted file mode 100644 index cb1a0fca9..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-6.js +++ /dev/null @@ -1,15 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// Bug 627984 description. -var o = Array; -o.p = function() {}; -o.watch('p', function() { }); -for(var x in o) { - o[x]; -} -delete o.p; -o.p = function() {}; -assertEq(o.p, void 0); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-627984-7.js b/js/src/tests/js1_8_5/extensions/regress-627984-7.js deleted file mode 100644 index b13a0e912..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-627984-7.js +++ /dev/null @@ -1,9 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -// See bug 627984 comment 20. -var obj = {m: function () {}}; -obj.watch("m", function () { throw 'FAIL'; }); -var f = obj.m; // don't call the watchpoint - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-631723.js b/js/src/tests/js1_8_5/extensions/regress-631723.js deleted file mode 100644 index f7c755603..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-631723.js +++ /dev/null @@ -1,10 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var o = {a:1, b:2}; -o.watch("p", function() { return 13; }); -delete o.p; -o.p = 0; -assertEq(o.p, 13); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-636697.js b/js/src/tests/js1_8_5/extensions/regress-636697.js deleted file mode 100644 index 6b3b1de37..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-636697.js +++ /dev/null @@ -1,11 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var a = {set p(x) {}}; -a.watch('p', function () {}); -var b = Object.create(a); -b.watch('p', function () {}); -delete b.p; -b.p = 0; - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/regress-637985.js b/js/src/tests/js1_8_5/extensions/regress-637985.js deleted file mode 100644 index 305bfc820..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-637985.js +++ /dev/null @@ -1,8 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var obj = {}; -obj.watch(-1, function(){}); -obj.unwatch("-1"); // don't assert - -reportCompare(0, 0, 'ok');
\ No newline at end of file diff --git a/js/src/tests/js1_8_5/extensions/regress-691746.js b/js/src/tests/js1_8_5/extensions/regress-691746.js deleted file mode 100644 index 26f732d07..000000000 --- a/js/src/tests/js1_8_5/extensions/regress-691746.js +++ /dev/null @@ -1,11 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var obj = {}; -try { - obj.watch(QName(), function () {}); -} catch (exc) { -} -gc(); - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/extensions/watch-undefined-setter.js b/js/src/tests/js1_8_5/extensions/watch-undefined-setter.js deleted file mode 100644 index 92608de0e..000000000 --- a/js/src/tests/js1_8_5/extensions/watch-undefined-setter.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - * Contributor: - * Gary Kwong - */ - -var gTestfile = 'watch-undefined-setter.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 560277; -var summary = - 'Crash [@ JSObject::getParent] or [@ js_WrapWatchedSetter] or ' + - '[@ js_GetClassPrototype]'; - -this.watch("x", function() { }); -Object.defineProperty(this, "x", { set: undefined, configurable: true }); - -reportCompare(true, true); diff --git a/js/src/tests/js1_8_5/regress/regress-533876.js b/js/src/tests/js1_8_5/regress/regress-533876.js deleted file mode 100644 index e44bc8a4f..000000000 --- a/js/src/tests/js1_8_5/regress/regress-533876.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - * Contributors: Gary Kwong and Jason Orendorff - */ - -var savedEval = eval; -var x = [0]; -eval(); - -x.__proto__ = this; // x has non-dictionary scope -try { - DIE; -} catch(e) { -} - -delete eval; // force dictionary scope for global -gc(); -eval = savedEval; -var f = eval("(function () { return /x/; })"); -x.watch('x', f); // clone property from global to x, including SPROP_IN_DICTIONARY flag - -reportCompare("ok", "ok", "bug 533876"); diff --git a/js/src/tests/js1_8_5/regress/regress-548276.js b/js/src/tests/js1_8_5/regress/regress-548276.js deleted file mode 100644 index 5e306eba1..000000000 --- a/js/src/tests/js1_8_5/regress/regress-548276.js +++ /dev/null @@ -1,10 +0,0 @@ -// |reftest| skip -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - * Contributors: Gary Kwong and Jason Orendorff - */ -var obj = {}; -obj.__defineSetter__("x", function() {}); -obj.watch("x", function() {}); -obj.__defineSetter__("x", /a/); diff --git a/js/src/tests/js1_8_5/regress/regress-584648.js b/js/src/tests/js1_8_5/regress/regress-584648.js deleted file mode 100644 index a1635ea51..000000000 --- a/js/src/tests/js1_8_5/regress/regress-584648.js +++ /dev/null @@ -1,16 +0,0 @@ -// |reftest| skip -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ -// Contributors: Gary Kwong <gary@rumblingedge.com> -// Jason Orendorff <jorendorff@mozilla.com> - -// on a non-global object -var x = {}; -x.watch("p", function () { evalcx(''); }); -x.p = 0; - -// on the global -watch("e", (function () { evalcx(''); })); -e = function () {}; - -reportCompare(0, 0, "ok"); diff --git a/js/src/tests/js1_8_5/regress/regress-635195.js b/js/src/tests/js1_8_5/regress/regress-635195.js deleted file mode 100644 index 89980b05a..000000000 --- a/js/src/tests/js1_8_5/regress/regress-635195.js +++ /dev/null @@ -1,8 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var obj = {set x(v) {}}; -obj.watch("x", function() { delete obj.x; }); -obj.x = "hi"; // don't assert - -reportCompare(0, 0, 'ok'); diff --git a/js/src/tests/js1_8_5/regress/regress-636394.js b/js/src/tests/js1_8_5/regress/regress-636394.js deleted file mode 100644 index d1a249786..000000000 --- a/js/src/tests/js1_8_5/regress/regress-636394.js +++ /dev/null @@ -1,10 +0,0 @@ -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -var a = {p0: function () {}}; -var b = /f/; -b.__proto__ = a; -b.watch("p0", function () {}); -b.p0; - -reportCompare(0, 0, "ok"); diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp index a5aac2ab4..3680c5b7b 100644 --- a/js/src/vm/EnvironmentObject.cpp +++ b/js/src/vm/EnvironmentObject.cpp @@ -408,7 +408,6 @@ const ObjectOps ModuleEnvironmentObject::objectOps_ = { ModuleEnvironmentObject::setProperty, ModuleEnvironmentObject::getOwnPropertyDescriptor, ModuleEnvironmentObject::deleteProperty, - nullptr, nullptr, /* watch/unwatch */ nullptr, /* getElements */ ModuleEnvironmentObject::enumerate, nullptr @@ -790,7 +789,6 @@ static const ObjectOps WithEnvironmentObjectOps = { with_SetProperty, with_GetOwnPropertyDescriptor, with_DeleteProperty, - nullptr, nullptr, /* watch/unwatch */ nullptr, /* getElements */ nullptr, /* enumerate (native enumeration of target doesn't work) */ nullptr, @@ -1159,7 +1157,6 @@ static const ObjectOps RuntimeLexicalErrorObjectObjectOps = { lexicalError_SetProperty, lexicalError_GetOwnPropertyDescriptor, lexicalError_DeleteProperty, - nullptr, nullptr, /* watch/unwatch */ nullptr, /* getElements */ nullptr, /* enumerate (native enumeration of target doesn't work) */ nullptr, /* this */ diff --git a/js/src/vm/NativeObject-inl.h b/js/src/vm/NativeObject-inl.h index e55e3db04..030d92c12 100644 --- a/js/src/vm/NativeObject-inl.h +++ b/js/src/vm/NativeObject-inl.h @@ -158,11 +158,11 @@ NativeObject::extendDenseElements(ExclusiveContext* cx, MOZ_ASSERT(!denseElementsAreFrozen()); /* - * Don't grow elements for non-extensible objects or watched objects. Dense - * elements can be added/written with no extensible or watchpoint checks as - * long as there is capacity for them. + * Don't grow elements for non-extensible objects. Dense elements can be + * added/written with no extensible checks as long as there is capacity + * for them. */ - if (!nonProxyIsExtensible() || watched()) { + if (!nonProxyIsExtensible()) { MOZ_ASSERT(getDenseCapacity() == 0); return DenseElementResult::Incomplete; } diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp index da0f59fe2..d801fad06 100644 --- a/js/src/vm/NativeObject.cpp +++ b/js/src/vm/NativeObject.cpp @@ -9,8 +9,6 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/Casting.h" -#include "jswatchpoint.h" - #include "gc/Marking.h" #include "js/Value.h" #include "vm/Debugger.h" @@ -602,7 +600,7 @@ NativeObject::maybeDensifySparseElements(js::ExclusiveContext* cx, HandleNativeO return DenseElementResult::Incomplete; /* Watch for conditions under which an object's elements cannot be dense. */ - if (!obj->nonProxyIsExtensible() || obj->watched()) + if (!obj->nonProxyIsExtensible()) return DenseElementResult::Incomplete; /* @@ -2410,17 +2408,9 @@ SetExistingProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleVa } bool -js::NativeSetProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleValue value, +js::NativeSetProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleValue v, HandleValue receiver, QualifiedBool qualified, ObjectOpResult& result) { - // Fire watchpoints, if any. - RootedValue v(cx, value); - if (MOZ_UNLIKELY(obj->watched())) { - WatchpointMap* wpmap = cx->compartment()->watchpointMap; - if (wpmap && !wpmap->triggerWatchpoint(cx, obj, id, &v)) - return false; - } - // Step numbers below reference ES6 rev 27 9.1.9, the [[Set]] internal // method for ordinary objects. We substitute our own names for these names // used in the spec: O -> pobj, P -> id, ownDesc -> shape. diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp index 5fc8e0e17..284a4f3d7 100644 --- a/js/src/vm/Runtime.cpp +++ b/js/src/vm/Runtime.cpp @@ -34,7 +34,6 @@ #include "jsnativestack.h" #include "jsobj.h" #include "jsscript.h" -#include "jswatchpoint.h" #include "jswin.h" #include "jswrapper.h" diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index fd6d843e0..85bc044a5 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -387,7 +387,7 @@ class BaseShape : public gc::TenuredCell INDEXED = 0x20, /* (0x40 is unused) */ HAD_ELEMENTS_ACCESS = 0x80, - WATCHED = 0x100, + /* (0x100 is unused) */ ITERATED_SINGLETON = 0x200, NEW_GROUP_UNKNOWN = 0x400, UNCACHEABLE_PROTO = 0x800, diff --git a/js/src/vm/Time.cpp b/js/src/vm/Time.cpp index 87531c148..a9a5b7f0f 100644 --- a/js/src/vm/Time.cpp +++ b/js/src/vm/Time.cpp @@ -11,6 +11,10 @@ #include "mozilla/DebugOnly.h" #include "mozilla/MathAlgorithms.h" +#ifdef XP_SOLARIS +#define _REENTRANT 1 +#endif + #include <string.h> #include <time.h> @@ -30,6 +34,10 @@ #ifdef XP_UNIX +#ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */ +extern int gettimeofday(struct timeval* tv); +#endif + #include <sys/time.h> #endif /* XP_UNIX */ @@ -42,7 +50,11 @@ PRMJ_Now() { struct timeval tv; +#ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */ + gettimeofday(&tv); +#else gettimeofday(&tv, 0); +#endif /* _SVID_GETTOD */ return int64_t(tv.tv_sec) * PRMJ_USEC_PER_SEC + int64_t(tv.tv_usec); } diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp index 7c2c0194e..2b1fa0e3b 100644 --- a/js/src/vm/TypeInference.cpp +++ b/js/src/vm/TypeInference.cpp @@ -2670,14 +2670,6 @@ ObjectGroup::updateNewPropertyTypes(ExclusiveContext* cx, JSObject* objArg, jsid if (shape) UpdatePropertyType(cx, types, obj, shape, false); } - - if (obj->watched()) { - /* - * Mark the property as non-data, to inhibit optimizations on it - * and avoid bypassing the watchpoint handler. - */ - types->setNonDataProperty(cx); - } } void @@ -3084,29 +3076,39 @@ class TypeConstraintClearDefiniteGetterSetter : public TypeConstraint }; bool -js::AddClearDefiniteGetterSetterForPrototypeChain(JSContext* cx, ObjectGroup* group, HandleId id) +js::AddClearDefiniteGetterSetterForPrototypeChain(JSContext* cx, + DPAConstraintInfo& constraintInfo, + ObjectGroup* group, + HandleId id, + bool* added) { /* * Ensure that if the properties named here could have a getter, setter or * a permanent property in any transitive prototype, the definite * properties get cleared from the group. */ + + *added = false; + RootedObject proto(cx, group->proto().toObjectOrNull()); while (proto) { ObjectGroup* protoGroup = JSObject::getGroup(cx, proto); if (!protoGroup) { - cx->recoverFromOutOfMemory(); return false; } if (protoGroup->unknownProperties()) - return false; + return true; HeapTypeSet* protoTypes = protoGroup->getProperty(cx, proto, id); - if (!protoTypes || protoTypes->nonDataProperty() || protoTypes->nonWritableProperty()) + if (!protoTypes) return false; - if (!protoTypes->addConstraint(cx, cx->typeLifoAlloc().new_<TypeConstraintClearDefiniteGetterSetter>(group))) + if (protoTypes->nonDataProperty() || protoTypes->nonWritableProperty()) + return true; + if (!constraintInfo.addProtoConstraint(proto, id)) return false; proto = proto->staticPrototype(); } + + *added = true; return true; } @@ -3612,6 +3614,43 @@ struct DestroyTypeNewScript } // namespace +bool DPAConstraintInfo::finishConstraints(JSContext* cx, ObjectGroup* group) { + for (const ProtoConstraint& constraint : protoConstraints_) { + ObjectGroup* protoGroup = constraint.proto->group(); + + // Note: we rely on the group's type information being unchanged since + // AddClearDefiniteGetterSetterForPrototypeChain. + + bool unknownProperties = protoGroup->unknownProperties(); + MOZ_RELEASE_ASSERT(!unknownProperties); + + HeapTypeSet* protoTypes = + protoGroup->getProperty(cx, constraint.proto, constraint.id); + MOZ_RELEASE_ASSERT(protoTypes); + + MOZ_ASSERT(!protoTypes->nonDataProperty()); + MOZ_ASSERT(!protoTypes->nonWritableProperty()); + + if (!protoTypes->addConstraint( + cx, + cx->typeLifoAlloc().new_<TypeConstraintClearDefiniteGetterSetter>( + group))) { + ReportOutOfMemory(cx); + return false; + } + } + + for (const InliningConstraint& constraint : inliningConstraints_) { + if (!AddClearDefiniteFunctionUsesInScript(cx, group, constraint.caller, + constraint.callee)) { + ReportOutOfMemory(cx); + return false; + } + } + + return true; +} + bool TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate, bool force) { @@ -3715,10 +3754,17 @@ TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate, return false; Vector<Initializer> initializerVector(cx); + + DPAConstraintInfo constraintInfo(cx); RootedPlainObject templateRoot(cx, templateObject()); RootedFunction fun(cx, function()); - if (!jit::AnalyzeNewScriptDefiniteProperties(cx, fun, group, templateRoot, &initializerVector)) + if (!jit::AnalyzeNewScriptDefiniteProperties(cx, + constraintInfo, + fun, + group, + templateRoot, + &initializerVector)) return false; if (!group->newScript()) @@ -3772,6 +3818,14 @@ TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate, // The definite properties analysis found exactly the properties that // are held in common by the preliminary objects. No further analysis // is needed. + + if (!constraintInfo.finishConstraints(cx, group)) { + return false; + } + if (!group->newScript()) { + return true; + } + group->addDefiniteProperties(cx, templateObject()->lastProperty()); destroyNewScript.group = nullptr; @@ -3793,6 +3847,16 @@ TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate, if (!initialGroup) return false; + // Add the constraints. Use the initialGroup as group referenced by the + // constraints because that's the group that will have the TypeNewScript + // associated with it. See the detachNewScript and setNewScript calls below. + if (!constraintInfo.finishConstraints(cx, initialGroup)) { + return false; + } + if (!group->newScript()) { + return true; + } + initialGroup->addDefiniteProperties(cx, templateObject()->lastProperty()); group->addDefiniteProperties(cx, prefixShape); diff --git a/js/src/vm/TypeInference.h b/js/src/vm/TypeInference.h index 94ce7e871..fd021fc96 100644 --- a/js/src/vm/TypeInference.h +++ b/js/src/vm/TypeInference.h @@ -789,8 +789,65 @@ class TemporaryTypeSet : public TypeSet TypedArraySharedness* sharedness); }; +// Stack class to record information about constraints that need to be added +// after finishing the Definite Properties Analysis. When the analysis succeeds, +// the |finishConstraints| method must be called to add the constraints to the +// TypeSets. +// +// There are two constraint types managed here: +// +// 1. Proto constraints for HeapTypeSets, to guard against things like getters +// and setters on the proto chain. +// +// 2. Inlining constraints for StackTypeSets, to invalidate when additional +// functions could be called at call sites where we inlined a function. +// +// This class uses bare GC-thing pointers because GC is suppressed when the +// analysis runs. +class MOZ_RAII DPAConstraintInfo { + struct ProtoConstraint { + JSObject* proto; + jsid id; + ProtoConstraint(JSObject* proto, jsid id) : proto(proto), id(id) {} + }; + struct InliningConstraint { + JSScript* caller; + JSScript* callee; + InliningConstraint(JSScript* caller, JSScript* callee) + : caller(caller), callee(callee) {} + }; + + JS::AutoCheckCannotGC nogc_; + Vector<ProtoConstraint, 8> protoConstraints_; + Vector<InliningConstraint, 4> inliningConstraints_; + +public: + explicit DPAConstraintInfo(JSContext* cx) + : nogc_(cx) + , protoConstraints_(cx) + , inliningConstraints_(cx) + { + } + + DPAConstraintInfo(const DPAConstraintInfo&) = delete; + void operator=(const DPAConstraintInfo&) = delete; + + MOZ_MUST_USE bool addProtoConstraint(JSObject* proto, jsid id) { + return protoConstraints_.emplaceBack(proto, id); + } + MOZ_MUST_USE bool addInliningConstraint(JSScript* caller, JSScript* callee) { + return inliningConstraints_.emplaceBack(caller, callee); + } + + MOZ_MUST_USE bool finishConstraints(JSContext* cx, ObjectGroup* group); +}; + bool -AddClearDefiniteGetterSetterForPrototypeChain(JSContext* cx, ObjectGroup* group, HandleId id); +AddClearDefiniteGetterSetterForPrototypeChain(JSContext* cx, + DPAConstraintInfo& constraintInfo, + ObjectGroup* group, + HandleId id, + bool* added); bool AddClearDefiniteFunctionUsesInScript(JSContext* cx, ObjectGroup* group, diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp index c4733cc96..21093ca9a 100644 --- a/js/src/wasm/WasmSignalHandlers.cpp +++ b/js/src/wasm/WasmSignalHandlers.cpp @@ -130,11 +130,16 @@ class AutoSetHandlingSegFault # define EPC_sig(p) ((p)->sc_pc) # define RFP_sig(p) ((p)->sc_regs[30]) # endif -#elif defined(__linux__) +#elif defined(__linux__) || defined(__sun) # if defined(__linux__) # define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i]) # define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP]) -# else +# else // defined(__sun) +/* See https://www.illumos.org/issues/5876. They keep arguing over whether + * <ucontext.h> should provide the register index defines in regset.h or + * require applications to request them specifically, and we need them here. */ +#include <ucontext.h> +#include <sys/regset.h> # define XMM_sig(p,i) ((p)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[i]) # define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_PC]) # endif diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index 4ddc8deb3..abe50f449 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -644,6 +644,7 @@ env_setProperty(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue ObjectOpResult& result) { /* XXX porting may be easy, but these don't seem to supply setenv by default */ +#if !defined XP_SOLARIS RootedString valstr(cx); RootedString idstr(cx); int rv; @@ -686,6 +687,7 @@ env_setProperty(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue return false; } vp.setString(valstr); +#endif /* !defined XP_SOLARIS */ return result.succeed(); } diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 12b203b70..08ba8241a 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -924,8 +924,6 @@ const js::ObjectOps XPC_WN_ObjectOpsWithEnumerate = { nullptr, // setProperty nullptr, // getOwnPropertyDescriptor nullptr, // deleteProperty - nullptr, // watch - nullptr, // unwatch nullptr, // getElements XPC_WN_JSOp_Enumerate, nullptr, // funToString diff --git a/js/xpconnect/src/moz.build b/js/xpconnect/src/moz.build index 7d9cd5b37..29cfc4776 100644 --- a/js/xpconnect/src/moz.build +++ b/js/xpconnect/src/moz.build @@ -66,4 +66,4 @@ LOCAL_INCLUDES += [ ] if CONFIG['GNU_CXX']: - CXXFLAGS += ['-Wno-shadow', '-Werror=format'] + CXXFLAGS += ['-Wno-shadow'] diff --git a/js/xpconnect/tests/chrome/chrome.ini b/js/xpconnect/tests/chrome/chrome.ini index 5a7b98214..d89c89b54 100644 --- a/js/xpconnect/tests/chrome/chrome.ini +++ b/js/xpconnect/tests/chrome/chrome.ini @@ -106,7 +106,6 @@ skip-if = os == 'win' || os == 'mac' # bug 1131110 [test_precisegc.xul] [test_sandboxImport.xul] [test_scriptSettings.xul] -[test_watchpoints.xul] [test_weakmap_keys_preserved.xul] [test_weakmap_keys_preserved2.xul] [test_weakmaps.xul] diff --git a/js/xpconnect/tests/chrome/test_watchpoints.xul b/js/xpconnect/tests/chrome/test_watchpoints.xul deleted file mode 100644 index 2262b1a90..000000000 --- a/js/xpconnect/tests/chrome/test_watchpoints.xul +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/css" href="chrome://global/skin"?> -<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=693527 ---> -<window title="Mozilla Bug " - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> - - <!-- test results are displayed in the html:body --> - <body xmlns="http://www.w3.org/1999/xhtml"> - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=" - target="_blank">Mozilla Bug 693527</a> - </body> - - <!-- test code goes here --> - <script type="application/javascript"> - <![CDATA[ - /** Test for Bug 693527 **/ - - let Cu = Components.utils; - let Ci = Components.interfaces; - - /* Create a weak reference, with a single-element weak map. */ - let make_weak_ref = function (obj) { - let m = new WeakMap; - m.set(obj, {}); - return m; - }; - - /* Check to see if a weak reference is dead. */ - let weak_ref_dead = function (r) { - return ThreadSafeChromeUtils.nondeterministicGetWeakMapKeys(r).length == 0; - } - - - let make_cycle = function () { - var p = document.createElement("p"); - p.children.x = p; - var f = function() { }; - p.watch("y", f); - var d = document.createElement("div"); - d.appendChild(p); - f.loop = d; - f.bar = {}; // observing f directly makes the leak go away even without the CC somehow - return make_weak_ref(f.bar); - }; - - var cycle_ref = make_cycle(); - - - /* set up for running precise GC/CC then checking the results */ - - SimpleTest.waitForExplicitFinish(); - - Cu.schedulePreciseGC(function () { - window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .cycleCollect(); - window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .garbageCollect(); - window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .garbageCollect(); - - ok(weak_ref_dead(cycle_ref), "Garbage gray watchpoint cycle should be collected."); - - SimpleTest.finish(); - }); - - ]]> - </script> -</window> diff --git a/js/xpconnect/tests/chrome/test_xrayToJS.xul b/js/xpconnect/tests/chrome/test_xrayToJS.xul index 73de267a1..495b99607 100644 --- a/js/xpconnect/tests/chrome/test_xrayToJS.xul +++ b/js/xpconnect/tests/chrome/test_xrayToJS.xul @@ -182,8 +182,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681 "toGMTString", Symbol.toPrimitive]; gConstructorProperties['Date'] = constructorProps(["UTC", "parse", "now"]); gPrototypeProperties['Object'] = - ["constructor", "toSource", "toString", "toLocaleString", "valueOf", "watch", - "unwatch", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", + ["constructor", "toSource", "toString", "toLocaleString", "valueOf", + "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__"]; gConstructorProperties['Object'] = diff --git a/layout/base/LayoutConstants.h b/layout/base/LayoutConstants.h new file mode 100644 index 000000000..cd6e1c3f5 --- /dev/null +++ b/layout/base/LayoutConstants.h @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* constants used throughout the Layout module */ + +#ifndef LayoutConstants_h___ +#define LayoutConstants_h___ + +#include "nsSize.h" // for NS_MAXSIZE + +/** + * Constant used to indicate an unconstrained size. + */ +#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE + +// NOTE: There are assumptions all over that these have the same value, +// namely NS_UNCONSTRAINEDSIZE. +#define NS_INTRINSICSIZE NS_UNCONSTRAINEDSIZE +#define NS_AUTOHEIGHT NS_UNCONSTRAINEDSIZE +#define NS_AUTOOFFSET NS_UNCONSTRAINEDSIZE + +// +1 is to avoid clamped huge margin values being processed as auto margins +#define NS_AUTOMARGIN (NS_UNCONSTRAINEDSIZE + 1) + +#define NS_INTRINSIC_WIDTH_UNKNOWN nscoord_MIN + + +#endif // LayoutConstants_h___ diff --git a/layout/base/RestyleManagerBase.cpp b/layout/base/RestyleManagerBase.cpp index 6770f9464..6ef048a19 100644 --- a/layout/base/RestyleManagerBase.cpp +++ b/layout/base/RestyleManagerBase.cpp @@ -474,15 +474,6 @@ RecomputePosition(nsIFrame* aFrame) if (display->IsRelativelyPositionedStyle()) { // Move the frame if (display->mPosition == NS_STYLE_POSITION_STICKY) { - if (display->IsInnerTableStyle()) { - // We don't currently support sticky positioning of inner table - // elements (bug 975644). Bail. - // - // When this is fixed, remove the null-check for the computed - // offsets in nsTableRowFrame::ReflowChildren. - return true; - } - // Update sticky positioning for an entire element at once, starting with // the first continuation or ib-split sibling. // It's rare that the frame we already have isn't already the first diff --git a/layout/base/moz.build b/layout/base/moz.build index 4308a6e4d..afc683665 100644 --- a/layout/base/moz.build +++ b/layout/base/moz.build @@ -13,6 +13,9 @@ with Files('Display*'): with Files('FrameLayerBuilder.*'): BUG_COMPONENT = ('Core', 'Layout: View Rendering') +with Files('LayoutConstants.*'): + BUG_COMPONENT = ('Core', 'Layout: View Rendering') + with Files('LayerState.*'): BUG_COMPONENT = ('Core', 'Layout: View Rendering') @@ -63,6 +66,7 @@ EXPORTS += [ 'FrameLayerBuilder.h', 'FrameProperties.h', 'LayerState.h', + 'LayoutConstants.h', 'LayoutLogging.h', 'nsArenaMemoryStats.h', 'nsBidi.h', diff --git a/layout/base/nsDisplayItemTypesList.h b/layout/base/nsDisplayItemTypesList.h index 9865395a7..cf809817f 100644 --- a/layout/base/nsDisplayItemTypesList.h +++ b/layout/base/nsDisplayItemTypesList.h @@ -56,9 +56,7 @@ DECLARE_DISPLAY_ITEM_TYPE(SVG_PATH_GEOMETRY) DECLARE_DISPLAY_ITEM_TYPE(SVG_TEXT) DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_BACKGROUND) DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION) -DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_BACKGROUND) -DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_GROUP_BACKGROUND) -DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_BACKGROUND) +DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_COLLAPSE) DECLARE_DISPLAY_ITEM_TYPE(TEXT) DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW) DECLARE_DISPLAY_ITEM_TYPE_FLAGS(TRANSFORM,TYPE_RENDERS_NO_IMAGES) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e22230b41..1579e6970 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -80,6 +80,8 @@ #include "nsPluginFrame.h" #include "DisplayItemScrollClip.h" #include "nsSVGMaskFrame.h" +#include "nsTableCellFrame.h" +#include "nsTableColFrame.h" // GetCurrentTime is defined in winbase.h as zero argument macro forwarding to // GetTickCount(). @@ -2631,11 +2633,17 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil const nsRect& aBackgroundRect, nsDisplayList* aList, bool aAllowWillPaintBorderOptimization, - nsStyleContext* aStyleContext) + nsStyleContext* aStyleContext, + const nsRect& aBackgroundOriginRect, + nsIFrame* aSecondaryReferenceFrame) { nsStyleContext* bgSC = aStyleContext; const nsStyleBackground* bg = nullptr; nsRect bgRect = aBackgroundRect + aBuilder->ToReferenceFrame(aFrame); + nsRect bgOriginRect = bgRect; + if (!aBackgroundOriginRect.IsEmpty()) { + bgOriginRect = aBackgroundOriginRect + aBuilder->ToReferenceFrame(aFrame); + } nsPresContext* presContext = aFrame->PresContext(); bool isThemed = aFrame->IsThemed(); if (!isThemed) { @@ -2743,12 +2751,31 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil } nsDisplayList thisItemList; - nsDisplayBackgroundImage* bgItem = - new (aBuilder) nsDisplayBackgroundImage(aBuilder, aFrame, i, bgRect, bg); - + nsDisplayBackgroundImage* bgItem; + if (aSecondaryReferenceFrame) { + bgItem = + new (aBuilder) nsDisplayTableBackgroundImage(aBuilder, + aFrame, + i, + bgOriginRect, + bg, + aSecondaryReferenceFrame); + } else { + bgItem = + new (aBuilder) nsDisplayBackgroundImage(aBuilder, aFrame, i, bgOriginRect, bg); + } if (bgItem->ShouldFixToViewport(aBuilder)) { - thisItemList.AppendNewToTop( - nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, aFrame, bgItem, i)); + if (aSecondaryReferenceFrame) { + thisItemList.AppendNewToTop( + nsDisplayTableFixedPosition::CreateForFixedBackground(aBuilder, + aSecondaryReferenceFrame, + bgItem, + i, + aFrame)); + } else { + thisItemList.AppendNewToTop( + nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, aFrame, bgItem, i)); + } } else { thisItemList.AppendNewToTop(bgItem); } @@ -2889,7 +2916,7 @@ nsDisplayBackgroundImage::ImageLayerization nsDisplayBackgroundImage::ShouldCreateOwnLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager) { - nsIFrame* backgroundStyleFrame = nsCSSRendering::FindBackgroundStyleFrame(mFrame); + nsIFrame* backgroundStyleFrame = nsCSSRendering::FindBackgroundStyleFrame(StyleFrame()); if (ActiveLayerTracker::IsBackgroundPositionAnimated(aBuilder, backgroundStyleFrame)) { return WHENEVER_POSSIBLE; @@ -3144,16 +3171,16 @@ nsDisplayBackgroundImage::PaintInternal(nsDisplayListBuilder* aBuilder, StyleGeometryBox clip = mBackgroundStyle->mImage.mLayers[mLayer].mClip; if (clip == StyleGeometryBox::Text) { - if (!GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect, aBuilder)) { + if (!GenerateAndPushTextMask(StyleFrame(), aCtx, mBackgroundRect, aBuilder)) { return; } } nsCSSRendering::PaintBGParams params = - nsCSSRendering::PaintBGParams::ForSingleLayer(*mFrame->PresContext(), + nsCSSRendering::PaintBGParams::ForSingleLayer(*StyleFrame()->PresContext(), *aCtx, aBounds, mBackgroundRect, - mFrame, flags, mLayer, + StyleFrame(), flags, mLayer, CompositionOp::OP_OVER); params.bgClipRect = aClipRect; image::DrawResult result = @@ -3255,6 +3282,27 @@ nsDisplayBackgroundImage::GetPerFrameKey() nsDisplayItem::GetPerFrameKey(); } +nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, + uint32_t aLayer, + const nsRect& aBackgroundRect, + const nsStyleBackground* aBackgroundStyle, + nsIFrame* aCellFrame) + : nsDisplayBackgroundImage(aBuilder, aFrame, aLayer, aBackgroundRect, aBackgroundStyle) + , mStyleFrame(aFrame) + , mTableType(GetTableTypeFromFrame(mStyleFrame)) +{ + mFrame = aCellFrame; +} + +bool +nsDisplayTableBackgroundImage::IsInvalid(nsRect& aRect) +{ + bool result = mStyleFrame ? mStyleFrame->IsInvalid(aRect) : false; + aRect += ToReferenceFrame(); + return result; +} + nsDisplayThemedBackground::nsDisplayThemedBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, const nsRect& aBackgroundRect) @@ -5272,6 +5320,51 @@ bool nsDisplayFixedPosition::TryMerge(nsDisplayItem* aItem) { return true; } +TableType +GetTableTypeFromFrame(nsIFrame* aFrame) +{ + nsIAtom* type = aFrame->GetType(); + if (type == nsGkAtoms::tableFrame) { + return TableType::TABLE; + } else if (type == nsGkAtoms::tableColFrame) { + return TableType::TABLE_COL; + } else if (type == nsGkAtoms::tableColGroupFrame) { + return TableType::TABLE_COL_GROUP; + } else if (type == nsGkAtoms::tableRowFrame) { + return TableType::TABLE_ROW; + } else if (type == nsGkAtoms::tableRowGroupFrame) { + return TableType::TABLE_ROW_GROUP; + } else if (type == nsGkAtoms::tableCellFrame) { + return TableType::TABLE_CELL; + } else { + MOZ_ASSERT_UNREACHABLE("Invalid frame."); + return TableType::TABLE; + } +} + +nsDisplayTableFixedPosition::nsDisplayTableFixedPosition(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, + nsDisplayList* aList, + uint32_t aIndex, + nsIFrame* aAncestorFrame) + : nsDisplayFixedPosition(aBuilder, aFrame, aList, aIndex) + , mTableType(GetTableTypeFromFrame(aAncestorFrame)) +{ +} + +/* static */ nsDisplayTableFixedPosition* +nsDisplayTableFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, + nsDisplayBackgroundImage* aImage, + uint32_t aIndex, + nsIFrame* aAncestorFrame) +{ + nsDisplayList temp; + temp.AppendToTop(aImage); + + return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame); +} + nsDisplayStickyPosition::nsDisplayStickyPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsDisplayList* aList) diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index c81d34fac..e9047b113 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2737,7 +2737,9 @@ public: const nsRect& aBackgroundRect, nsDisplayList* aList, bool aAllowWillPaintBorderOptimization = true, - nsStyleContext* aStyleContext = nullptr); + nsStyleContext* aStyleContext = nullptr, + const nsRect& aBackgroundOriginRect = nsRect(), + nsIFrame* aSecondaryReferenceFrame = nullptr); virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, @@ -2812,6 +2814,8 @@ protected: void PaintInternal(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx, const nsRect& aBounds, nsRect* aClipRect); + virtual nsIFrame* StyleFrame() { return mFrame; } + // Determine whether we want to be separated into our own layer, independent // of whether this item can actually be layerized. enum ImageLayerization { @@ -2837,6 +2841,60 @@ protected: bool mShouldTreatAsFixed; }; +enum class TableType : uint8_t { + TABLE, + TABLE_COL, + TABLE_COL_GROUP, + TABLE_ROW, + TABLE_ROW_GROUP, + TABLE_CELL, + + TABLE_TYPE_MAX +}; + +enum class TableTypeBits : uint8_t { + COUNT = 3 +}; + +static_assert( + static_cast<uint8_t>(TableType::TABLE_TYPE_MAX) < (1 << (static_cast<uint8_t>(TableTypeBits::COUNT) + 1)), + "TableType cannot fit with TableTypeBits::COUNT"); +TableType GetTableTypeFromFrame(nsIFrame* aFrame); + +/** + * A display item to paint background image for table. For table parts, such + * as row, row group, col, col group, when drawing its background, we'll + * create separate background image display item for its containning cell. + * Those background image display items will reference to same DisplayItemData + * if we keep the mFrame point to cell's ancestor frame. We don't want to this + * happened bacause share same DisplatItemData will cause many bugs. So that + * we let mFrame point to cell frame and store the table type of the ancestor + * frame. And use mFrame and table type as key to generate DisplayItemData to + * avoid sharing DisplayItemData. + * + * Also store ancestor frame as mStyleFrame for all rendering informations. + */ +class nsDisplayTableBackgroundImage : public nsDisplayBackgroundImage { +public: + nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, + uint32_t aLayer, + const nsRect& aBackgroundRect, + const nsStyleBackground* aBackgroundStyle, + nsIFrame* aCellFrame); + + virtual uint32_t GetPerFrameKey() override { + return (static_cast<uint8_t>(mTableType) << nsDisplayItem::TYPE_BITS) | + nsDisplayItem::GetPerFrameKey(); + } + + virtual bool IsInvalid(nsRect& aRect) override; +protected: + virtual nsIFrame* StyleFrame() override { return mStyleFrame; } + + nsIFrame* mStyleFrame; + TableType mTableType; +}; /** * A display item to paint the native theme background for a frame. @@ -3735,7 +3793,7 @@ public: return mAnimatedGeometryRootForScrollMetadata; } -private: +protected: // For background-attachment:fixed nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsDisplayList* aList, uint32_t aIndex); @@ -3746,6 +3804,27 @@ private: bool mIsFixedBackground; }; +class nsDisplayTableFixedPosition : public nsDisplayFixedPosition +{ +public: + static nsDisplayTableFixedPosition* CreateForFixedBackground(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, + nsDisplayBackgroundImage* aImage, + uint32_t aIndex, + nsIFrame* aAncestorFrame); + + virtual uint32_t GetPerFrameKey() override { + return (mIndex << (nsDisplayItem::TYPE_BITS + static_cast<uint8_t>(TableTypeBits::COUNT))) | + (static_cast<uint8_t>(mTableType) << nsDisplayItem::TYPE_BITS) | + nsDisplayItem::GetPerFrameKey(); + } +protected: + nsDisplayTableFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, + nsDisplayList* aList, uint32_t aIndex, nsIFrame* aAncestorFrame); + + TableType mTableType; +}; + /** * This creates an empty scrollable layer. It has no child layers. * It is used to record the existence of a scrollable frame in the layer diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 06690b208..21d20c69f 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -4671,8 +4671,6 @@ GetDefiniteSize(const nsStyleCoord& aStyle, nscoord pb = aIsInlineAxis ? aPercentageBasis.value().ISize(wm) : aPercentageBasis.value().BSize(wm); if (pb == NS_UNCONSTRAINEDSIZE) { - // XXXmats given that we're calculating an intrinsic size here, - // maybe we should back-compute the calc-size using AddPercents? return false; } *aResult = std::max(0, calc->mLength + @@ -4916,12 +4914,9 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, nscoord result = aContentSize; nscoord min = aContentMinSize; nscoord coordOutsideSize = 0; - float pctOutsideSize = 0; - float pctTotal = 0.0f; if (!(aFlags & nsLayoutUtils::IGNORE_PADDING)) { coordOutsideSize += aOffsets.hPadding; - pctOutsideSize += aOffsets.hPctPadding; } coordOutsideSize += aOffsets.hBorder; @@ -4929,21 +4924,15 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, if (aBoxSizing == StyleBoxSizing::Border) { min += coordOutsideSize; result = NSCoordSaturatingAdd(result, coordOutsideSize); - pctTotal += pctOutsideSize; coordOutsideSize = 0; - pctOutsideSize = 0.0f; } coordOutsideSize += aOffsets.hMargin; - pctOutsideSize += aOffsets.hPctMargin; min += coordOutsideSize; result = NSCoordSaturatingAdd(result, coordOutsideSize); - pctTotal += pctOutsideSize; - const bool shouldAddPercent = aType == nsLayoutUtils::PREF_ISIZE || - (aFlags & nsLayoutUtils::ADD_PERCENTS); nscoord size; if (aType == nsLayoutUtils::MIN_ISIZE && (((aStyleSize.HasPercent() || aStyleMaxSize.HasPercent()) && @@ -4961,18 +4950,6 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, GetIntrinsicCoord(aStyleSize, aRenderingContext, aFrame, PROP_WIDTH, size)) { result = size + coordOutsideSize; - if (shouldAddPercent) { - result = nsLayoutUtils::AddPercents(result, pctOutsideSize); - } - } else { - // NOTE: We could really do a lot better for percents and for some - // cases of calc() containing percent (certainly including any where - // the coefficient on the percent is positive and there are no max() - // expressions). However, doing better for percents wouldn't be - // backwards compatible. - if (shouldAddPercent) { - result = nsLayoutUtils::AddPercents(result, pctTotal); - } } nscoord maxSize = aFixedMaxSize ? *aFixedMaxSize : 0; @@ -4980,9 +4957,6 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, GetIntrinsicCoord(aStyleMaxSize, aRenderingContext, aFrame, PROP_MAX_WIDTH, maxSize)) { maxSize += coordOutsideSize; - if (shouldAddPercent) { - maxSize = nsLayoutUtils::AddPercents(maxSize, pctOutsideSize); - } if (result > maxSize) { result = maxSize; } @@ -4993,17 +4967,11 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, GetIntrinsicCoord(aStyleMinSize, aRenderingContext, aFrame, PROP_MIN_WIDTH, minSize)) { minSize += coordOutsideSize; - if (shouldAddPercent) { - minSize = nsLayoutUtils::AddPercents(minSize, pctOutsideSize); - } if (result < minSize) { result = minSize; } } - if (shouldAddPercent) { - min = nsLayoutUtils::AddPercents(min, pctTotal); - } if (result < min) { result = min; } @@ -5020,9 +4988,6 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext, : devSize.width); // GetMinimumWidgetSize() returns a border-box width. themeSize += aOffsets.hMargin; - if (shouldAddPercent) { - themeSize = nsLayoutUtils::AddPercents(themeSize, aOffsets.hPctMargin); - } if (themeSize > result || !canOverride) { result = themeSize; } @@ -5267,9 +5232,19 @@ nsLayoutUtils::IntrinsicForAxis(PhysicalAxis aAxis, min = aFrame->GetMinISize(aRenderingContext); } + nscoord pmPercentageBasis = NS_UNCONSTRAINEDSIZE; + if (aPercentageBasis.isSome()) { + // The padding/margin percentage basis is the inline-size in the parent's + // writing-mode. + auto childWM = aFrame->GetWritingMode(); + pmPercentageBasis = + aFrame->GetParent()->GetWritingMode().IsOrthogonalTo(childWM) ? + aPercentageBasis->BSize(childWM) : + aPercentageBasis->ISize(childWM); + } nsIFrame::IntrinsicISizeOffsetData offsets = - MOZ_LIKELY(isInlineAxis) ? aFrame->IntrinsicISizeOffsets() - : aFrame->IntrinsicBSizeOffsets(); + MOZ_LIKELY(isInlineAxis) ? aFrame->IntrinsicISizeOffsets(pmPercentageBasis) + : aFrame->IntrinsicBSizeOffsets(pmPercentageBasis); nscoord contentBoxSize = result; result = AddIntrinsicSizeOffset(aRenderingContext, aFrame, offsets, aType, boxSizing, result, min, styleISize, @@ -5310,11 +5285,12 @@ nsLayoutUtils::IntrinsicForContainer(nsRenderingContext* aRenderingContext, } /* static */ nscoord -nsLayoutUtils::MinSizeContributionForAxis(PhysicalAxis aAxis, +nsLayoutUtils::MinSizeContributionForAxis(PhysicalAxis aAxis, nsRenderingContext* aRC, - nsIFrame* aFrame, - IntrinsicISizeType aType, - uint32_t aFlags) + nsIFrame* aFrame, + IntrinsicISizeType aType, + const LogicalSize& aPercentageBasis, + uint32_t aFlags) { MOZ_ASSERT(aFrame); MOZ_ASSERT(aFrame->IsFlexOrGridItem(), @@ -5328,9 +5304,7 @@ nsLayoutUtils::MinSizeContributionForAxis(PhysicalAxis aAxis, aWM.IsVertical() ? "vertical" : "horizontal"); #endif - // Note: this method is only meant for grid/flex items which always - // include percentages in their intrinsic size. - aFlags |= nsLayoutUtils::ADD_PERCENTS; + // Note: this method is only meant for grid/flex items. const nsStylePosition* const stylePos = aFrame->StylePosition(); const nsStyleCoord* style = aAxis == eAxisHorizontal ? &stylePos->mMinWidth : &stylePos->mMinHeight; @@ -5375,11 +5349,17 @@ nsLayoutUtils::MinSizeContributionForAxis(PhysicalAxis aAxis, // wrapping inside of it should not apply font size inflation. AutoMaybeDisableFontInflation an(aFrame); - PhysicalAxis ourInlineAxis = - aFrame->GetWritingMode().PhysicalAxis(eLogicalAxisInline); + // The padding/margin percentage basis is the inline-size in the parent's + // writing-mode. + auto childWM = aFrame->GetWritingMode(); + nscoord pmPercentageBasis = + aFrame->GetParent()->GetWritingMode().IsOrthogonalTo(childWM) ? + aPercentageBasis.BSize(childWM) : + aPercentageBasis.ISize(childWM); + PhysicalAxis ourInlineAxis = childWM.PhysicalAxis(eLogicalAxisInline); nsIFrame::IntrinsicISizeOffsetData offsets = - ourInlineAxis == aAxis ? aFrame->IntrinsicISizeOffsets() - : aFrame->IntrinsicBSizeOffsets(); + ourInlineAxis == aAxis ? aFrame->IntrinsicISizeOffsets(pmPercentageBasis) + : aFrame->IntrinsicBSizeOffsets(pmPercentageBasis); nscoord result = 0; nscoord min = 0; diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 0a82dbf6a..bba1f3265 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -6,6 +6,7 @@ #ifndef nsLayoutUtils_h__ #define nsLayoutUtils_h__ +#include "LayoutConstants.h" #include "mozilla/MemoryReporting.h" #include "mozilla/ArrayUtils.h" #include "mozilla/Maybe.h" @@ -154,6 +155,7 @@ public: typedef mozilla::ScreenMargin ScreenMargin; typedef mozilla::LayoutDeviceIntSize LayoutDeviceIntSize; typedef mozilla::StyleGeometryBox StyleGeometryBox; + typedef mozilla::LogicalSize LogicalSize; /** * Finds previously assigned ViewID for the given content element, if any. @@ -1381,7 +1383,8 @@ public: * variations if that's what matches aAxis) and its padding, border and margin * in the corresponding dimension. * @param aPercentageBasis an optional percentage basis (in aFrame's WM). - * Pass NS_UNCONSTRAINEDSIZE if the basis is indefinite in either/both axes. + * If the basis is indefinite in a given axis, pass a size with + * NS_UNCONSTRAINEDSIZE in that component. * If you pass Nothing() a percentage basis will be calculated from aFrame's * ancestors' computed size in the relevant axis, if needed. * @param aMarginBoxMinSizeClamp make the result fit within this margin-box @@ -1395,14 +1398,13 @@ public: IGNORE_PADDING = 0x01, BAIL_IF_REFLOW_NEEDED = 0x02, // returns NS_INTRINSIC_WIDTH_UNKNOWN if so MIN_INTRINSIC_ISIZE = 0x04, // use min-width/height instead of width/height - ADD_PERCENTS = 0x08, // apply AddPercents also for MIN_ISIZE }; static nscoord IntrinsicForAxis(mozilla::PhysicalAxis aAxis, nsRenderingContext* aRenderingContext, nsIFrame* aFrame, IntrinsicISizeType aType, - const mozilla::Maybe<mozilla::LogicalSize>& aPercentageBasis = mozilla::Nothing(), + const mozilla::Maybe<LogicalSize>& aPercentageBasis = mozilla::Nothing(), uint32_t aFlags = 0, nscoord aMarginBoxMinSizeClamp = NS_MAXSIZE); /** @@ -1427,31 +1429,18 @@ public: * calculates the result as if the 'min-' computed value is zero. * Otherwise, return NS_UNCONSTRAINEDSIZE. * + * @param aPercentageBasis the percentage basis (in aFrame's WM). + * Pass NS_UNCONSTRAINEDSIZE if the basis is indefinite in either/both axes. * @note this behavior is specific to Grid/Flexbox (currently) so aFrame * should be a grid/flex item. */ - static nscoord MinSizeContributionForAxis(mozilla::PhysicalAxis aAxis, - nsRenderingContext* aRC, - nsIFrame* aFrame, - IntrinsicISizeType aType, - uint32_t aFlags = 0); - - /** - * This function increases an initial intrinsic size, 'aCurrent', according - * to the given 'aPercent', such that the size-increase makes up exactly - * 'aPercent' percent of the returned value. If 'aPercent' or 'aCurrent' are - * less than or equal to zero the original 'aCurrent' value is returned. - * If 'aPercent' is greater than or equal to 1.0 the value nscoord_MAX is - * returned. - */ - static nscoord AddPercents(nscoord aCurrent, float aPercent) - { - if (aPercent > 0.0f && aCurrent > 0) { - return MOZ_UNLIKELY(aPercent >= 1.0f) ? nscoord_MAX - : NSToCoordRound(float(aCurrent) / (1.0f - aPercent)); - } - return aCurrent; - } + static nscoord + MinSizeContributionForAxis(mozilla::PhysicalAxis aAxis, + nsRenderingContext* aRC, + nsIFrame* aFrame, + IntrinsicISizeType aType, + const LogicalSize& aPercentageBasis, + uint32_t aFlags = 0); /* * Convert nsStyleCoord to nscoord when percentages depend on the @@ -2876,6 +2865,62 @@ public: static nsRect ComputeGeometryBox(nsIFrame* aFrame, StyleGeometryBox aGeometryBox); + /** + * Resolve a CSS <length-percentage> value to a definite size. + */ + template<bool clampNegativeResultToZero> + static nscoord ResolveToLength(const nsStyleCoord& aCoord, + nscoord aPercentageBasis) + { + NS_WARNING_ASSERTION(aPercentageBasis >= nscoord(0), "nscoord overflow?"); + + switch (aCoord.GetUnit()) { + case eStyleUnit_Coord: + MOZ_ASSERT(!clampNegativeResultToZero || aCoord.GetCoordValue() >= 0, + "This value should have been rejected by the style system"); + return aCoord.GetCoordValue(); + case eStyleUnit_Percent: + if (aPercentageBasis == NS_UNCONSTRAINEDSIZE) { + return nscoord(0); + } + MOZ_ASSERT(!clampNegativeResultToZero || aCoord.GetPercentValue() >= 0, + "This value should have been rejected by the style system"); + return NSToCoordFloorClamped(aPercentageBasis * + aCoord.GetPercentValue()); + case eStyleUnit_Calc: { + nsStyleCoord::Calc* calc = aCoord.GetCalcValue(); + nscoord result; + if (aPercentageBasis == NS_UNCONSTRAINEDSIZE) { + result = calc->mLength; + } else { + result = calc->mLength + + NSToCoordFloorClamped(aPercentageBasis * calc->mPercent); + } + if (clampNegativeResultToZero && result < 0) { + return nscoord(0); + } + return result; + } + default: + MOZ_ASSERT_UNREACHABLE("Unexpected unit!"); + return nscoord(0); + } + } + + /** + * Resolve a column-gap/row-gap to a definite size. + * @note This method resolves 'normal' to zero. + * Callers who want different behavior should handle 'normal' on their own. + */ + static nscoord ResolveGapToLength(const nsStyleCoord& aGap, + nscoord aPercentageBasis) + { + if (aGap.GetUnit() == eStyleUnit_Normal) { + return nscoord(0); + } + return ResolveToLength<true>(aGap, aPercentageBasis); + } + private: static uint32_t sFontSizeInflationEmPerLine; static uint32_t sFontSizeInflationMinTwips; diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp index ca68992c3..c5ed44e92 100644 --- a/layout/generic/StickyScrollContainer.cpp +++ b/layout/generic/StickyScrollContainer.cpp @@ -45,7 +45,7 @@ StickyScrollContainer::GetStickyScrollContainerForFrame(nsIFrame* aFrame) // <html style="position: fixed"> return nullptr; } - auto frame = static_cast<nsIFrame*>(do_QueryFrame(scrollFrame)); + nsIFrame* frame = do_QueryFrame(scrollFrame); StickyScrollContainer* s = frame->GetProperty(StickyScrollContainerProperty()); if (!s) { @@ -176,6 +176,14 @@ StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick, nsRect rect = nsLayoutUtils::GetAllInFlowRectsUnion(aFrame, aFrame->GetParent()); + // Note: Table row groups aren't supposed to be containing blocks, but we treat + // them as such anyway. + // Not having this basically disables position:sticky on table cells, which + // would be really unfortunate, and doesn't match what other browsers do. + if (cbFrame != scrolledFrame && cbFrame->GetType() == nsGkAtoms::tableRowGroupFrame) { + cbFrame = cbFrame->GetContainingBlock(); + } + // Containing block limits for the position of aFrame relative to its parent. // The margin box of the sticky element stays within the content box of the // contaning-block element. diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index ad36ba1a8..6ea15d4d2 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -183,18 +183,15 @@ nsColumnSetFrame::GetAvailableContentBSize(const ReflowInput& aReflowInput) static nscoord GetColumnGap(nsColumnSetFrame* aFrame, - const nsStyleColumn* aColStyle) + const nsStyleColumn* aColStyle, + nscoord aPercentageBasis) { - if (eStyleUnit_Normal == aColStyle->mColumnGap.GetUnit()) + const auto& columnGap = aColStyle->mColumnGap; + if (columnGap.GetUnit() == eStyleUnit_Normal) { return aFrame->StyleFont()->mFont.size; - if (eStyleUnit_Coord == aColStyle->mColumnGap.GetUnit()) { - nscoord colGap = aColStyle->mColumnGap.GetCoordValue(); - NS_ASSERTION(colGap >= 0, "negative column gap"); - return colGap; } - NS_NOTREACHED("Unknown gap type"); - return 0; + return nsLayoutUtils::ResolveGapToLength(columnGap, aPercentageBasis); } nsColumnSetFrame::ReflowConfig @@ -227,7 +224,7 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput, colBSize = std::min(colBSize, aReflowInput.ComputedMaxBSize()); } - nscoord colGap = GetColumnGap(this, colStyle); + nscoord colGap = GetColumnGap(this, colStyle, aReflowInput.ComputedISize()); int32_t numColumns = colStyle->mColumnCount; // If column-fill is set to 'balance', then we want to balance the columns. @@ -403,7 +400,7 @@ nsColumnSetFrame::GetMinISize(nsRenderingContext *aRenderingContext) // include n-1 column gaps. colISize = iSize; iSize *= colStyle->mColumnCount; - nscoord colGap = GetColumnGap(this, colStyle); + nscoord colGap = GetColumnGap(this, colStyle, NS_UNCONSTRAINEDSIZE); iSize += colGap * (colStyle->mColumnCount - 1); // The multiplication above can make 'width' negative (integer overflow), // so use std::max to protect against that. @@ -424,7 +421,7 @@ nsColumnSetFrame::GetPrefISize(nsRenderingContext *aRenderingContext) nscoord result = 0; DISPLAY_PREF_WIDTH(this, result); const nsStyleColumn* colStyle = StyleColumn(); - nscoord colGap = GetColumnGap(this, colStyle); + nscoord colGap = GetColumnGap(this, colStyle, NS_UNCONSTRAINEDSIZE); nscoord colISize; if (colStyle->mColumnWidth.GetUnit() == eStyleUnit_Coord) { diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index bd96f213b..bbbb5c332 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -562,15 +562,12 @@ nsFrame::Init(nsIContent* aContent, } if (disp->mPosition == NS_STYLE_POSITION_STICKY && !aPrevInFlow && - !(mState & NS_FRAME_IS_NONDISPLAY) && - !disp->IsInnerTableStyle()) { + !(mState & NS_FRAME_IS_NONDISPLAY)) { // Note that we only add first continuations, but we really only // want to add first continuation-or-ib-split-siblings. But since we // don't yet know if we're a later part of a block-in-inline split, // we'll just add later members of a block-in-inline split here, and // then StickyScrollContainer will remove them later. - // We don't currently support relative positioning of inner table - // elements (bug 35168), so exclude them from sticky positioning too. StickyScrollContainer* ssc = StickyScrollContainer::GetStickyScrollContainerForFrame(this); if (ssc) { @@ -4515,68 +4512,44 @@ nsIFrame::InlinePrefISizeData::ForceBreak() mSkipWhitespace = true; } -static void -AddCoord(const nsStyleCoord& aStyle, - nsIFrame* aFrame, - nscoord* aCoord, float* aPercent, - bool aClampNegativeToZero) -{ - switch (aStyle.GetUnit()) { - case eStyleUnit_Coord: { - NS_ASSERTION(!aClampNegativeToZero || aStyle.GetCoordValue() >= 0, - "unexpected negative value"); - *aCoord += aStyle.GetCoordValue(); - return; - } - case eStyleUnit_Percent: { - NS_ASSERTION(!aClampNegativeToZero || aStyle.GetPercentValue() >= 0.0f, - "unexpected negative value"); - *aPercent += aStyle.GetPercentValue(); - return; - } - case eStyleUnit_Calc: { - const nsStyleCoord::Calc *calc = aStyle.GetCalcValue(); - if (aClampNegativeToZero) { - // This is far from ideal when one is negative and one is positive. - *aCoord += std::max(calc->mLength, 0); - *aPercent += std::max(calc->mPercent, 0.0f); - } else { - *aCoord += calc->mLength; - *aPercent += calc->mPercent; - } - return; - } - default: { - return; - } +static nscoord +ResolveMargin(const nsStyleCoord& aStyle, nscoord aPercentageBasis) +{ + if (aStyle.GetUnit() == eStyleUnit_Auto) { + return nscoord(0); } + return nsLayoutUtils::ResolveToLength<false>(aStyle, aPercentageBasis); +} + +static nscoord +ResolvePadding(const nsStyleCoord& aStyle, nscoord aPercentageBasis) +{ + return nsLayoutUtils::ResolveToLength<true>(aStyle, aPercentageBasis); } static nsIFrame::IntrinsicISizeOffsetData -IntrinsicSizeOffsets(nsIFrame* aFrame, bool aForISize) +IntrinsicSizeOffsets(nsIFrame* aFrame, nscoord aPercentageBasis, bool aForISize) { nsIFrame::IntrinsicISizeOffsetData result; WritingMode wm = aFrame->GetWritingMode(); - const nsStyleMargin* styleMargin = aFrame->StyleMargin(); + const auto& margin = aFrame->StyleMargin()->mMargin; bool verticalAxis = aForISize == wm.IsVertical(); - AddCoord(verticalAxis ? styleMargin->mMargin.GetTop() - : styleMargin->mMargin.GetLeft(), - aFrame, &result.hMargin, &result.hPctMargin, - false); - AddCoord(verticalAxis ? styleMargin->mMargin.GetBottom() - : styleMargin->mMargin.GetRight(), - aFrame, &result.hMargin, &result.hPctMargin, - false); - - const nsStylePadding* stylePadding = aFrame->StylePadding(); - AddCoord(verticalAxis ? stylePadding->mPadding.GetTop() - : stylePadding->mPadding.GetLeft(), - aFrame, &result.hPadding, &result.hPctPadding, - true); - AddCoord(verticalAxis ? stylePadding->mPadding.GetBottom() - : stylePadding->mPadding.GetRight(), - aFrame, &result.hPadding, &result.hPctPadding, - true); + if (verticalAxis) { + result.hMargin += ResolveMargin(margin.GetTop(), aPercentageBasis); + result.hMargin += ResolveMargin(margin.GetBottom(), aPercentageBasis); + } else { + result.hMargin += ResolveMargin(margin.GetLeft(), aPercentageBasis); + result.hMargin += ResolveMargin(margin.GetRight(), aPercentageBasis); + } + + const auto& padding = aFrame->StylePadding()->mPadding; + if (verticalAxis) { + result.hPadding += ResolvePadding(padding.GetTop(), aPercentageBasis); + result.hPadding += ResolvePadding(padding.GetBottom(), aPercentageBasis); + } else { + result.hPadding += ResolvePadding(padding.GetLeft(), aPercentageBasis); + result.hPadding += ResolvePadding(padding.GetRight(), aPercentageBasis); + } const nsStyleBorder* styleBorder = aFrame->StyleBorder(); if (verticalAxis) { @@ -4606,22 +4579,21 @@ IntrinsicSizeOffsets(nsIFrame* aFrame, bool aForISize) result.hPadding = presContext->DevPixelsToAppUnits(verticalAxis ? padding.TopBottom() : padding.LeftRight()); - result.hPctPadding = 0; } } return result; } /* virtual */ nsIFrame::IntrinsicISizeOffsetData -nsFrame::IntrinsicISizeOffsets() +nsFrame::IntrinsicISizeOffsets(nscoord aPercentageBasis) { - return IntrinsicSizeOffsets(this, true); + return IntrinsicSizeOffsets(this, aPercentageBasis, true); } nsIFrame::IntrinsicISizeOffsetData -nsIFrame::IntrinsicBSizeOffsets() +nsIFrame::IntrinsicBSizeOffsets(nscoord aPercentageBasis) { - return IntrinsicSizeOffsets(this, false); + return IntrinsicSizeOffsets(this, aPercentageBasis, false); } /* virtual */ IntrinsicSize @@ -6654,6 +6626,9 @@ GetNearestBlockContainer(nsIFrame* frame) // Since the parent of such a block is either a normal block or // another such pseudo, this shouldn't cause anything bad to happen. // Also the anonymous blocks inside table cells are not containing blocks. + // + // If we ever start skipping table row groups from being containing blocks, + // we need to remove the containing block assignment in StickyScrollContainer . while (frame->IsFrameOfType(nsIFrame::eLineParticipant) || frame->IsBlockWrapper() || // Table rows are not containing blocks either diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index af1c95ef2..439e39856 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -261,7 +261,8 @@ public: InlineMinISizeData *aData) override; virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext, InlinePrefISizeData *aData) override; - virtual IntrinsicISizeOffsetData IntrinsicISizeOffsets() override; + IntrinsicISizeOffsetData + IntrinsicISizeOffsets(nscoord aPercentageBasis = NS_UNCONSTRAINEDSIZE) override; virtual mozilla::IntrinsicSize GetIntrinsicSize() override; virtual nsSize GetIntrinsicRatio() override; diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 3a2d5ad1d..959061e33 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -8,8 +8,8 @@ #include "nsGridContainerFrame.h" -#include <algorithm> // for std::stable_sort #include <limits> +#include <stdlib.h> // for div() #include "mozilla/CSSAlignUtils.h" #include "mozilla/dom/GridBinding.h" #include "mozilla/Function.h" @@ -127,43 +127,6 @@ ResolveToDefiniteSize(const nsStyleCoord& aCoord, nscoord aPercentBasis) nsRuleNode::ComputeCoordPercentCalc(aCoord, aPercentBasis)); } -static bool -GetPercentSizeParts(const nsStyleCoord& aCoord, nscoord* aLength, float* aPercent) -{ - switch (aCoord.GetUnit()) { - case eStyleUnit_Percent: - *aLength = 0; - *aPercent = aCoord.GetPercentValue(); - return true; - case eStyleUnit_Calc: { - nsStyleCoord::Calc* calc = aCoord.GetCalcValue(); - *aLength = calc->mLength; - *aPercent = calc->mPercent; - return true; - } - default: - return false; - } -} - -static void -ResolvePercentSizeParts(const nsStyleCoord& aCoord, nscoord aPercentBasis, - nscoord* aLength, float* aPercent) -{ - MOZ_ASSERT(aCoord.IsCoordPercentCalcUnit()); - if (aPercentBasis != NS_UNCONSTRAINEDSIZE) { - *aLength = std::max(nscoord(0), - nsRuleNode::ComputeCoordPercentCalc(aCoord, - aPercentBasis)); - *aPercent = 0.0f; - return; - } - if (!GetPercentSizeParts(aCoord, aLength, aPercent)) { - *aLength = aCoord.ToLength(); - *aPercent = 0.0f; - } -} - // Synthesize a baseline from a border box. For an alphabetical baseline // this is the end edge of the border box. For a central baseline it's // the center of the border box. @@ -198,7 +161,7 @@ struct nsGridContainerFrame::TrackSize eMaxContentMinSizing = 0x4, eMinOrMaxContentMinSizing = eMinContentMinSizing | eMaxContentMinSizing, eIntrinsicMinSizing = eMinOrMaxContentMinSizing | eAutoMinSizing, - // 0x8 is unused, feel free to take it! + eModified = 0x8, eAutoMaxSizing = 0x10, eMinContentMaxSizing = 0x20, eMaxContentMaxSizing = 0x40, @@ -211,6 +174,7 @@ struct nsGridContainerFrame::TrackSize eSkipGrowUnlimited = eSkipGrowUnlimited1 | eSkipGrowUnlimited2, eBreakBefore = 0x800, eFitContent = 0x1000, + eInfinitelyGrowable = 0x2000, }; StateBits Initialize(nscoord aPercentageBasis, @@ -724,9 +688,6 @@ struct nsGridContainerFrame::LineRange mEnd > mStart, "invalid line range"); mEnd -= aNumRemovedTracks[mEnd]; } - if (mStart == mEnd) { - mEnd = nsGridContainerFrame::kAutoLine; - } } /** * Return the contribution of this line range for step 2 in @@ -856,6 +817,8 @@ struct nsGridContainerFrame::GridItemInfo // Return true if we should apply Automatic Minimum Size to this item. // https://drafts.csswg.org/css-grid/#min-size-auto + // @note the caller should also check that the item spans at least one track + // that has a min track sizing function that is 'auto' before applying it. bool ShouldApplyAutoMinSize(WritingMode aContainerWM, LogicalAxis aContainerAxis, nscoord aPercentageBasis) const @@ -915,6 +878,12 @@ nsGridContainerFrame::GridItemInfo::Dump() const if (state & ItemState::eIsFlexing) { printf("flexing "); } + if (state & ItemState::eApplyAutoMinSize) { + printf("auto-min-size "); + } + if (state & ItemState::eClampMarginBoxMinSize) { + printf("clamp "); + } if (state & ItemState::eFirstBaseline) { printf("first baseline %s-alignment ", (state & ItemState::eSelfBaseline) ? "self" : "content"); @@ -1091,6 +1060,7 @@ private: const nsTArray<nsString>& mRepeatAutoLineNameListBefore; const nsTArray<nsString>& mRepeatAutoLineNameListAfter; // The index of the repeat(auto-fill/fit) track, or zero if there is none. + // Relative to mExplicitGridOffset (repeat tracks are explicit by definition). const uint32_t mRepeatAutoStart; // The (hypothetical) index of the last such repeat() track. const uint32_t mRepeatAutoEnd; @@ -1101,6 +1071,7 @@ private: // generates one track (making mRepeatEndDelta == 0). const uint32_t mTemplateLinesEnd; // True if there is a specified repeat(auto-fill/fit) track. + // Indexed relative to mExplicitGridOffset + mRepeatAutoStart. const bool mHasRepeatAuto; }; @@ -1164,7 +1135,7 @@ struct nsGridContainerFrame::TrackSizingFunctions return 1; } nscoord repeatTrackSize = 0; - // Note that the repeat() track size is included in |sum| in this loop. + // Note that one repeat() track size is included in |sum| in this loop. nscoord sum = 0; const nscoord percentBasis = aSize; for (uint32_t i = 0; i < numTracks; ++i) { @@ -1181,54 +1152,31 @@ struct nsGridContainerFrame::TrackSizingFunctions } nscoord trackSize = ::ResolveToDefiniteSize(*coord, percentBasis); if (i == mRepeatAutoStart) { - if (percentBasis != NS_UNCONSTRAINEDSIZE) { - // Use a minimum 1px for the repeat() track-size. - if (trackSize < AppUnitsPerCSSPixel()) { - trackSize = AppUnitsPerCSSPixel(); - } + // Use a minimum 1px for the repeat() track-size. + if (trackSize < AppUnitsPerCSSPixel()) { + trackSize = AppUnitsPerCSSPixel(); } repeatTrackSize = trackSize; } sum += trackSize; } - nscoord gridGap; - float percentSum = 0.0f; - float gridGapPercent; - ResolvePercentSizeParts(aGridGap, percentBasis, &gridGap, &gridGapPercent); + nscoord gridGap = nsLayoutUtils::ResolveGapToLength(aGridGap, aSize); if (numTracks > 1) { // Add grid-gaps for all the tracks including the repeat() track. sum += gridGap * (numTracks - 1); - percentSum = gridGapPercent * (numTracks - 1); } // Calculate the max number of tracks that fits without overflow. nscoord available = maxFill != NS_UNCONSTRAINEDSIZE ? maxFill : aMinSize; - nscoord size = nsLayoutUtils::AddPercents(sum, percentSum); - if (available - size < 0) { + nscoord spaceToFill = available - sum; + if (spaceToFill <= 0) { // "if any number of repetitions would overflow, then 1 repetition" return 1; } - uint32_t numRepeatTracks = 1; - bool exactFit = false; - while (true) { - sum += gridGap + repeatTrackSize; - percentSum += gridGapPercent; - nscoord newSize = nsLayoutUtils::AddPercents(sum, percentSum); - if (newSize <= size) { - // Adding more repeat-tracks won't make forward progress. - return numRepeatTracks; - } - size = newSize; - nscoord remaining = available - size; - exactFit = remaining == 0; - if (remaining >= 0) { - ++numRepeatTracks; - } - if (remaining <= 0) { - break; - } - } - - if (!exactFit && maxFill == NS_UNCONSTRAINEDSIZE) { + // Calculate the max number of tracks that fits without overflow. + div_t q = div(spaceToFill, repeatTrackSize + gridGap); + // The +1 here is for the one repeat track we already accounted for above. + uint32_t numRepeatTracks = q.quot + 1; + if (q.rem != 0 && maxFill == NS_UNCONSTRAINEDSIZE) { // "Otherwise, if the grid container has a definite min size in // the relevant axis, the number of repetitions is the largest possible // positive integer that fulfills that minimum requirement." @@ -1340,15 +1288,9 @@ struct nsGridContainerFrame::Tracks nscoord aContentBoxSize); /** - * Return true if aRange spans at least one track with an intrinsic sizing - * function and does not span any tracks with a <flex> max-sizing function. - * @param aRange the span of tracks to check - * @param aState will be set to the union of the state bits of all the spanned - * tracks, unless a flex track is found - then it only contains - * the union of the tracks up to and including the flex track. + * Return the union of the state bits for the tracks in aRange. */ - bool HasIntrinsicButNoFlexSizingInRange(const LineRange& aRange, - TrackSize::StateBits* aState) const; + TrackSize::StateBits StateBitsForRange(const LineRange& aRange) const; // Some data we collect for aligning baseline-aligned items. struct ItemBaselineData @@ -1383,6 +1325,62 @@ struct nsGridContainerFrame::Tracks */ void AlignBaselineSubtree(const GridItemInfo& aGridItem) const; + enum class TrackSizingPhase + { + eIntrinsicMinimums, + eContentBasedMinimums, + eMaxContentMinimums, + eIntrinsicMaximums, + eMaxContentMaximums, + }; + + // Some data we collect on each item for Step 2 of the Track Sizing Algorithm + // in ResolveIntrinsicSize below. + struct Step2ItemData final + { + uint32_t mSpan; + TrackSize::StateBits mState; + LineRange mLineRange; + nscoord mMinSize; + nscoord mMinContentContribution; + nscoord mMaxContentContribution; + nsIFrame* mFrame; + static bool IsSpanLessThan(const Step2ItemData& a, const Step2ItemData& b) + { + return a.mSpan < b.mSpan; + } + + template<TrackSizingPhase phase> + nscoord SizeContributionForPhase() const + { + switch (phase) { + case TrackSizingPhase::eIntrinsicMinimums: + case TrackSizingPhase::eIntrinsicMaximums: + return mMinSize; + case TrackSizingPhase::eContentBasedMinimums: + return mMinContentContribution; + case TrackSizingPhase::eMaxContentMinimums: + case TrackSizingPhase::eMaxContentMaximums: + return mMaxContentContribution; + } + MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unexpected phase"); + } + }; + + using FitContentClamper = + function<bool(uint32_t aTrack, nscoord aMinSize, nscoord* aSize)>; + + // Helper method for ResolveIntrinsicSize. + template<TrackSizingPhase phase> + bool GrowSizeForSpanningItems(nsTArray<Step2ItemData>::iterator aIter, + const nsTArray<Step2ItemData>::iterator aEnd, + nsTArray<uint32_t>& aTracks, + nsTArray<TrackSize>& aPlan, + nsTArray<TrackSize>& aItemPlan, + TrackSize::StateBits aSelector, + const FitContentClamper& aClamper = nullptr, + bool aNeedInfinitelyGrowableFlag = false); + /** * Resolve Intrinsic Track Sizes. * http://dev.w3.org/csswg/css-grid/#algo-content @@ -1405,66 +1403,117 @@ struct nsGridContainerFrame::Tracks SizingConstraint aConstraint, const LineRange& aRange, const GridItemInfo& aGridItem); + + // Helper method that returns the track size to use in §11.5.1.2 + // https://drafts.csswg.org/css-grid/#extra-space + template<TrackSizingPhase phase> static + nscoord StartSizeInDistribution(const TrackSize& aSize) + { + switch (phase) { + case TrackSizingPhase::eIntrinsicMinimums: + case TrackSizingPhase::eContentBasedMinimums: + case TrackSizingPhase::eMaxContentMinimums: + return aSize.mBase; + case TrackSizingPhase::eIntrinsicMaximums: + case TrackSizingPhase::eMaxContentMaximums: + if (aSize.mLimit == NS_UNCONSTRAINEDSIZE) { + return aSize.mBase; + } + return aSize.mLimit; + } + MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unexpected phase"); + } + /** * Collect the tracks which are growable (matching aSelector) into * aGrowableTracks, and return the amount of space that can be used - * to grow those tracks. Specifically, we return aAvailableSpace minus - * the sum of mBase's (and corresponding grid gaps) in aPlan (clamped to 0) - * for the tracks in aRange, or zero when there are no growable tracks. - * @note aPlan[*].mBase represents a planned new base or limit. + * to grow those tracks. This method implements CSS Grid §11.5.1.2. + * https://drafts.csswg.org/css-grid/#extra-space */ - nscoord CollectGrowable(nscoord aAvailableSpace, - const nsTArray<TrackSize>& aPlan, - const LineRange& aRange, - TrackSize::StateBits aSelector, - nsTArray<uint32_t>& aGrowableTracks) const + template<TrackSizingPhase phase> + nscoord CollectGrowable(nscoord aAvailableSpace, + const LineRange& aRange, + TrackSize::StateBits aSelector, + nsTArray<uint32_t>& aGrowableTracks) const { MOZ_ASSERT(aAvailableSpace > 0, "why call me?"); nscoord space = aAvailableSpace - mGridGap * (aRange.Extent() - 1); const uint32_t start = aRange.mStart; const uint32_t end = aRange.mEnd; for (uint32_t i = start; i < end; ++i) { - const TrackSize& sz = aPlan[i]; - space -= sz.mBase; + const TrackSize& sz = mSizes[i]; + space -= StartSizeInDistribution<phase>(sz); if (space <= 0) { return 0; } - if ((sz.mState & aSelector) && !sz.IsFrozen()) { + if (sz.mState & aSelector) { aGrowableTracks.AppendElement(i); } } return aGrowableTracks.IsEmpty() ? 0 : space; } - void SetupGrowthPlan(nsTArray<TrackSize>& aPlan, - const nsTArray<uint32_t>& aTracks) const + template<TrackSizingPhase phase> + void InitializeItemPlan(nsTArray<TrackSize>& aItemPlan, + const nsTArray<uint32_t>& aTracks) const { for (uint32_t track : aTracks) { - aPlan[track] = mSizes[track]; + auto& plan = aItemPlan[track]; + const TrackSize& sz = mSizes[track]; + plan.mBase = StartSizeInDistribution<phase>(sz); + bool unlimited = sz.mState & TrackSize::eInfinitelyGrowable; + plan.mLimit = unlimited ? NS_UNCONSTRAINEDSIZE : sz.mLimit; + plan.mState = sz.mState; } } - void CopyPlanToBase(const nsTArray<TrackSize>& aPlan, - const nsTArray<uint32_t>& aTracks) + template<TrackSizingPhase phase> + void InitializePlan(nsTArray<TrackSize>& aPlan) const { - for (uint32_t track : aTracks) { - MOZ_ASSERT(mSizes[track].mBase <= aPlan[track].mBase); - mSizes[track].mBase = aPlan[track].mBase; + for (size_t i = 0, len = aPlan.Length(); i < len; ++i) { + auto& plan = aPlan[i]; + const auto& sz = mSizes[i]; + plan.mBase = StartSizeInDistribution<phase>(sz); + MOZ_ASSERT(phase == TrackSizingPhase::eMaxContentMaximums || + !(sz.mState & TrackSize::eInfinitelyGrowable), + "forgot to reset the eInfinitelyGrowable bit?"); + plan.mState = sz.mState; } } - void CopyPlanToLimit(const nsTArray<TrackSize>& aPlan, - const nsTArray<uint32_t>& aTracks) + template<TrackSizingPhase phase> + void CopyPlanToSize(const nsTArray<TrackSize>& aPlan, + bool aNeedInfinitelyGrowableFlag = false) { - for (uint32_t track : aTracks) { - MOZ_ASSERT(mSizes[track].mLimit == NS_UNCONSTRAINEDSIZE || - mSizes[track].mLimit <= aPlan[track].mBase); - mSizes[track].mLimit = aPlan[track].mBase; + for (size_t i = 0, len = mSizes.Length(); i < len; ++i) { + const auto& plan = aPlan[i]; + MOZ_ASSERT(plan.mBase >= 0); + auto& sz = mSizes[i]; + switch (phase) { + case TrackSizingPhase::eIntrinsicMinimums: + case TrackSizingPhase::eContentBasedMinimums: + case TrackSizingPhase::eMaxContentMinimums: + sz.mBase = plan.mBase; + break; + case TrackSizingPhase::eIntrinsicMaximums: + if (plan.mState & TrackSize::eModified) { + if (sz.mLimit == NS_UNCONSTRAINEDSIZE && + aNeedInfinitelyGrowableFlag) { + sz.mState |= TrackSize::eInfinitelyGrowable; + } + sz.mLimit = plan.mBase; + } + break; + case TrackSizingPhase::eMaxContentMaximums: + if (plan.mState & TrackSize::eModified) { + sz.mLimit = plan.mBase; + } + sz.mState &= ~TrackSize::eInfinitelyGrowable; + break; + } } } - using FitContentClamper = - function<bool(uint32_t aTrack, nscoord aMinSize, nscoord* aSize)>; /** * Grow the planned size for tracks in aGrowableTracks up to their limit * and then freeze them (all aGrowableTracks must be unfrozen on entry). @@ -1524,12 +1573,13 @@ struct nsGridContainerFrame::Tracks * assumed that aPlan have no aSkipFlag set for tracks in aGrowableTracks * on entry to this method. */ - uint32_t MarkExcludedTracks(nsTArray<TrackSize>& aPlan, - uint32_t aNumGrowable, - const nsTArray<uint32_t>& aGrowableTracks, - TrackSize::StateBits aMinSizingSelector, - TrackSize::StateBits aMaxSizingSelector, - TrackSize::StateBits aSkipFlag) const + static uint32_t + MarkExcludedTracks(nsTArray<TrackSize>& aPlan, + uint32_t aNumGrowable, + const nsTArray<uint32_t>& aGrowableTracks, + TrackSize::StateBits aMinSizingSelector, + TrackSize::StateBits aMaxSizingSelector, + TrackSize::StateBits aSkipFlag) { bool foundOneSelected = false; bool foundOneGrowable = false; @@ -1559,41 +1609,60 @@ struct nsGridContainerFrame::Tracks } /** - * Increase the planned size for tracks in aGrowableTracks that match - * aSelector (or all tracks if aSelector is zero) beyond their limit. + * Mark all tracks in aGrowableTracks with an eSkipGrowUnlimited bit if + * they *shouldn't* grow unlimited in §11.5.1.2.3 "Distribute space beyond + * growth limits" https://drafts.csswg.org/css-grid/#extra-space + * Return the number of tracks that are still growable. + */ + template<TrackSizingPhase phase> + static uint32_t + MarkExcludedTracks(nsTArray<TrackSize>& aPlan, + const nsTArray<uint32_t>& aGrowableTracks, + TrackSize::StateBits aSelector) + { + uint32_t numGrowable = aGrowableTracks.Length(); + if (phase == TrackSizingPhase::eIntrinsicMaximums || + phase == TrackSizingPhase::eMaxContentMaximums) { + // "when handling any intrinsic growth limit: all affected tracks" + return numGrowable; + } + MOZ_ASSERT(aSelector == (aSelector & TrackSize::eIntrinsicMinSizing) && + (aSelector & TrackSize::eMaxContentMinSizing), + "Should only get here for track sizing steps 2.1 to 2.3"); + // Note that eMaxContentMinSizing is always included. We do those first: + numGrowable = MarkExcludedTracks(aPlan, numGrowable, aGrowableTracks, + TrackSize::eMaxContentMinSizing, + TrackSize::eMaxContentMaxSizing, + TrackSize::eSkipGrowUnlimited1); + // Now mark min-content/auto min-sizing tracks if requested. + auto minOrAutoSelector = aSelector & ~TrackSize::eMaxContentMinSizing; + if (minOrAutoSelector) { + numGrowable = MarkExcludedTracks(aPlan, numGrowable, aGrowableTracks, + minOrAutoSelector, + TrackSize::eIntrinsicMaxSizing, + TrackSize::eSkipGrowUnlimited2); + } + return numGrowable; + } + + /** + * Increase the planned size for tracks in aGrowableTracks that aren't + * marked with a eSkipGrowUnlimited flag beyond their limit. * This implements the "Distribute space beyond growth limits" step in * https://drafts.csswg.org/css-grid/#distribute-extra-space */ void GrowSelectedTracksUnlimited(nscoord aAvailableSpace, nsTArray<TrackSize>& aPlan, const nsTArray<uint32_t>& aGrowableTracks, - TrackSize::StateBits aSelector, + uint32_t aNumGrowable, FitContentClamper aFitContentClamper) const { - MOZ_ASSERT(aAvailableSpace > 0 && aGrowableTracks.Length() > 0); - uint32_t numGrowable = aGrowableTracks.Length(); - if (aSelector) { - MOZ_ASSERT(aSelector == (aSelector & TrackSize::eIntrinsicMinSizing) && - (aSelector & TrackSize::eMaxContentMinSizing), - "Should only get here for track sizing steps 2.1 to 2.3"); - // Note that eMaxContentMinSizing is always included. We do those first: - numGrowable = MarkExcludedTracks(aPlan, numGrowable, aGrowableTracks, - TrackSize::eMaxContentMinSizing, - TrackSize::eMaxContentMaxSizing, - TrackSize::eSkipGrowUnlimited1); - // Now mark min-content/auto min-sizing tracks if requested. - auto minOrAutoSelector = aSelector & ~TrackSize::eMaxContentMinSizing; - if (minOrAutoSelector) { - numGrowable = MarkExcludedTracks(aPlan, numGrowable, aGrowableTracks, - minOrAutoSelector, - TrackSize::eIntrinsicMaxSizing, - TrackSize::eSkipGrowUnlimited2); - } - } + MOZ_ASSERT(aAvailableSpace > 0 && aGrowableTracks.Length() > 0 && + aNumGrowable <= aGrowableTracks.Length()); nscoord space = aAvailableSpace; DebugOnly<bool> didClamp = false; - while (numGrowable) { - nscoord spacePerTrack = std::max<nscoord>(space / numGrowable, 1); + while (aNumGrowable) { + nscoord spacePerTrack = std::max<nscoord>(space / aNumGrowable, 1); for (uint32_t track : aGrowableTracks) { TrackSize& sz = aPlan[track]; if (sz.mState & TrackSize::eSkipGrowUnlimited) { @@ -1609,7 +1678,7 @@ struct nsGridContainerFrame::Tracks delta = newBase - sz.mBase; MOZ_ASSERT(delta >= 0, "track size shouldn't shrink"); sz.mState |= TrackSize::eSkipGrowUnlimited1; - --numGrowable; + --aNumGrowable; } } sz.mBase = newBase; @@ -1628,46 +1697,30 @@ struct nsGridContainerFrame::Tracks * Distribute aAvailableSpace to the planned base size for aGrowableTracks * up to their limits, then distribute the remaining space beyond the limits. */ - void DistributeToTrackBases(nscoord aAvailableSpace, + template<TrackSizingPhase phase> + void DistributeToTrackSizes(nscoord aAvailableSpace, nsTArray<TrackSize>& aPlan, + nsTArray<TrackSize>& aItemPlan, nsTArray<uint32_t>& aGrowableTracks, - TrackSize::StateBits aSelector) + TrackSize::StateBits aSelector, + const FitContentClamper& aFitContentClamper) { - SetupGrowthPlan(aPlan, aGrowableTracks); - nscoord space = GrowTracksToLimit(aAvailableSpace, aPlan, aGrowableTracks, nullptr); + InitializeItemPlan<phase>(aItemPlan, aGrowableTracks); + nscoord space = GrowTracksToLimit(aAvailableSpace, aItemPlan, aGrowableTracks, + aFitContentClamper); if (space > 0) { - GrowSelectedTracksUnlimited(space, aPlan, aGrowableTracks, aSelector, nullptr); + uint32_t numGrowable = + MarkExcludedTracks<phase>(aItemPlan, aGrowableTracks, aSelector); + GrowSelectedTracksUnlimited(space, aItemPlan, aGrowableTracks, + numGrowable, aFitContentClamper); } - CopyPlanToBase(aPlan, aGrowableTracks); - } - - /** - * Distribute aAvailableSpace to the planned limits for aGrowableTracks. - */ - void DistributeToTrackLimits(nscoord aAvailableSpace, - nsTArray<TrackSize>& aPlan, - nsTArray<uint32_t>& aGrowableTracks, - const TrackSizingFunctions& aFunctions, - nscoord aPercentageBasis) - { - auto fitContentClamper = [&aFunctions, aPercentageBasis] (uint32_t aTrack, - nscoord aMinSize, - nscoord* aSize) { - nscoord fitContentLimit = - ::ResolveToDefiniteSize(aFunctions.MaxSizingFor(aTrack), aPercentageBasis); - if (*aSize > fitContentLimit) { - *aSize = std::max(aMinSize, fitContentLimit); - return true; + for (uint32_t track : aGrowableTracks) { + nscoord& plannedSize = aPlan[track].mBase; + nscoord itemIncurredSize = aItemPlan[track].mBase; + if (plannedSize < itemIncurredSize) { + plannedSize = itemIncurredSize; } - return false; - }; - nscoord space = GrowTracksToLimit(aAvailableSpace, aPlan, aGrowableTracks, - fitContentClamper); - if (space > 0) { - GrowSelectedTracksUnlimited(aAvailableSpace, aPlan, aGrowableTracks, - TrackSize::StateBits(0), fitContentClamper); } - CopyPlanToLimit(aPlan, aGrowableTracks); } /** @@ -1769,13 +1822,6 @@ struct nsGridContainerFrame::Tracks WritingMode aWM, const LogicalSize& aContainerSize); - /** - * Return the intrinsic size by back-computing percentages as: - * IntrinsicSize = SumOfCoordSizes / (1 - SumOfPercentages). - */ - nscoord BackComputedIntrinsicSize(const TrackSizingFunctions& aFunctions, - const nsStyleCoord& aGridGap) const; - nscoord GridLineEdge(uint32_t aLine, GridLineSide aSide) const { if (MOZ_UNLIKELY(mSizes.IsEmpty())) { @@ -2085,11 +2131,10 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowInput } /** - * Calculate our track sizes. If the given aContentBox block-axis size is - * unconstrained, it is assigned to the resulting intrinsic block-axis size. + * Calculate our track sizes. */ void CalculateTrackSizes(const Grid& aGrid, - LogicalSize& aContentBox, + const LogicalSize& aContentBox, SizingConstraint aConstraint); /** @@ -2575,7 +2620,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::Grid void nsGridContainerFrame::GridReflowInput::CalculateTrackSizes( const Grid& aGrid, - LogicalSize& aContentBox, + const LogicalSize& aContentBox, SizingConstraint aConstraint) { mCols.Initialize(mColFunctions, mGridStyle->mGridColumnGap, @@ -2593,12 +2638,6 @@ nsGridContainerFrame::GridReflowInput::CalculateTrackSizes( mRows.CalculateSizes(*this, mGridItems, mRowFunctions, aContentBox.BSize(mWM), &GridArea::mRows, aConstraint); - if (aContentBox.BSize(mWM) == NS_AUTOHEIGHT) { - aContentBox.BSize(mWM) = - mRows.BackComputedIntrinsicSize(mRowFunctions, mGridStyle->mGridRowGap); - mRows.mGridGap = - ::ResolveToDefiniteSize(mGridStyle->mGridRowGap, aContentBox.BSize(mWM)); - } } /** @@ -3545,19 +3584,27 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowInput& aState, // Count empty 'auto-fit' tracks in the repeat() range. // |colAdjust| will have a count for each line in the grid of how many // tracks were empty between the start of the grid and that line. + + // Since this loop is concerned with just the repeat tracks, we + // iterate from 0..NumRepeatTracks() which is the natural range of + // mRemoveRepeatTracks. This means we have to add + // (mExplicitGridOffset + mRepeatAutoStart) to get a zero-based + // index for arrays like mCellMap and colAdjust. We'll then fill out + // the colAdjust array for all the remaining lines. Maybe<nsTArray<uint32_t>> colAdjust; uint32_t numEmptyCols = 0; if (aState.mColFunctions.mHasRepeatAuto && !gridStyle->mGridTemplateColumns.mIsAutoFill && aState.mColFunctions.NumRepeatTracks() > 0) { - for (uint32_t col = aState.mColFunctions.mRepeatAutoStart, - endRepeat = aState.mColFunctions.mRepeatAutoEnd, - numColLines = mGridColEnd + 1; - col < numColLines; ++col) { + const uint32_t repeatStart = (aState.mColFunctions.mExplicitGridOffset + + aState.mColFunctions.mRepeatAutoStart); + const uint32_t numRepeats = aState.mColFunctions.NumRepeatTracks(); + const uint32_t numColLines = mGridColEnd + 1; + for (uint32_t i = 0; i < numRepeats; ++i) { if (numEmptyCols) { - (*colAdjust)[col] = numEmptyCols; + (*colAdjust)[repeatStart + i] = numEmptyCols; } - if (col < endRepeat && mCellMap.IsEmptyCol(col)) { + if (mCellMap.IsEmptyCol(repeatStart + i)) { ++numEmptyCols; if (colAdjust.isNothing()) { colAdjust.emplace(numColLines); @@ -3565,26 +3612,34 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowInput& aState, PodZero(colAdjust->Elements(), colAdjust->Length()); } - uint32_t repeatIndex = col - aState.mColFunctions.mRepeatAutoStart; - MOZ_ASSERT(aState.mColFunctions.mRemovedRepeatTracks.Length() > - repeatIndex); - aState.mColFunctions.mRemovedRepeatTracks[repeatIndex] = true; + aState.mColFunctions.mRemovedRepeatTracks[i] = true; + } + } + // Fill out the colAdjust array for all the columns after the + // repeats. + if (numEmptyCols) { + for (uint32_t col = repeatStart + numRepeats; + col < numColLines; ++col) { + (*colAdjust)[col] = numEmptyCols; } } } + + // Do similar work for the row tracks, with the same logic. Maybe<nsTArray<uint32_t>> rowAdjust; uint32_t numEmptyRows = 0; if (aState.mRowFunctions.mHasRepeatAuto && !gridStyle->mGridTemplateRows.mIsAutoFill && aState.mRowFunctions.NumRepeatTracks() > 0) { - for (uint32_t row = aState.mRowFunctions.mRepeatAutoStart, - endRepeat = aState.mRowFunctions.mRepeatAutoEnd, - numRowLines = mGridRowEnd + 1; - row < numRowLines; ++row) { + const uint32_t repeatStart = (aState.mRowFunctions.mExplicitGridOffset + + aState.mRowFunctions.mRepeatAutoStart); + const uint32_t numRepeats = aState.mRowFunctions.NumRepeatTracks(); + const uint32_t numRowLines = mGridRowEnd + 1; + for (uint32_t i = 0; i < numRepeats; ++i) { if (numEmptyRows) { - (*rowAdjust)[row] = numEmptyRows; + (*rowAdjust)[repeatStart + i] = numEmptyRows; } - if (row < endRepeat && mCellMap.IsEmptyRow(row)) { + if (mCellMap.IsEmptyRow(repeatStart + i)) { ++numEmptyRows; if (rowAdjust.isNothing()) { rowAdjust.emplace(numRowLines); @@ -3592,10 +3647,13 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowInput& aState, PodZero(rowAdjust->Elements(), rowAdjust->Length()); } - uint32_t repeatIndex = row - aState.mRowFunctions.mRepeatAutoStart; - MOZ_ASSERT(aState.mRowFunctions.mRemovedRepeatTracks.Length() > - repeatIndex); - aState.mRowFunctions.mRemovedRepeatTracks[repeatIndex] = true; + aState.mRowFunctions.mRemovedRepeatTracks[i] = true; + } + } + if (numEmptyRows) { + for (uint32_t row = repeatStart + numRepeats; + row < numRowLines; ++row) { + (*rowAdjust)[row] = numEmptyRows; } } } @@ -3681,7 +3739,7 @@ nsGridContainerFrame::Tracks::Initialize( aFunctions.MinSizingFor(i), aFunctions.MaxSizingFor(i)); } - mGridGap = ::ResolveToDefiniteSize(aGridGap, aContentBoxSize); + mGridGap = nsLayoutUtils::ResolveGapToLength(aGridGap, aContentBoxSize); mContentBoxSize = aContentBoxSize; } @@ -3762,8 +3820,7 @@ ContentContribution(const GridItemInfo& aGridItem, PhysicalAxis axis(aCBWM.PhysicalAxis(aAxis)); nscoord size = nsLayoutUtils::IntrinsicForAxis(axis, aRC, child, aConstraint, aPercentageBasis, - aFlags | nsLayoutUtils::BAIL_IF_REFLOW_NEEDED | - nsLayoutUtils::ADD_PERCENTS, + aFlags | nsLayoutUtils::BAIL_IF_REFLOW_NEEDED, aMinSizeClamp); if (size == NS_INTRINSIC_WIDTH_UNKNOWN) { // We need to reflow the child to find its BSize contribution. @@ -3800,15 +3857,7 @@ ContentContribution(const GridItemInfo& aGridItem, LogicalSize availableSize(childWM, availISize, availBSize); size = ::MeasuringReflow(child, aState.mReflowInput, aRC, availableSize, cbSize, iMinSizeClamp, bMinSizeClamp); - nsIFrame::IntrinsicISizeOffsetData offsets = child->IntrinsicBSizeOffsets(); - size += offsets.hMargin; - auto percent = offsets.hPctMargin; - if (availBSize == NS_UNCONSTRAINEDSIZE) { - // We always want to add in percent padding too, unless we already did so - // using a resolved column size above. - percent += offsets.hPctPadding; - } - size = nsLayoutUtils::AddPercents(size, percent); + size += child->GetLogicalUsedMargin(childWM).BStartEnd(childWM); nscoord overflow = size - aMinSizeClamp; if (MOZ_UNLIKELY(overflow > 0)) { nscoord contentSize = child->ContentBSize(childWM); @@ -3913,6 +3962,10 @@ MinSize(const GridItemInfo& aGridItem, return s; } + if (aCache->mPercentageBasis.isNothing()) { + aCache->mPercentageBasis.emplace(aState.PercentageBasisFor(aAxis, aGridItem)); + } + // https://drafts.csswg.org/css-grid/#min-size-auto // This calculates the min-content contribution from either a definite // min-width (or min-height depending on aAxis), or the "specified / @@ -3926,7 +3979,8 @@ MinSize(const GridItemInfo& aGridItem, "baseline offset should be zero when not baseline-aligned"); nscoord sz = aGridItem.mBaselineOffset[aAxis] + nsLayoutUtils::MinSizeContributionForAxis(axis, aRC, child, - nsLayoutUtils::MIN_ISIZE); + nsLayoutUtils::MIN_ISIZE, + *aCache->mPercentageBasis); const nsStyleCoord& style = axis == eAxisHorizontal ? stylePos->mMinWidth : stylePos->mMinHeight; auto unit = style.GetUnit(); @@ -3935,9 +3989,6 @@ MinSize(const GridItemInfo& aGridItem, child->StyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE)) { // Now calculate the "content size" part and return whichever is smaller. MOZ_ASSERT(unit != eStyleUnit_Enumerated || sz == NS_UNCONSTRAINEDSIZE); - if (aCache->mPercentageBasis.isNothing()) { - aCache->mPercentageBasis.emplace(aState.PercentageBasisFor(aAxis, aGridItem)); - } sz = std::min(sz, ContentContribution(aGridItem, aState, aRC, aCBWM, aAxis, aCache->mPercentageBasis, nsLayoutUtils::MIN_ISIZE, @@ -3974,28 +4025,16 @@ nsGridContainerFrame::Tracks::CalculateSizes( } } -bool -nsGridContainerFrame::Tracks::HasIntrinsicButNoFlexSizingInRange( - const LineRange& aRange, - TrackSize::StateBits* aState) const +TrackSize::StateBits +nsGridContainerFrame::Tracks::StateBitsForRange(const LineRange& aRange) const { - MOZ_ASSERT(!aRange.IsAuto(), "must have a definite range"); + TrackSize::StateBits state = TrackSize::StateBits(0); const uint32_t start = aRange.mStart; const uint32_t end = aRange.mEnd; - const TrackSize::StateBits selector = - TrackSize::eIntrinsicMinSizing | TrackSize::eIntrinsicMaxSizing; - bool foundIntrinsic = false; for (uint32_t i = start; i < end; ++i) { - TrackSize::StateBits state = mSizes[i].mState; - *aState |= state; - if (state & TrackSize::eFlexMaxSizing) { - return false; - } - if (state & selector) { - foundIntrinsic = true; - } + state |= mSizes[i].mState; } - return foundIntrinsic; + return state; } bool @@ -4010,6 +4049,13 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSizeStep1( CachedIntrinsicSizes cache; TrackSize& sz = mSizes[aRange.mStart]; WritingMode wm = aState.mWM; + + // Check if we need to apply "Automatic Minimum Size" and cache it. + if ((sz.mState & TrackSize::eAutoMinSizing) && + aGridItem.ShouldApplyAutoMinSize(wm, mAxis, aPercentageBasis)) { + aGridItem.mState[mAxis] |= ItemState::eApplyAutoMinSize; + } + // Calculate data for "Automatic Minimum Size" clamping, if needed. bool needed = ((sz.mState & TrackSize::eIntrinsicMinSizing) || aConstraint == SizingConstraint::eNoConstraint) && @@ -4370,6 +4416,55 @@ nsGridContainerFrame::Tracks::AlignBaselineSubtree( } } +template<nsGridContainerFrame::Tracks::TrackSizingPhase phase> +bool +nsGridContainerFrame::Tracks::GrowSizeForSpanningItems( + nsTArray<Step2ItemData>::iterator aIter, + const nsTArray<Step2ItemData>::iterator aIterEnd, + nsTArray<uint32_t>& aTracks, + nsTArray<TrackSize>& aPlan, + nsTArray<TrackSize>& aItemPlan, + TrackSize::StateBits aSelector, + const FitContentClamper& aFitContentClamper, + bool aNeedInfinitelyGrowableFlag) +{ + constexpr bool isMaxSizingPhase = + phase == TrackSizingPhase::eIntrinsicMaximums || + phase == TrackSizingPhase::eMaxContentMaximums; + bool needToUpdateSizes = false; + InitializePlan<phase>(aPlan); + for (; aIter != aIterEnd; ++aIter) { + const Step2ItemData& item = *aIter; + if (!(item.mState & aSelector)) { + continue; + } + if (isMaxSizingPhase) { + for (auto j = item.mLineRange.mStart, end = item.mLineRange.mEnd; j < end; ++j) { + aPlan[j].mState |= TrackSize::eModified; + } + } + nscoord space = item.SizeContributionForPhase<phase>(); + if (space <= 0) { + continue; + } + aTracks.ClearAndRetainStorage(); + space = CollectGrowable<phase>(space, item.mLineRange, aSelector, + aTracks); + if (space > 0) { + DistributeToTrackSizes<phase>(space, aPlan, aItemPlan, aTracks, aSelector, + aFitContentClamper); + needToUpdateSizes = true; + } + } + if (isMaxSizingPhase) { + needToUpdateSizes = true; + } + if (needToUpdateSizes) { + CopyPlanToSize<phase>(aPlan, aNeedInfinitelyGrowableFlag); + } + return needToUpdateSizes; +} + void nsGridContainerFrame::Tracks::ResolveIntrinsicSize( GridReflowInput& aState, @@ -4379,21 +4474,6 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( nscoord aPercentageBasis, SizingConstraint aConstraint) { - // Some data we collect on each item for Step 2 of the algorithm below. - struct Step2ItemData - { - uint32_t mSpan; - TrackSize::StateBits mState; - LineRange mLineRange; - nscoord mMinSize; - nscoord mMinContentContribution; - nscoord mMaxContentContribution; - nsIFrame* mFrame; - static bool IsSpanLessThan(const Step2ItemData& a, const Step2ItemData& b) - { - return a.mSpan < b.mSpan; - } - }; // Resolve Intrinsic Track Sizes // http://dev.w3.org/csswg/css-grid/#algo-content @@ -4418,12 +4498,10 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( for (; !iter.AtEnd(); iter.Next()) { auto& gridItem = aGridItems[iter.GridItemIndex()]; - // Check if we need to apply "Automatic Minimum Size" and cache it. - MOZ_ASSERT(!(gridItem.mState[mAxis] & ItemState::eApplyAutoMinSize), - "Why is eApplyAutoMinSize set already?"); - if (gridItem.ShouldApplyAutoMinSize(wm, mAxis, aPercentageBasis)) { - gridItem.mState[mAxis] |= ItemState::eApplyAutoMinSize; - } + MOZ_ASSERT(!(gridItem.mState[mAxis] & + (ItemState::eApplyAutoMinSize | ItemState::eIsFlexing | + ItemState::eClampMarginBoxMinSize)), + "Why are any of these bits set already?"); const GridArea& area = gridItem.mArea; const LineRange& lineRange = area.*aRange; @@ -4435,8 +4513,17 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( gridItem.mState[mAxis] |= ItemState::eIsFlexing; } } else { - TrackSize::StateBits state = TrackSize::StateBits(0); - if (HasIntrinsicButNoFlexSizingInRange(lineRange, &state)) { + TrackSize::StateBits state = StateBitsForRange(lineRange); + + // Check if we need to apply "Automatic Minimum Size" and cache it. + if ((state & TrackSize::eAutoMinSizing) && + gridItem.ShouldApplyAutoMinSize(wm, mAxis, aPercentageBasis)) { + gridItem.mState[mAxis] |= ItemState::eApplyAutoMinSize; + } + + if ((state & (TrackSize::eIntrinsicMinSizing | + TrackSize::eIntrinsicMaxSizing)) && + !(state & TrackSize::eFlexMaxSizing)) { // Collect data for Step 2. maxSpan = std::max(maxSpan, span); if (span >= stateBitsPerSpan.Length()) { @@ -4500,6 +4587,18 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( // Step 2. if (maxSpan) { + auto fitContentClamper = [&aFunctions, aPercentageBasis] (uint32_t aTrack, + nscoord aMinSize, + nscoord* aSize) + { + nscoord fitContentLimit = + ::ResolveToDefiniteSize(aFunctions.MaxSizingFor(aTrack), aPercentageBasis); + if (*aSize > fitContentLimit) { + *aSize = std::max(aMinSize, fitContentLimit); + return true; + } + return false; + }; // Sort the collected items on span length, shortest first. std::stable_sort(step2Items.begin(), step2Items.end(), Step2ItemData::IsSpanLessThan); @@ -4507,85 +4606,44 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( nsTArray<uint32_t> tracks(maxSpan); nsTArray<TrackSize> plan(mSizes.Length()); plan.SetLength(mSizes.Length()); - for (uint32_t i = 0, len = step2Items.Length(); i < len; ) { - // Start / end index for items of the same span length: - const uint32_t spanGroupStartIndex = i; - uint32_t spanGroupEndIndex = len; - const uint32_t span = step2Items[i].mSpan; - for (++i; i < len; ++i) { - if (step2Items[i].mSpan != span) { - spanGroupEndIndex = i; - break; - } - } - + nsTArray<TrackSize> itemPlan(mSizes.Length()); + itemPlan.SetLength(mSizes.Length()); + // Start / end iterator for items of the same span length: + auto spanGroupStart = step2Items.begin(); + auto spanGroupEnd = spanGroupStart; + const auto end = step2Items.end(); + for (; spanGroupStart != end; spanGroupStart = spanGroupEnd) { + while (spanGroupEnd != end && + !Step2ItemData::IsSpanLessThan(*spanGroupStart, *spanGroupEnd)) { + ++spanGroupEnd; + } + + const uint32_t span = spanGroupStart->mSpan; bool updatedBase = false; // Did we update any mBase in step 2.1 - 2.3? TrackSize::StateBits selector(TrackSize::eIntrinsicMinSizing); if (stateBitsPerSpan[span] & selector) { // Step 2.1 MinSize to intrinsic min-sizing. - for (i = spanGroupStartIndex; i < spanGroupEndIndex; ++i) { - Step2ItemData& item = step2Items[i]; - if (!(item.mState & selector)) { - continue; - } - nscoord space = item.mMinSize; - if (space <= 0) { - continue; - } - tracks.ClearAndRetainStorage(); - space = CollectGrowable(space, mSizes, item.mLineRange, selector, - tracks); - if (space > 0) { - DistributeToTrackBases(space, plan, tracks, selector); - updatedBase = true; - } - } + updatedBase = + GrowSizeForSpanningItems<TrackSizingPhase::eIntrinsicMinimums>( + spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector); } selector = contentBasedMinSelector; if (stateBitsPerSpan[span] & selector) { // Step 2.2 MinContentContribution to min-/max-content (and 'auto' when // sizing under a min-content constraint) min-sizing. - for (i = spanGroupStartIndex; i < spanGroupEndIndex; ++i) { - Step2ItemData& item = step2Items[i]; - if (!(item.mState & selector)) { - continue; - } - nscoord space = item.mMinContentContribution; - if (space <= 0) { - continue; - } - tracks.ClearAndRetainStorage(); - space = CollectGrowable(space, mSizes, item.mLineRange, selector, - tracks); - if (space > 0) { - DistributeToTrackBases(space, plan, tracks, selector); - updatedBase = true; - } - } + updatedBase |= + GrowSizeForSpanningItems<TrackSizingPhase::eContentBasedMinimums>( + spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector); } selector = maxContentMinSelector; if (stateBitsPerSpan[span] & selector) { // Step 2.3 MaxContentContribution to max-content (and 'auto' when // sizing under a max-content constraint) min-sizing. - for (i = spanGroupStartIndex; i < spanGroupEndIndex; ++i) { - Step2ItemData& item = step2Items[i]; - if (!(item.mState & selector)) { - continue; - } - nscoord space = item.mMaxContentContribution; - if (space <= 0) { - continue; - } - tracks.ClearAndRetainStorage(); - space = CollectGrowable(space, mSizes, item.mLineRange, selector, - tracks); - if (space > 0) { - DistributeToTrackBases(space, plan, tracks, selector); - updatedBase = true; - } - } + updatedBase |= + GrowSizeForSpanningItems<TrackSizingPhase::eMaxContentMinimums>( + spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector); } if (updatedBase) { @@ -4596,63 +4654,22 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( } } } - if (stateBitsPerSpan[span] & TrackSize::eIntrinsicMaxSizing) { - plan = mSizes; - for (TrackSize& sz : plan) { - if (sz.mLimit == NS_UNCONSTRAINEDSIZE) { - // use mBase as the planned limit - } else { - sz.mBase = sz.mLimit; - } - } + selector = TrackSize::eIntrinsicMaxSizing; + if (stateBitsPerSpan[span] & selector) { + const bool willRunStep2_6 = + stateBitsPerSpan[span] & TrackSize::eAutoOrMaxContentMaxSizing; // Step 2.5 MinSize to intrinsic max-sizing. - for (i = spanGroupStartIndex; i < spanGroupEndIndex; ++i) { - Step2ItemData& item = step2Items[i]; - if (!(item.mState & TrackSize::eIntrinsicMaxSizing)) { - continue; - } - nscoord space = item.mMinSize; - if (space <= 0) { - continue; - } - tracks.ClearAndRetainStorage(); - space = CollectGrowable(space, plan, item.mLineRange, - TrackSize::eIntrinsicMaxSizing, - tracks); - if (space > 0) { - DistributeToTrackLimits(space, plan, tracks, aFunctions, - aPercentageBasis); - } - } - for (size_t j = 0, len = mSizes.Length(); j < len; ++j) { - TrackSize& sz = plan[j]; - sz.mState &= ~(TrackSize::eFrozen | TrackSize::eSkipGrowUnlimited); - if (sz.mLimit != NS_UNCONSTRAINEDSIZE) { - sz.mLimit = sz.mBase; // collect the results from 2.5 - } - } + GrowSizeForSpanningItems<TrackSizingPhase::eIntrinsicMaximums>( + spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector, + fitContentClamper, willRunStep2_6); - if (stateBitsPerSpan[span] & TrackSize::eAutoOrMaxContentMaxSizing) { + if (willRunStep2_6) { // Step 2.6 MaxContentContribution to max-content max-sizing. - for (i = spanGroupStartIndex; i < spanGroupEndIndex; ++i) { - Step2ItemData& item = step2Items[i]; - if (!(item.mState & TrackSize::eAutoOrMaxContentMaxSizing)) { - continue; - } - nscoord space = item.mMaxContentContribution; - if (space <= 0) { - continue; - } - tracks.ClearAndRetainStorage(); - space = CollectGrowable(space, plan, item.mLineRange, - TrackSize::eAutoOrMaxContentMaxSizing, - tracks); - if (space > 0) { - DistributeToTrackLimits(space, plan, tracks, aFunctions, - aPercentageBasis); - } - } + selector = TrackSize::eAutoOrMaxContentMaxSizing; + GrowSizeForSpanningItems<TrackSizingPhase::eMaxContentMaximums>( + spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector, + fitContentClamper); } } } @@ -4984,6 +5001,7 @@ nsGridContainerFrame::Tracks::AlignJustifyContent( default: MOZ_ASSERT_UNREACHABLE("unknown align-/justify-content value"); between = 0; // just to avoid a compiler warning + roundingError = 0; // just to avoid a compiler warning } between += mGridGap; for (TrackSize& sz : mSizes) { @@ -4998,36 +5016,6 @@ nsGridContainerFrame::Tracks::AlignJustifyContent( MOZ_ASSERT(!roundingError, "we didn't distribute all rounding error?"); } -nscoord -nsGridContainerFrame::Tracks::BackComputedIntrinsicSize( - const TrackSizingFunctions& aFunctions, - const nsStyleCoord& aGridGap) const -{ - // Sum up the current sizes (where percentage tracks were treated as 'auto') - // in 'size'. - nscoord size = 0; - for (size_t i = 0, len = mSizes.Length(); i < len; ++i) { - size += mSizes[i].mBase; - } - - // Add grid-gap contributions to 'size' and calculate a 'percent' sum. - float percent = 0.0f; - size_t numTracks = mSizes.Length(); - if (numTracks > 1) { - const size_t gridGapCount = numTracks - 1; - nscoord gridGapLength; - float gridGapPercent; - if (::GetPercentSizeParts(aGridGap, &gridGapLength, &gridGapPercent)) { - percent = gridGapCount * gridGapPercent; - } else { - gridGapLength = aGridGap.ToLength(); - } - size += gridGapCount * gridGapLength; - } - - return std::max(0, nsLayoutUtils::AddPercents(size, percent)); -} - void nsGridContainerFrame::LineRange::ToPositionAndLength( const nsTArray<TrackSize>& aTrackSizes, nscoord* aPos, nscoord* aLength) const @@ -5077,10 +5065,15 @@ nsGridContainerFrame::LineRange::ToPositionAndLengthForAbsPos( : GridLineSide::eBeforeGridGap; nscoord endPos = aTracks.GridLineEdge(mEnd, side); *aLength = std::max(aGridOrigin + endPos, 0); - } else { + } else if (MOZ_LIKELY(mStart != mEnd)) { nscoord pos; ToPositionAndLength(aTracks.mSizes, &pos, aLength); *aPos = aGridOrigin + pos; + } else { + // The grid area only covers removed 'auto-fit' tracks. + nscoord pos = aTracks.GridLineEdge(mStart, GridLineSide::eBeforeGridGap); + *aPos = aGridOrigin + pos; + *aLength = nscoord(0); } } } @@ -6188,7 +6181,7 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext, LogicalSize computedSize(wm, computedISize, computedBSize); nscoord consumedBSize = 0; - nscoord bSize; + nscoord bSize = 0; if (!prevInFlow) { Grid grid; grid.PlaceGridItems(gridReflowInput, aReflowInput.ComputedMinSize(), @@ -6196,7 +6189,12 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext, gridReflowInput.CalculateTrackSizes(grid, computedSize, SizingConstraint::eNoConstraint); - bSize = computedSize.BSize(wm); + // Note: we can't use GridLineEdge here since we haven't calculated + // the rows' mPosition yet (happens in AlignJustifyContent below). + for (const auto& sz : gridReflowInput.mRows.mSizes) { + bSize += sz.mBase; + } + bSize += gridReflowInput.mRows.SumOfGridGaps(); } else { consumedBSize = GetConsumedBSize(); gridReflowInput.InitializeForContinuation(this, consumedBSize); @@ -6595,8 +6593,14 @@ nsGridContainerFrame::IntrinsicISize(nsRenderingContext* aRenderingContext, state.mCols.CalculateSizes(state, state.mGridItems, state.mColFunctions, NS_UNCONSTRAINEDSIZE, &GridArea::mCols, constraint); - return state.mCols.BackComputedIntrinsicSize(state.mColFunctions, - state.mGridStyle->mGridColumnGap); + state.mCols.mGridGap = + nsLayoutUtils::ResolveGapToLength(state.mGridStyle->mGridColumnGap, + NS_UNCONSTRAINEDSIZE); + nscoord length = 0; + for (const TrackSize& sz : state.mCols.mSizes) { + length += sz.mBase; + } + return length + state.mCols.SumOfGridGaps(); } nscoord @@ -7113,6 +7117,9 @@ nsGridContainerFrame::TrackSize::Dump() const if (mState & eFrozen) { printf("frozen "); } + if (mState & eModified) { + printf("modified "); + } if (mState & eBreakBefore) { printf("break-before "); } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index ec3568483..57f5c460c 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -25,6 +25,7 @@ #include "CaretAssociationHint.h" #include "FrameProperties.h" +#include "LayoutConstants.h" #include "mozilla/layout/FrameChildList.h" #include "mozilla/Maybe.h" #include "mozilla/WritingModes.h" @@ -130,30 +131,12 @@ typedef uint32_t nsSplittableType; #define NS_FRAME_IS_NOT_SPLITTABLE(type)\ (0 == ((type) & NS_FRAME_SPLITTABLE)) -#define NS_INTRINSIC_WIDTH_UNKNOWN nscoord_MIN - //---------------------------------------------------------------------- #define NS_SUBTREE_DIRTY(_frame) \ (((_frame)->GetStateBits() & \ (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0) -/** - * Constant used to indicate an unconstrained size. - * - * @see #Reflow() - */ -#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE - -#define NS_INTRINSICSIZE NS_UNCONSTRAINEDSIZE -#define NS_AUTOHEIGHT NS_UNCONSTRAINEDSIZE -// +1 is to avoid clamped huge margin values being processed as auto margins -#define NS_AUTOMARGIN (NS_UNCONSTRAINEDSIZE + 1) -#define NS_AUTOOFFSET NS_UNCONSTRAINEDSIZE -// NOTE: there are assumptions all over that these have the same value, namely NS_UNCONSTRAINEDSIZE -// if any are changed to be a value other than NS_UNCONSTRAINEDSIZE -// at least update AdjustComputedHeight/Width and test ad nauseum - // 1 million CSS pixels less than our max app unit measure. // For reflowing with an "infinite" available inline space per [css-sizing]. // (reflowing with an NS_UNCONSTRAINEDSIZE available inline size isn't allowed @@ -2050,23 +2033,27 @@ public: /** * Return the horizontal components of padding, border, and margin * that contribute to the intrinsic width that applies to the parent. + * @param aPercentageBasis the percentage basis to use for padding/margin - + * i.e. the Containing Block's inline-size */ struct IntrinsicISizeOffsetData { nscoord hPadding, hBorder, hMargin; - float hPctPadding, hPctMargin; IntrinsicISizeOffsetData() : hPadding(0), hBorder(0), hMargin(0) - , hPctPadding(0.0f), hPctMargin(0.0f) {} }; - virtual IntrinsicISizeOffsetData IntrinsicISizeOffsets() = 0; + virtual IntrinsicISizeOffsetData + IntrinsicISizeOffsets(nscoord aPercentageBasis = NS_UNCONSTRAINEDSIZE) = 0; /** * Return the bsize components of padding, border, and margin * that contribute to the intrinsic width that applies to the parent. + * @param aPercentageBasis the percentage basis to use for padding/margin - + * i.e. the Containing Block's inline-size */ - IntrinsicISizeOffsetData IntrinsicBSizeOffsets(); + IntrinsicISizeOffsetData + IntrinsicBSizeOffsets(nscoord aPercentageBasis = NS_UNCONSTRAINEDSIZE); virtual mozilla::IntrinsicSize GetIntrinsicSize() = 0; diff --git a/layout/generic/test/mochitest.ini b/layout/generic/test/mochitest.ini index 934ffc8a4..33dacddab 100644 --- a/layout/generic/test/mochitest.ini +++ b/layout/generic/test/mochitest.ini @@ -138,3 +138,7 @@ support-files = file_taintedfilters_feDisplacementMap-tainted-1.svg file_tainted support-files = file_scroll_position_restore.html [test_scroll_animation_restore.html] [test_scroll_position_iframe.html] +[test_grid_track_sizing_algo_001.html] +skip-if = debug == true # the test is slow +[test_grid_track_sizing_algo_002.html] +skip-if = debug == true # the test is slow diff --git a/layout/generic/test/test_grid_track_sizing_algo_001.html b/layout/generic/test/test_grid_track_sizing_algo_001.html new file mode 100644 index 000000000..68956c2df --- /dev/null +++ b/layout/generic/test/test_grid_track_sizing_algo_001.html @@ -0,0 +1,1641 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> + <meta charset="utf-8"> + <title>CSS Grid Test: intrinsic track sizing with spanning items</title> + <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1425599"> + <link rel="help" href="https://drafts.csswg.org/css-grid/#algo-content"> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <style type="text/css"> +body,html { color:black; background:white; font-family:monospace; font-size:16px; padding:0; margin:0; } +* { vertical-align: top; line-height: 1px; } + +.grid { + display: inline-grid; + grid-template-rows: 1px; + grid-auto-rows: 10px; + border: 1px solid; + place-content: start; + place-items: start; +} + +x { + grid-row: 1; + height: 1px; + background: grey; +} + +x:nth-child(1) { background: lime; width: 3px; grid-column: 1/span 2; } +x:nth-child(2) { background: silver; width: 6px; grid-column: 2/span 4; } +x:nth-child(3) { background: blue; width: 12px; grid-column: 2/span 2; } + </style> +</head> +<body> + +<script> +let min1 = [ + "0", "4px" +]; +let min2 = [ + "auto", "min-content", "max-content" +]; +let max1 = [ + "8px" +]; +let max2 = [ + "auto", "min-content", "max-content" +]; + +var track = []; +min1.forEach((min) => { max2.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +min2.forEach((min) => { max2.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +min2.forEach((min) => { max1.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +min2.forEach((min) => { max2.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +track.push("fit-content(8px)"); + +var cols = []; +track.forEach((c1) => { + cols.push(c1 + " " + c1 + " " + c1 + " " + c1 + " " + c1); + track.forEach((c2) => { + if (c1 != c2) { + cols.push(c1 + " " + c2 + " " + c2 + " " + c2 + " " + c2); + cols.push(c2 + " " + c1 + " " + c1 + " " + c2 + " " + c2); + } +})}); + +document.body.style.display = 'none'; +cols.forEach((col) => { + let grid = document.createElement('div'); + grid.className = "grid"; + grid.style.gridTemplateColumns = col; + grid.appendChild(document.createElement('x')) + grid.appendChild(document.createElement('x')) + grid.appendChild(document.createElement('x')) + document.body.appendChild(grid); +}); +document.body.style.display = ''; +</script> + +<script> +var actual = []; +[...document.querySelectorAll('.grid')].forEach(function(e) { + let cs = window.getComputedStyle(e); + actual.push([cs.gridTemplateColumns, cs.width]); +}); + +function dumpResult() { + var s = ""; + actual.forEach(v => { + s += '["' + v[0] + '","' + v[1] + '"],\n'; + }); + let pre = document.createElement("pre"); + pre.innerHTML = s; + document.body.appendChild(pre); +} + +let expected = [ +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 8px 8px 8px 8px","32px"], +["8px 6px 6px 8px 8px","36px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 3px 3px","21px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 4px 4px","24px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 8px 8px 8px 8px","36px"], +["8px 6px 6px 8px 8px","36px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["4px 6px 6px 0px 0px","16px"], +["0px 6px 6px 0px 0px","12px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 0px 0px","20px"], +["0px 8px 8px 0px 0px","16px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 4px 4px","28px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["8px 6px 6px 0px 0px","20px"], +["1.5px 8px 8px 0px 0px","17.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["3px 6px 6px 0px 0px","15px"], +["0px 6px 6px 0px 0px","12px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["0px 6px 6px 4px 4px","20px"], +["4px 6px 6px 4px 4px","24px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 8px 8px 8px 8px","33.5px"], +["8px 6px 6px 8px 8px","36px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +["1.5px 6px 6px 0px 0px","13.5px"], +]; + +function test() { + ok(expected.length > 0, "sanity check"); + for (i = 0; i < expected.length; ++i) { + var msg = ""; + if (actual[i][0] != expected[i][0]) { + msg = "'grid-template-columns' for grid index " + i + ":\n" + [...document.querySelectorAll('.grid')][i].outerHTML; + is(actual[i][0], expected[i][0], msg); + } + if (actual[i][1] != expected[i][1]) { + msg = "'width' for grid index " + i + ":\n" + [...document.querySelectorAll('.grid')][i].outerHTML; + is(actual[i][1], expected[i][1], msg); + } + if (msg != "") { + i = expected.length; // stop after first failed grid by default + } + } + SimpleTest.finish(); +} + +</script> + +<script> +window.onload = function() { setTimeout(test, 0); }; +SimpleTest.waitForExplicitFinish(); +</script> + +</body> +</html> diff --git a/layout/generic/test/test_grid_track_sizing_algo_002.html b/layout/generic/test/test_grid_track_sizing_algo_002.html new file mode 100644 index 000000000..40f50e20f --- /dev/null +++ b/layout/generic/test/test_grid_track_sizing_algo_002.html @@ -0,0 +1,1641 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> + <meta charset="utf-8"> + <title>CSS Grid Test: intrinsic track sizing with spanning items</title> + <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1425599"> + <link rel="help" href="https://drafts.csswg.org/css-grid/#algo-content"> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <style type="text/css"> +body,html { color:black; background:white; font-family:monospace; font-size:16px; padding:0; margin:0; } +* { vertical-align: top; line-height: 1px; } + +.grid { + display: inline-grid; + grid-template-rows: 1px; + grid-auto-rows: 10px; + border: 1px solid; + place-content: start; + place-items: start; +} + +x { + grid-row: 1; + height: 1px; + background: grey; +} + +x:nth-child(1) { background: lime; width: 3px; grid-column: 1/span 2; } +x:nth-child(2) { background: silver; width: 6px; grid-column: 2/span 3; } +x:nth-child(3) { background: blue; width: 12px; grid-column: 1/span 2; } + </style> +</head> +<body> + +<script> +let min1 = [ + "0", "4px" +]; +let min2 = [ + "auto", "min-content", "max-content" +]; +let max1 = [ + "8px" +]; +let max2 = [ + "auto", "min-content", "max-content" +]; + +var track = []; +min1.forEach((min) => { max2.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +min2.forEach((min) => { max2.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +min2.forEach((min) => { max1.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +min2.forEach((min) => { max2.forEach((max) => { + track.push("minmax(" + min + "," + max + ")"); +})}); +track.push("fit-content(8px)"); + +var cols = []; +track.forEach((c1) => { + cols.push(c1 + " " + c1 + " " + c1 + " " + c1 + " " + c1); + track.forEach((c2) => { + if (c1 != c2) { + cols.push(c1 + " " + c2 + " " + c2 + " " + c2 + " " + c2); + cols.push(c2 + " " + c1 + " " + c1 + " " + c2 + " " + c2); + } +})}); + +document.body.style.display = 'none'; +cols.forEach((col) => { + let grid = document.createElement('div'); + grid.className = "grid"; + grid.style.gridTemplateColumns = col; + grid.appendChild(document.createElement('x')) + grid.appendChild(document.createElement('x')) + grid.appendChild(document.createElement('x')) + document.body.appendChild(grid); +}); +document.body.style.display = ''; +</script> + +<script> +var actual = []; +[...document.querySelectorAll('.grid')].forEach(function(e) { + let cs = window.getComputedStyle(e); + actual.push([cs.gridTemplateColumns, cs.width]); +}); + +function dumpResult() { + var s = ""; + actual.forEach(v => { + s += '["' + v[0] + '","' + v[1] + '"],\n'; + }); + let pre = document.createElement("pre"); + pre.innerHTML = s; + document.body.appendChild(pre); +} + +let expected = [ +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["4px 8px 4px 4px 4px","24px"], +["8px 4px 0px 4px 4px","20px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 8px 8px 8px","36px"], +["12px 0px 0px 8px 8px","28px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 0px 6px 0px","18px"], +["6px 6px 4px 4px 4px","24px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["6px 6px 4px 4px 4px","24px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["6px 6px 4px 4px 4px","24px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["8px 4px 1px 1px 0px","14px"], +["4px 8px 4px 0px 0px","16px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["6px 6px 4px 4px 4px","24px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 8px 8px 8px","36px"], +["8px 4px 4px 8px 8px","32px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["4px 8px 0px 0px 0px","12px"], +["8px 4px 4px 0px 0px","16px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["8px 8px 8px 8px 8px","40px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 8px 8px 8px 8px","40px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 8px 8px 8px 8px","40px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 8px 0px 0px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 8px 4px 4px","28px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 8px 8px 8px 8px","40px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["8px 6px 0px 0px 0px","14px"], +["6px 8px 8px 0px 0px","22px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["12px 0px 3px 3px 0px","18px"], +["0px 12px 0px 0px 0px","12px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["8px 4px 4px 4px 4px","24px"], +["4px 8px 0px 4px 4px","20px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 8px 8px 8px 8px","38px"], +["8px 6px 0px 8px 8px","30px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +["6px 6px 0px 0px 0px","12px"], +]; + +function test() { + ok(expected.length > 0, "sanity check"); + for (i = 0; i < expected.length; ++i) { + var msg = ""; + if (actual[i][0] != expected[i][0]) { + msg = "'grid-template-columns' for grid index " + i + ":\n" + [...document.querySelectorAll('.grid')][i].outerHTML; + is(actual[i][0], expected[i][0], msg); + } + if (actual[i][1] != expected[i][1]) { + msg = "'width' for grid index " + i + ":\n" + [...document.querySelectorAll('.grid')][i].outerHTML; + is(actual[i][1], expected[i][1], msg); + } + if (msg != "") { + i = expected.length; // stop after first failed grid by default + } + } + SimpleTest.finish(); +} + +</script> + +<script> +window.onload = function() { setTimeout(test, 0); }; +SimpleTest.waitForExplicitFinish(); +</script> + +</body> +</html> diff --git a/layout/reftests/bugs/403519-2-ref.html b/layout/reftests/bugs/403519-2-ref.html index e00fb5e24..72176a89a 100644 --- a/layout/reftests/bugs/403519-2-ref.html +++ b/layout/reftests/bugs/403519-2-ref.html @@ -17,7 +17,7 @@ table { <body> <table> <tbody><tr> - <td colspan="2" style="width: 100%;"><div> </div></td> + <td colspan="2"><div> </div></td> <td>b</td> </tr> <tr> diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html index 8858b4ea8..f2c76f78b 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html @@ -65,32 +65,49 @@ b40 { .h.r { height: 42px; width: 42px; - /* This margin-left is 20% of 98px-wide grid area */ - margin-left: 19.6px; - /* This padding-bottom is 10% of 98px wide grid area */ - /* This padding-left is 30% of 98px wide grid area */ - padding: 1px 3px 9.8px 29.4px; + /* 49px is the percentage basis, i.e. the column size */ + margin-left: calc(0.2 * 49px); + padding: 1px 3px calc(0.1 * 49px) calc(0.3 * 49px); } .v.r { height: 42px; width: 42px; - /* This margin-left is 20% of 54px-wide grid area */ - margin-left: 10.8px; - /* This padding-bottom is 10% of 54px wide grid area */ - /* This padding-left is 30% of 54px wide grid area */ - padding: 1px 3px 5.4px 16.2px; + /* 27px is the percentage basis, i.e. the column size */ + margin-left: calc(0.2 * 27px); + padding: 1px 3px calc(0.1 * 27px) calc(0.3 * 27px); } .r { position:relative; } +.t4 { width: 49px; + height: calc(10px /* item min-height */ + + 7px /* item margin-top */ + + 1px /* item padding-top */ + + 1px /* item border-top */ + + calc(0.5 * 49px) /* item margin-bottom */ + + calc(0.1 * 49px) /* item padding-bottom */); + } + .t6 { width:46px; } -.t8 { width:118px; height: 102.5px; } +.t8 { width: 27px; + height: calc(30px /* item min-height */ + + 7px /* item margin-top */ + + 3px /* item padding-top */ + + 1px /* item border-top */ + + calc(0.5 * 27px) /* item margin-bottom */ + + calc(0.1 * 27px) /* item padding-bottom */); + } xx { display: block; background: lime; - padding:32px 32px 16px 32px; - margin: 0 0 32px 16px; + padding: 32px 32px calc(0.2 * 32px) calc(0.4 * 32px); + margin: 0 0 calc(0.4 * 32px) calc(0.2 * 32px); +} +.t9, .t10 { + position: relative; + z-index: 1; + grid: calc(32px + calc(0.4 * 32px) + calc(0.2 * 32px)) 0 / 32px; } </style> </head> @@ -100,15 +117,15 @@ xx { <div class="grid"><span class="h"><x></x></span></div> <div class="grid"><span class="h bb"><x></x></span></div> <div class="grid"><span class="h"><x></x></span><span class="h"><x></x></span></div> -<div class="grid" style="grid:48px / 122px"><span class="h r"><b40></b40></span></div> +<div class="grid t4"><span class="h r"><b40></b40></span></div> <br> <div class="grid"><span class="v"><x></x></span></div> -<div class="grid t6"><span class="v bb"><x></x></span></div> +<div class="grid"><span class="v bb"><x></x></span></div> <div class="grid"><span class="v"><x></x></span><span class="v"><x></x></span></div> <div class="grid t8"><span class="v r"><b40></b40></span></div> -<div class="grid"><xx class="v"></xx></div> -<div class="grid v"><xx class="h"></xx></div> +<div class="grid t9"><xx class="v"></xx></div> +<div class="grid v t10"><xx class="h"></xx></div> </body> </html> diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-002-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-002-ref.html index 35f596928..183f00e24 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-002-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-002-ref.html @@ -36,7 +36,7 @@ var coltest = [ "min-height:40%", "min-height:40%; max-width:30px" ]; var results = [ -"360px", "360px", "360px", "24px", "24px", "360px", "80px", "24px", "24px", "24px", +"24px", "24px", "24px", "24px", "24px", "24px", "80px", "24px", "24px", "24px", "24px", "24px", "24px" ]; var item_width = [ diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-004-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-004-ref.html index caef8b031..6533c97b6 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-004-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-min-content-min-size-004-ref.html @@ -36,7 +36,7 @@ var rowtest = [ "min-width:80%; max-height:20px", "min-width:50%", "margin-left: 50px; width:50%" ]; var results = [ -"0/2px", "0/2px", "0/4px", "0/2px", "0/2px", "0/2px", "12px/2px", "20px/2px", "20px/2px", "24px/2px", "24px/52px" +"0/2px", "0/2px", "0/4px", "0/2px", "0/2px", "0/2px", "12px/2px", "20px/2px", "20px/2px", "24px/2px", "312px/52px" ]; var item_height = [ "0", "0", "0", "0", "0", "0", "12px", "20px", "20px", "24px", "312px" diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-percent-001-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-percent-001-ref.html index fd2302add..d435f8f3e 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-percent-001-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-percent-001-ref.html @@ -54,9 +54,9 @@ br { clear:both; } .c10 { grid-template-columns: minmax(10px,0) 1fr; } #px-border .c10 { grid-template-columns: minmax(30px,0) 1fr; } -#percent-border .c100 { grid-template-columns: 111px 0; } -#percent-border .c100calc100 { grid-template-columns: 100px 11px; } -#percent-border .c10 { grid-template-columns: minmax(11px,0) 0; } +#percent-border .c100 { grid-template-columns: 100px 0; } +#percent-border .c100calc100 { grid-template-columns: 100px 10px; } +#percent-border .c10 { grid-template-columns: minmax(10px,0) 0; } #percent-border .c100100 { grid-template-columns: minmax(100px,0) 150px; } #percent-border .c200 { grid-template-columns: 250px; } </style> @@ -99,7 +99,7 @@ var grids = [ "grid c100", "grid c100", "grid", -"grid c200", +"grid c100", "grid c10", "grid c100", "grid c100", @@ -110,7 +110,7 @@ var grids = [ "grid c100", "grid c100", "grid", -"grid c200", +"grid c100", "grid c10", "grid c100", "grid c100", diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-002-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-002-ref.html index 8dcdd563b..528d63bc7 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-002-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-002-ref.html @@ -36,7 +36,7 @@ var coltest = [ "min-height:40%", "min-height:40%; max-width:30px" ]; var results = [ -"360px", "360px", "360px", "24px", "24px", "360px", "80px", "24px", "20px", "24px", +"360px", "0px", "0px", "0px", "24px", "360px", "80px", "24px", "20px", "24px", "6px", "24px", "24px" ]; var item_width = [ diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-004-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-004-ref.html index 36a2d4920..4eb623b7d 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-004-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-transferred-size-004-ref.html @@ -36,7 +36,7 @@ var rowtest = [ "min-width:80%; max-height:20px", "min-width:50%", "margin-left: 50px; width:50%" ]; var results = [ -"0/2px", "0/2px", "0/4px", "0/2px", "0/2px", "0/2px", "12px/2px", "20px/2px", "20px/2px", "24px/2px", "24px/52px" +"0/2px", "0/2px", "0/4px", "0/2px", "0/2px", "0/2px", "12px/2px", "20px/2px", "20px/2px", "24px/2px", "312px/52px" ]; var item_height = [ "0", "0", "0", "0", "0", "0", "12px", "20px", "20px", "24px", "312px" diff --git a/layout/reftests/css-grid/grid-col-max-sizing-max-content-001-ref.html b/layout/reftests/css-grid/grid-col-max-sizing-max-content-001-ref.html index eda06249b..da30a8b89 100644 --- a/layout/reftests/css-grid/grid-col-max-sizing-max-content-001-ref.html +++ b/layout/reftests/css-grid/grid-col-max-sizing-max-content-001-ref.html @@ -17,9 +17,9 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; clear:left; } -.c1 { min-width:40px; margin-bottom: 2px; margin-right: 47px; } +.c1 { width:40px; margin-bottom: 2px; margin-right: 47px; } .r1 { min-width:70px; margin-left: 38px; margin-top: 2px; } -.c3 { min-width:0; margin: 2px 18px 1px 85px; } +.c3 { width:10px; margin: 2px 18px 1px 71px; } span { display: block; @@ -52,21 +52,22 @@ x { display:inline-block; width:10px; height:18px; } <span class="r1"><x> </x></span> <span class="r1"><x> </x></span> </div> + <div class="grid" style="width:436px"> -<span class="c1" style="margin-right:41px"><x> </x></span> +<span class="c1" style="width:374px; margin-right:41px"><x> </x></span> <span class="r1" style="margin-left:5px"><x> </x></span> <span class="c3" style="margin-left:405px; float:left;margin-top:1px;"><x> </x></span> </div> <div class="grid" style="width:500px;"> -<span class="c1" style="min-width:20px;margin-right:448px"><x> </x></span> +<span class="c1" style="width:20px;margin-right:448px"><x> </x></span> <span class="r1" style="min-width:10px;margin-left:28px; margin-right:426px"><x> </x></span> <span class="r1" style="min-width:30px;margin-left:28px; margin-right:426px"><x> </x></span> <span class="r1" style="min-width:10px;margin-left:28px; margin-right:426px"><x> </x></span> </div> <div class="grid" style="width:583px;"> -<span class="c1" style="margin-right:55px"><x> </x></span> +<span class="c1" style="width:507px; margin-right:55px"><x> </x></span> <span class="r1"><x> </x></span> <span class="c3" style="margin-left:538px; float:left;margin-top:1px;"><x> </x></span> </div> @@ -74,13 +75,13 @@ x { display:inline-block; width:10px; height:18px; } <div class="grid" style="width:389px;"> <span class="c1" style="width:100px"><x> </x></span> <span class="r1" style="width:300px;margin-left:68px;"><x> </x></span> -<span class="c3" style="margin-left:245px;float:left;margin-top:1px;"><x> </x></span> +<span class="c3" style="margin-left:131px;float:left;margin-top:1px;"><x> </x></span> </div> <div class="grid" style="width:389px;"> <span class="c1" style="width:100px"><x> </x></span> <span class="r1" style="width:300px;margin-left:68px;"><x> </x></span> -<span class="c3" style="margin-left:245px;float:left;margin-top:1px;"><x> </x></span> +<span class="c3" style="margin-left:131px;float:left;margin-top:1px;"><x> </x></span> </div> diff --git a/layout/reftests/css-grid/grid-col-max-sizing-max-content-002-ref.html b/layout/reftests/css-grid/grid-col-max-sizing-max-content-002-ref.html index 23ca12e7b..eeb4e407f 100644 --- a/layout/reftests/css-grid/grid-col-max-sizing-max-content-002-ref.html +++ b/layout/reftests/css-grid/grid-col-max-sizing-max-content-002-ref.html @@ -21,9 +21,9 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; clear:left; } -.c1 { min-width:40px; margin-bottom: 2px; margin-right: 47px; } +.c1 { width:40px; margin-bottom: 2px; margin-right: 47px; } .r1 { min-width:70px; margin-left: 38px; margin-top: 2px; } -.c3 { min-width:0; margin: 2px 18px 1px 85px; } +.c3 { width:10px; margin: 2px 18px 1px 71px; } span { display: block; @@ -56,21 +56,22 @@ x { display:inline-block; width:10px; height:18px; } <span class="r1"><x> </x></span> <span class="r1"><x> </x></span> </div></div> + <div class="wrap"><div class="grid" style="width:436px"> -<span class="c1" style="margin-right:41px"><x> </x></span> +<span class="c1" style="width:374px; margin-right:41px"><x> </x></span> <span class="r1" style="margin-left:5px"><x> </x></span> <span class="c3" style="margin-left:405px; float:left;margin-top:1px;"><x> </x></span> </div></div> <div class="wrap" style="float:left;"><div class="grid" style="width:500px;"> -<span class="c1" style="min-width:20px;margin-right:448px"><x> </x></span> +<span class="c1" style="width:20px;margin-right:448px"><x> </x></span> <span class="r1" style="min-width:10px;margin-left:28px; margin-right:426px"><x> </x></span> <span class="r1" style="min-width:30px;margin-left:28px; margin-right:426px"><x> </x></span> <span class="r1" style="min-width:10px;margin-left:28px; margin-right:426px"><x> </x></span> </div></div> <div class="wrap"><div class="grid" style="width:583px;"> -<span class="c1" style="margin-right:55px"><x> </x></span> +<span class="c1" style="width:507px; margin-right:55px"><x> </x></span> <span class="r1"><x> </x></span> <span class="c3" style="margin-left:538px; float:left;margin-top:1px;"><x> </x></span> </div></div> @@ -78,13 +79,13 @@ x { display:inline-block; width:10px; height:18px; } <div class="wrap"><div class="grid" style="width:389px;"> <span class="c1" style="width:100px"><x> </x></span> <span class="r1" style="width:300px;margin-left:68px;"><x> </x></span> -<span class="c3" style="margin-left:245px;float:left;margin-top:1px;"><x> </x></span> +<span class="c3" style="margin-left:131px;float:left;margin-top:1px;"><x> </x></span> </div></div> <div class="wrap"><div class="grid" style="width:389px;"> <span class="c1" style="width:100px"><x> </x></span> <span class="r1" style="width:300px;margin-left:68px;"><x> </x></span> -<span class="c3" style="margin-left:245px;float:left;margin-top:1px;"><x> </x></span> +<span class="c3" style="margin-left:131px;float:left;margin-top:1px;"><x> </x></span> </div></div> diff --git a/layout/reftests/css-grid/grid-flex-min-sizing-002-ref.html b/layout/reftests/css-grid/grid-flex-min-sizing-002-ref.html index d9af7e43c..d811447ff 100644 --- a/layout/reftests/css-grid/grid-flex-min-sizing-002-ref.html +++ b/layout/reftests/css-grid/grid-flex-min-sizing-002-ref.html @@ -127,10 +127,10 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px } .gF { - grid-template-columns: 22px - 1px - 1px - auto; + grid-template-columns: 2px + 20px + 2px + 0; } diff --git a/layout/reftests/css-grid/grid-item-sizing-percent-003-ref.html b/layout/reftests/css-grid/grid-item-sizing-percent-003-ref.html index fb4d15ff8..a55dcc989 100644 --- a/layout/reftests/css-grid/grid-item-sizing-percent-003-ref.html +++ b/layout/reftests/css-grid/grid-item-sizing-percent-003-ref.html @@ -69,67 +69,67 @@ a { <div style="float:left"> <div class="grid" style="grid-template-rows:calc(12px)"><div class="item"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(15px/.9)"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:20px"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> <div class="grid" style="grid-template-rows:calc(18px)"><div class="item pbox b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(21px/0.9)"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(21px/.9)"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(21px/.9)"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:26px"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 36px"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 36px"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> </div> <div style="float:left" class="maxw"> <div class="grid" style="grid-template-rows:calc(12px)"><div class="item"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(15px/.9)"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:20px"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> <div class="grid" style="grid-template-rows:calc(18px)"><div class="item pbox b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(21px/.9)"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(21px/.9)"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(21px/.9)"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:26px"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 36px"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 36px"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> </div> <div style="float:left" class="minw"> <div class="grid" style="grid-template-rows:calc(12px)"><div class="item"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(15px/.9)"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:20px"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> <div class="grid" style="grid-template-rows:calc(18px)"><div class="item pbox b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(21px/.9)"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(21px/.9)"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(21px/.9)"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:26px"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 36px"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 36px"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> </div> <div style="float:left"> -<div class="grid" style="grid-template-rows:calc(15px/.9)"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(22.5px)"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(30px)"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(30px)"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:20px"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:28px"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:34px"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 54px"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> </div> <br clear="all"> <div style="float:left" class="maxw"> -<div class="grid" style="grid-template-rows:calc(15px/.9)"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(22.5px)"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(30px)"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(30px)"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:20px"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:28px"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:34px"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 54px"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> </div> <div style="float:left" class="minw"> -<div class="grid" style="grid-template-rows:calc(15px/.9)"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(15px/.9)"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(22.5px)"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:calc(30px)"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-rows:0 calc(30px)"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:20px"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 30px"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:28px"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:34px"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-rows:0 54px"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> </div> diff --git a/layout/reftests/css-grid/grid-item-sizing-percent-004-ref.html b/layout/reftests/css-grid/grid-item-sizing-percent-004-ref.html index 51f71e662..96365b468 100644 --- a/layout/reftests/css-grid/grid-item-sizing-percent-004-ref.html +++ b/layout/reftests/css-grid/grid-item-sizing-percent-004-ref.html @@ -62,71 +62,71 @@ a { <div style="float:left"> <div class="grid" style="grid-template-columns:calc(10px)"><div class="item"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(18.75px)"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(18.75px)"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:15px"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 15px"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> <div class="grid" style="grid-template-columns:calc(16px)"><div class="item pbox b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(26.25px)"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(51.25px)"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(26.25px)"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:21px"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 41px"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 21px"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> </div> <br clear="all"> <div style="float:left" class="maxw"> <div class="grid" style="grid-template-columns:calc(30px)"><div class="item"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(43.75px)"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:35px"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> <div class="grid" style="grid-template-columns:calc(36px)"><div class="item pbox b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(51.25px)"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(51.25px)"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(51.25px)"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:41px"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 41px"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 41px"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> </div> <br clear="all"> <div style="float:left" class="minw"> <div class="grid" style="grid-template-columns:calc(10px)"><div class="item"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(18.75px)"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(43.75px)"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(18.75px)"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:15px"><div class="item pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 pbox p"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 15px"><div class="item c2 pbox p"><x></x><x></x><x></x></div><a></a></div> <div class="grid" style="grid-template-columns:calc(16px)"><div class="item pbox b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(26.25px)"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(51.25px)"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(26.25px)"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:21px"><div class="item pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 41px"><div class="item c1 pbox p b"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 21px"><div class="item c2 pbox p b"><x></x><x></x><x></x></div><a></a></div> </div> <div style="float:left"> -<div class="grid" style="grid-template-columns:calc(15px/.9)"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(35px/.9)"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(15px/.9)"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(20px/.7)"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(37.15px)"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(37.15px)"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:15px"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 15px"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:20px"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:26px"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 26px"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> </div> <br clear="all"> <div style="float:left" class="maxw"> -<div class="grid" style="grid-template-columns:calc(35px/.9)"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(35px/.9)"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(35px/.9)"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(57.15px)"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(46px/.7)"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(46px/.7)"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:35px"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:40px"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:46px"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 46px"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> </div> <div style="float:left" class="minw"> -<div class="grid" style="grid-template-columns:calc(15px/.9)"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(35px/.9)"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(15px/.9)"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(20px/.7)"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:calc(37.15px)"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> -<div class="grid" style="grid-template-columns:0 calc(37.15px)"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:15px"><div class="item pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 35px"><div class="item c1 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 15px"><div class="item c2 pbox m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:20px"><div class="item pbox p m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:26px"><div class="item pbox p b m"><x></x><x></x><x></x></div><a></a></div> +<div class="grid" style="grid-template-columns:0 26px"><div class="item c2 pbox p b m"><x></x><x></x><x></x></div><a></a></div> </div> diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-004-ref.html b/layout/reftests/css-grid/grid-max-sizing-flex-004-ref.html index 6446c0ee6..b0ac02bf5 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-004-ref.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-004-ref.html @@ -51,8 +51,8 @@ x { display:inline-block; height:10px; width:18px; } <div class="grid flex" style="width:1px;height:1px;"><span class="c1" style="margin-top:1px"><x></x></span></div> --> -<div class="grid mm" style="width:0;height:0;"><span class="c1" style="min-width:23px;min-height:10px"><x></x></span><span class="c2" style="position:relative;left:14px;width:18px;min-width:0;z-index:-1"><x></x></span></div> -<div class="grid mm" style="width:1px;height:1px;"><span class="c1" style="min-width:23px;min-height:10px"><x></x></span><span class="c2" style="position:relative;left:14px;width:18px;min-width:0;z-index:-1"><x></x></span></div> +<div class="grid mm" style="width:0;height:0;"><span class="c1" style="min-width:18px;min-height:10px"><x></x></span><span class="c2" style="position:relative;left:14px;width:18px;min-width:0;z-index:-1"><x></x></span></div> +<div class="grid mm" style="width:1px;height:1px;"><span class="c1" style="min-width:18px;min-height:10px"><x></x></span><span class="c2" style="position:relative;left:14px;width:18px;min-width:0;z-index:-1"><x></x></span></div> <!-- TODO: fails due to broken align:stretch <div class="grid zero" style="width:0;height:0;"><span class="c1"><x></x></span></div> <div class="grid zero" style="width:1px;height:1px;"><span class="c1"><x></x></span></div> diff --git a/layout/reftests/css-grid/grid-percent-grid-gap-001-ref.html b/layout/reftests/css-grid/grid-percent-grid-gap-001-ref.html index 945b43b52..7ad85e1e5 100644 --- a/layout/reftests/css-grid/grid-percent-grid-gap-001-ref.html +++ b/layout/reftests/css-grid/grid-percent-grid-gap-001-ref.html @@ -65,7 +65,7 @@ br { clear: both; } </div> <div class="float"> -<div class="grid" style="align-self:start; justify-self:start; grid-gap:15px"> +<div class="grid" style="width:60px; height:60px; grid-column-gap:12px"> <span><x></x></span> <span><x></x></span> <span><x></x></span> @@ -74,7 +74,7 @@ br { clear: both; } </div> <div class="inline-grid"> -<div class="grid" style="align-self:start; justify-self:start; grid-gap:15px"> +<div class="grid" style="width:60px; height:60px; grid-column-gap:12px; align-self:start; justify-self:start;"> <span><x></x></span> <span><x></x></span> <span><x></x></span> @@ -141,12 +141,12 @@ br { clear: both; } </div> </div> -<div class="float" style="margin-top:-50px"> -<div class="grid" style="min-width:300%; grid-gap:15px 15px"> - <span><x></x></span> - <span style="margin-left:31px; width:30px"><x></x></span> - <span><x></x></span> - <span style="margin-left:31px; width:30px"><x></x></span> +<div class="float" style="margin-top:-50px; width:62px"> +<div class="grid" style="padding-left:186px; height:60px; grid-column-gap:calc(186px * 0.2);"> + <span style="margin-left:-186px; width:30px"><x></x></span> + <span style="margin-left:-186px; width:30px"><x></x></span> + <span style="margin-left:-186px; width:30px"><x></x></span> + <span style="margin-left:-186px; width:30px"><x></x></span> </div> </div> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-002-ref.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-002-ref.html index a404a0905..682e0ca38 100644 --- a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-002-ref.html +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-002-ref.html @@ -83,12 +83,16 @@ fill,fit { .zero-progress { grid-row-gap: calc(10px - 1%); - grid-template-rows: [a] 10px repeat(4, [b] minmax(0,auto) [c]) [d]; + grid-template-rows: [a] 10px repeat(3, [b] 0 [c]) [d]; } .w50.zero-progress { grid-row-gap: calc(10px - 1%); grid-template-rows: [a] 10px repeat(3, [b] 0 [c]) [d]; } +.mw50.zero-progress { + grid-row-gap: calc(10px - 1%); + grid-template-rows: [a] 10px repeat(4, [b] 0 [c]) [d]; +} </style> </head> <body> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-006-ref.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-006-ref.html index 79ac94548..ab07edd5f 100644 --- a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-006-ref.html +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-006-ref.html @@ -129,55 +129,55 @@ float { float:left; margin-right:20px; } <body> <float> -<div class="grid c1 t1 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x5"><x></x><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> <div class="grid c2 t1 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t1 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t1 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x4"><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> <div class="grid c2 t1 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t1 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t2 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x4"><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t2 x4"><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 x4"><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t1 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t1 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t1 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x3"><x></x><x></x><a></a><b></b><f></f><x></x></div> +<div class="grid c2 t1 x3"><x></x><x></x><a></a><b></b><c></c><e></e><f></f><x></x></div> +<div class="grid c3 t1 x3"><x></x><x></x><a></a><b></b><c></c><e></e><f></f><x></x></div> -<div class="grid c1 t2 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t2 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> </float> <float> -<div class="grid c1 t1 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t1 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t1 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x2"><x></x><a></a><b></b><f></f><x></x></div> +<div class="grid c2 t1 x2"><x></x><a></a><b></b><c></c><e></e><f></f><x></x></div> +<div class="grid c3 t1 x2"><x></x><a></a><b></b><c></c><e></e><f></f><x></x></div> -<div class="grid c1 t2 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x2"><x></x><a></a><b></b><f></f><x></x></div> +<div class="grid c2 t2 x2"><x></x><a></a><b></b><f></f><x></x></div> +<div class="grid c3 t2 x2"><x></x><a></a><b></b><f></f><x></x></div> -<div class="grid c1 t1 x1"><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t1 x1"><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t1 x1"><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x1"><a></a><b></b><f></f><x></x></div> +<div class="grid c2 t1 x1"><a></a><b></b><c></c><e></e><f></f><x></x></div> +<div class="grid c3 t1 x1"><a></a><b></b><c></c><e></e><f></f><x></x></div> -<div class="grid c1 t2 x1"><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x1"><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x1"><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x1"><a></a><b></b><f></f><x></x></div> +<div class="grid c2 t2 x1"><a></a><b></b><f></f><x></x></div> +<div class="grid c3 t2 x1"><a></a><b></b><f></f><x></x></div> -<div class="grid c1 t1 x1 p1"><a></a><b></b><c></c><d></d><e></e><f></f></div> -<div class="grid c2 t1 x1 p1"><a></a><b></b><c></c><d></d><e></e><f></f></div> -<div class="grid c3 t1 x1 p1"><a></a><b></b><c></c><d></d><e></e><f></f></div> +<div class="grid c1 t1 x1 p1"><a></a><b></b><f></f></div> +<div class="grid c2 t1 x1 p1"><a></a><b></b><c></c><e></e><f></f></div> +<div class="grid c3 t1 x1 p1"><a></a><b></b><c></c><e></e><f></f></div> -<div class="grid c1 t2 x0 p1"><a></a><b></b><c></c><d></d><e></e><f></f></div> -<div class="grid c2 t2 x0 p1"><a></a><b></b><c></c><d></d><e></e><f></f></div> -<div class="grid c3 t2 x0 p1"><a></a><b></b><c></c><d></d><e></e><f></f></div> +<div class="grid c1 t2 x0 p1"><a></a><b></b><f></f></div> +<div class="grid c2 t2 x0 p1"><a></a><b></b><f></f></div> +<div class="grid c3 t2 x0 p1"><a></a><b></b><f></f></div> </float> </body> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-007-ref.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-007-ref.html index 5f3cebf6a..fd073a072 100644 --- a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-007-ref.html +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-007-ref.html @@ -146,7 +146,7 @@ float { float:left; margin-right:20px; } <div class="grid c2 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t2 x5"><x></x><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t1 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x4"><x></x><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> <div class="grid c2 t1 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t1 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> @@ -154,23 +154,23 @@ float { float:left; margin-right:20px; } <div class="grid c2 t2 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t2 x4"><x></x><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t1 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> <div class="grid c2 t1 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t1 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t2 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x3"><x></x><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t2 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 x3"><x></x><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> </float> <float> -<div class="grid c1 t1 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t1 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t1 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 x2"><x></x><a></a><b></b><f></f><x></x></div> +<div class="grid c2 t1 x2"><x></x><a></a><b></b><c></c><e></e><f></f><x></x></div> +<div class="grid c3 t1 x2"><x></x><a></a><b></b><c></c><e></e><f></f><x></x></div> -<div class="grid c1 t2 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 x2"><x></x><a></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 x2"><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t2 x2"><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 x2"><x></x><a></a><b></b><d></d><e></e><f></f><x></x></div> </float> </body> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008-ref.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008-ref.html index 96f606682..028d9e209 100644 --- a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008-ref.html +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008-ref.html @@ -139,8 +139,7 @@ float { float:left; margin-right:20px; } .x2 e { left:23px; width:20px; right:auto; } .c2.x2 e { left:20px; } -.t1.c3.x2 e { width:40px; } -.t1.c3.x2 b { width:63px; } +.t1.c3.x2 e { width:20px; } .t1.c3.x2 c { width:20px; right:auto;} .t2.x5 e { left:23px; width:60px; } @@ -159,35 +158,35 @@ float { float:left; margin-right:20px; } <div class="grid c2 t1 n x5"><x></x><x></x><x></x><x></x><y></y><a style="width:55px"></a><b></b><c></c><d></d><e class="s2a e6a"></e><f class="e5a"></f><x></x></div> <div class="grid c3 t1 n x5"><x></x><x></x><x></x><x></x><y></y><y></y><a style="width:47px"></a><b></b><c></c><d></d><e class="s2 e6b"></e><f class="e5b"></f><x></x></div> -<div class="grid c1 t2 m x5"><x></x><x></x><x></x><x></x><y></y><a style="width:82px"></a><b></b><c></c><d></d><e class="s2"></e><f class="e5"></f><x></x></div> -<div class="grid c2 t2 m x5"><x></x><x></x><x></x><x></x><y></y><a style="width:75px"></a><b></b><c></c><d></d><e class="s2e"></e><f class="e5"></f><x></x></div> -<div class="grid c3 t2 m x5"><x></x><x></x><x></x><x></x><y></y><y></y><a style="width:67px"></a><b></b><c></c><d></d><e></e><f class="e5"></f><x></x></div> +<div class="grid c1 t2 m x5"><x></x><x></x><x></x><x></x><y></y><a style="width:82px"></a><b></b><d></d><e class="s2"></e><f class="e5"></f><x></x></div> +<div class="grid c2 t2 m x5"><x></x><x></x><x></x><x></x><y></y><a style="width:75px"></a><b></b><d></d><e class="s2e"></e><f class="e5"></f><x></x></div> +<div class="grid c3 t2 m x5"><x></x><x></x><x></x><x></x><y></y><y></y><a style="width:67px"></a><b></b><d></d><e></e><f class="e5"></f><x></x></div> <div class="grid c1 t1 o x4"><x></x><x></x><x></x><y></y><a style="width:62px"></a><b></b><c></c><d></d><e></e><f class="e5"></f><x></x></div> <div class="grid c2 t1 o x4"><x></x><x></x><x></x><y></y><a style="width:55px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t1 o x4"><x></x><x></x><x></x><y></y><y></y><a style="width:47px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t2 o x4"><x></x><x></x><x></x><y></y><a style="width:102px"></a><b></b><c></c><d></d><e></e><f class="e5"></f><x></x></div> -<div class="grid c2 t2 o x4"><x></x><x></x><x></x><y></y><a style="width:95px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 o x4"><x></x><x></x><x></x><y></y><y></y><a style="width:87px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 o x4"><x></x><x></x><x></x><y></y><a style="width:102px"></a><b></b><d></d><e></e><f class="e5"></f><x></x></div> +<div class="grid c2 t2 o x4"><x></x><x></x><x></x><y></y><a style="width:95px"></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 o x4"><x></x><x></x><x></x><y></y><y></y><a style="width:87px"></a><b></b><d></d><e></e><f></f><x></x></div> <div class="grid c1 t1 n x3"><x></x><x></x><y></y><a style="width:62px"></a><b></b><c></c><d></d><e></e><f class="e5"></f><x></x></div> <div class="grid c2 t1 n x3"><x></x><x></x><y></y><a style="width:55px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> <div class="grid c3 t1 n x3"><x></x><x></x><y></y><y></y><a style="width:47px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t2 n x3"><x></x><x></x><y></y><a style="width:102px"></a><b></b><c></c><d></d><e></e><f class="e5"></f><x></x></div> -<div class="grid c2 t2 n x3"><x></x><x></x><y></y><a style="width:95px"></a><b></b><c></c><d></d><e></e><f class="e5"></f><x></x></div> -<div class="grid c3 t2 n x3"><x></x><x></x><y></y><y></y><a style="width:87px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 n x3"><x></x><x></x><y></y><a style="width:102px"></a><b></b><d></d><e></e><f class="e5"></f><x></x></div> +<div class="grid c2 t2 n x3"><x></x><x></x><y></y><a style="width:95px"></a><b></b><d></d><e></e><f class="e5"></f><x></x></div> +<div class="grid c3 t2 n x3"><x></x><x></x><y></y><y></y><a style="width:87px"></a><b></b><d></d><e></e><f></f><x></x></div> </float> <float> -<div class="grid c1 t1 n x2"><x></x><y></y><a style="width:122px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t1 n x2"><x></x><y></y><a style="width:115px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t1 n x2"><x></x><y></y><y></y><a style="width:87px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t1 n x2"><x></x><y></y><a style="width:122px"></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t1 n x2"><x></x><y></y><a style="width:115px"></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t1 n x2"><x></x><y></y><y></y><a style="width:107px"></a><b></b><d></d><e></e><f></f><x></x></div> -<div class="grid c1 t2 n x2"><x></x><y></y><a style="width:122px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c2 t2 n x2"><x></x><y></y><a style="width:115px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> -<div class="grid c3 t2 n x2"><x></x><y></y><y></y><a style="width:107px"></a><b></b><c></c><d></d><e></e><f></f><x></x></div> +<div class="grid c1 t2 n x2"><x></x><y></y><a style="width:122px"></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c2 t2 n x2"><x></x><y></y><a style="width:115px"></a><b></b><d></d><e></e><f></f><x></x></div> +<div class="grid c3 t2 n x2"><x></x><y></y><y></y><a style="width:107px"></a><b></b><d></d><e></e><f></f><x></x></div> </float> </body> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008.html index e821c8d0e..300be60ca 100644 --- a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008.html +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-008.html @@ -156,32 +156,32 @@ function testGridTemplateColumns(elem, expected) { } } var a1 = [ -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px", "[a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", -"3px [a b] 20px [c b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px", -"[a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", -"3px [a b] 20px [c b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", "3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px", -"[a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", +"[a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", "3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c d] 20px", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px", +"[a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c d] 20px 3px", +"3px [a b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 20px", "[a b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c d] 20px 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c d] 20px 3px" +"3px [a b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c d] 20px 3px" ]; var a2 = [ -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c d]", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d]", "[a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d]", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c d] 3px", +"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c b] 0px [c d]", "[a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d]", +"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 3px", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c b] 0px [c d]", "[a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d]", +"3px [a b] 0px [c b] 20px [c b] 20px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 3px", +"3px [a b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c b] 0px [c d]", "[a b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 3px", -"3px [a b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c d] 3px" +"3px [a b] 0px [c b] 20px [c b] 0px [c b] 20px [c b] 0px [c b] 0px [c b] 0px [c d] 3px" ]; function runTest() { var t1 = document.querySelectorAll('.t1'); @@ -195,7 +195,7 @@ function runTest() { document.documentElement.className=''; } -document.addEventListener('MozReftestInvalidate', runTest, false); +document.addEventListener('MozReftestInvalidate', runTest); </script> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-012-ref.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-012-ref.html new file mode 100644 index 000000000..04963b45f --- /dev/null +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-012-ref.html @@ -0,0 +1,144 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> + <meta charset="utf-8"> + <title>Reference: repeat(auto-fit) with removed tracks</title> + <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1417711"> + <style type="text/css"> +html,body { + color:black; background-color:white; font:16px/1 monospace; padding:0px; margin:0; +} + +.container { + width: 200px; +} + +.grid { + position: relative; + display: grid; + grid: 10px / repeat(5, 30px); + grid-auto-columns: 2px; + background: lightgrey; + margin-bottom: 4px; + grid-gap: 5px; +} +.distribute { + grid-gap: 0; + align-content: space-around; +} + +span { + background: blue; + height: 10px; +} + +.abs { + position: absolute; + top:0; right:0; bottom:0; left:0; + grid-column-end: span 1; + background: pink; +} + + </style> +</head> +<body> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1 / 2" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1 / 2" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1 / 3" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1 / 2" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1 / auto" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1 / 2" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1 / 2" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1 / 3" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1 / 2" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1 / auto" class="abs"></span> +</div> +</div> + +</body> +</html> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-012.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-012.html new file mode 100644 index 000000000..7ed0843af --- /dev/null +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-012.html @@ -0,0 +1,160 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> + <meta charset="utf-8"> + <title>CSS Grid Test: repeat(auto-fit) with removed tracks</title> + <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1417711"> + <link rel="help" href="https://drafts.csswg.org/css-grid/#valdef-repeat-auto-fill"> + <link rel="match" href="grid-repeat-auto-fill-fit-012-ref.html"> + <style type="text/css"> +html,body { + color:black; background-color:white; font:16px/1 monospace; padding:0px; margin:0; +} + +.container { + width: 200px; +} + +.grid { + position: relative; + display: grid; + grid: 10px / repeat(auto-fit, 30px); + grid-auto-columns: 2px; + background: lightgrey; + margin-bottom: 4px; + grid-gap: 5px; +} +.distribute { + grid-gap: 0; + align-content: space-around; +} + +span { + background: blue; + height: 10px; +} + +.abs { + position: absolute; + top:0; right:0; bottom:0; left:0; + grid-column-end: span 1; + background: pink; +} + + </style> +</head> +<body> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 4 / 5" class="abs"></span> +<span style="grid-column: 3"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 4 / 5" class="abs"></span> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 1 / 5" class="abs"></span> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 2 / 5" class="abs"></span> +<span style="grid-column: 2"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 2 / 5" class="abs"></span> +<span style="grid-column: 2 / 4"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 2 / 5" class="abs"></span> +<span style="grid-column: 4 / 5"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 2 / 5" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid"> +<span style="grid-column: 2 / 10" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 4 / 5" class="abs"></span> +<span style="grid-column: 3"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 4 / 5" class="abs"></span> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 1 / 5" class="abs"></span> +<span style="grid-column: 1"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 2 / 5" class="abs"></span> +<span style="grid-column: 2"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 2 / 5" class="abs"></span> +<span style="grid-column: 2 / 4"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 2 / 5" class="abs"></span> +<span style="grid-column: 4 / 5"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 2 / 5" class="abs"></span> +</div> +</div> + +<div class="container"> +<div class="grid distribute"> +<span style="grid-column: 2 / 10" class="abs"></span> +</div> +</div> + +</body> +</html> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-013-ref.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-013-ref.html new file mode 100644 index 000000000..9b8267f88 --- /dev/null +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-013-ref.html @@ -0,0 +1,116 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> +<meta charset="utf-8"> +<title>CSS Grid Test Reference: test auto placement in repeat auto-fit grids with leading implicit tracks</title> +<style type="text/css"> +body { + margin: 10px; + font-size: 10px; +} +.wrapper { + display: grid; + width: 600px; + background-color: #f00; +} +.wrapper > * { + background-color: #444; + color: #fff; +} + +.templateFit { + grid-template-columns: 10px 10px repeat(auto-fill, 40px); +} +.templateFixedFit { + grid-template-columns: 10px calc(10px + 20px) repeat(auto-fill, 40px); +} +.templateFitFixed { + grid-template-columns: 10px 10px repeat(auto-fill, 40px) 40px; +} +.templateFixedFitFixed { + grid-template-columns: 10px calc(10px + 20px) repeat(auto-fill, 40px) 40px; +} + +z { + grid-column: 1; +} +z::after { + content: "Z"; +} + +y { + grid-column: auto; +} +y::after { + content: "Y"; +} + + +b { + grid-column: 3; +} +b::after { + content: "B"; +} + +c { + grid-column: 4; +} +c::after { + content: "C"; +} + +d { + grid-column: 5; +} +d::after { + content: "D"; +} + +e { + grid-column: 6; +} +e::after { + content: "E"; +} + +f { + grid-column: 7; +} +f::after { + content: "F"; +} + +</style> +</head> +<body> + +<div class="wrapper templateFit"><z></z><b></b><y></y></div> +<div class="wrapper templateFit"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFit"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFit"><z></z><b></b><d style="grid-column: 4"></d></div> +<div class="wrapper templateFit"><z></z><b></b><d style="grid-column: 4"></d><f style="grid-column: 5"></f></div> + +<div class="wrapper templateFixedFit"><z></z><b></b><y></y></div> +<div class="wrapper templateFixedFit"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFixedFit"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFixedFit"><z></z><b></b><d style="grid-column: 4"></d></div> +<div class="wrapper templateFixedFit"><z></z><b></b><d style="grid-column: 4"></d><f style="grid-column: 5"></f></div> + +<div class="wrapper templateFitFixed"><z></z><b></b><y></y></div> +<div class="wrapper templateFitFixed"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFitFixed"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFitFixed"><z></z><b></b><d style="grid-column: 4"></d></div> +<div class="wrapper templateFitFixed"><z></z><b></b><d style="grid-column: 4"></d><f style="grid-column: 5"></f></div> + +<div class="wrapper templateFixedFitFixed"><z></z><b></b><y></y></div> +<div class="wrapper templateFixedFitFixed"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFixedFitFixed"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFixedFitFixed"><z></z><b></b><d style="grid-column: 4"></d></div> +<div class="wrapper templateFixedFitFixed"><z></z><b></b><d style="grid-column: 4"></d><f style="grid-column: 5"></f></div> + +</body> +</html> diff --git a/layout/reftests/css-grid/grid-repeat-auto-fill-fit-013.html b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-013.html new file mode 100644 index 000000000..5a9c05d73 --- /dev/null +++ b/layout/reftests/css-grid/grid-repeat-auto-fill-fit-013.html @@ -0,0 +1,135 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> +<meta charset="utf-8"> +<title>CSS Grid Test: test placement in repeat auto-fit grids with leading implicit tracks</title> +<link rel="author" title="Brad Werth" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1416350"> +<link rel="help" href="https://drafts.csswg.org/css-grid/#valdef-repeat-auto-fill"> +<link rel="match" href="grid-repeat-auto-fill-fit-013-ref.html"> +<style type="text/css"> +body { + margin: 10px; + font-size: 10px; +} +.wrapper { + display: grid; + width: 600px; + background-color: #f00; + grid-auto-columns: 10px; + grid-auto-flow: row; +} +.wrapper > * { + background-color: #444; + color: #fff; +} + +.relative { + position: relative; +} + +.absposchild { + z-index: -1; + position: absolute; + grid-column-end: span 1; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; +} + +.templateFit { + grid-template-columns: repeat(auto-fit, 40px); +} +.templateFixedFit { + grid-template-columns: 20px repeat(auto-fit, 40px); +} +.templateFitFixed { + grid-template-columns: repeat(auto-fit, 40px) 40px; +} +.templateFixedFitFixed { + grid-template-columns: 20px repeat(auto-fit, 40px) 40px; +} + +z { + grid-column: -18; +} +z::after { + content: "Z"; +} + +y { + grid-column: auto; +} +y::after { + content: "Y"; +} + + +b { + grid-column: 3; +} +b::after { + content: "B"; +} + +c { + grid-column: 5; +} +c::after { + content: "C"; +} + +d { + grid-column: 7; +} +d::after { + content: "D"; +} + +e { + grid-column: 9; +} +e::after { + content: "E"; +} + +f { + grid-column: 11; +} +f::after { + content: "F"; +} + +</style> +</head> +<body> + +<div class="wrapper templateFit"><z></z><b></b><y></y></div> +<div class="wrapper templateFit"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFit"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFit relative"><z></z><b></b><c class="absposchild"></c><d></d></div> +<div class="wrapper templateFit relative"><z></z><b></b><c class="absposchild"></c><d></d><e class="absposchild"></e><f></f></div> + +<div class="wrapper templateFixedFit"><z></z><b></b><y></y></div> +<div class="wrapper templateFixedFit"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFixedFit"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFixedFit relative"><z></z><b></b><c class="absposchild"></c><d></d></div> +<div class="wrapper templateFixedFit relative"><z></z><b></b><c class="absposchild"></c><d></d><e class="absposchild"></e><f></f></div> + +<div class="wrapper templateFitFixed"><z></z><b></b><y></y></div> +<div class="wrapper templateFitFixed"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFitFixed"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFitFixed relative"><z></z><b></b><c class="absposchild"></c><d></d></div> +<div class="wrapper templateFitFixed relative"><z></z><b></b><c class="absposchild"></c><d></d><e class="absposchild"></e><f></f></div> + +<div class="wrapper templateFixedFitFixed"><z></z><b></b><y></y></div> +<div class="wrapper templateFixedFitFixed"><z></z><b></b><c></c><d></d></div> +<div class="wrapper templateFixedFitFixed"><z></z><b></b><c></c><d></d><e></e><f></f></div> +<div class="wrapper templateFixedFitFixed relative"><z></z><b></b><c class="absposchild"></c><d></d></div> +<div class="wrapper templateFixedFitFixed relative"><z></z><b></b><c class="absposchild"></c><d></d><e class="absposchild"></e><f></f></div> + +</body> +</html> diff --git a/layout/reftests/css-grid/grid-track-intrinsic-sizing-002-ref.html b/layout/reftests/css-grid/grid-track-intrinsic-sizing-002-ref.html index 7fb00f1da..23dc42b69 100644 --- a/layout/reftests/css-grid/grid-track-intrinsic-sizing-002-ref.html +++ b/layout/reftests/css-grid/grid-track-intrinsic-sizing-002-ref.html @@ -27,34 +27,34 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px background: grey; } .g1 .d1 { - width: 52px; + width: 0px; } .g2 .d1 { - width: 56px; + width: 0px; } .g2f .d1 { - width: 69px; + width: 0px; } .g3 .d1 { - width: 56px; + width: 0px; } .g4 .d1 { - width: 96px; + width: 80px; } .g4f .d1 { - width: 69px; + width: 0px; } .g5 .d1 { - width: 96px; + width: 80px; } .g6 .d1 { - width: 69px; + width: 0px; } .g6f .d1 { - width: 69px; + width: 0px; } .g7 .d1 { - width: 69px; + width: 0px; } .g8 .t { width: 196px; @@ -63,19 +63,19 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px width: 200px; } .g9 .d1 { - width: 69px; + width: 0px; } .gA .d1 { - width: 93px; + width: 80px; } .gB .d1 { - width: 93px; + width: 80px; } .gC .d1 { - width: 93px; + width: 80px; } .gD .d1 { - width: 93px; + width: 80px; } .t { grid-column: span 1; border:2px solid; } diff --git a/layout/reftests/css-grid/grid-track-intrinsic-sizing-003-ref.html b/layout/reftests/css-grid/grid-track-intrinsic-sizing-003-ref.html index bc52f4ca0..01739578c 100644 --- a/layout/reftests/css-grid/grid-track-intrinsic-sizing-003-ref.html +++ b/layout/reftests/css-grid/grid-track-intrinsic-sizing-003-ref.html @@ -27,34 +27,34 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px background: grey; } .g1 .d1 { - width: 52px; + width: 0px; } .g2 .d1 { - width: 56px; + width: 0px; } .g2f .d1 { width: 69px; } .g3 .d1 { - width: 56px; + width: 0px; } .g4 .d1 { - width: 96px; + width: 80px; } .g4f .d1 { width: 104px; } .g5 .d1 { - width: 96px; + width: 80px; } .g6 .d1 { - width: 69px; + width: 0px; } .g6f .d1 { width: 89px; } .g7 .d1 { - width: 69px; + width: 0px; } .g8 .t { width: 196px; @@ -63,19 +63,19 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px width: 200px; } .g9 .d1 { - width: 69px; + width: 0px; } .gA .d1 { - width: 93px; + width: 80px; } .gB .d1 { - width: 93px; + width: 80px; } .gC .d1 { - width: 93px; + width: 80px; } .gD .d1 { - width: 93px; + width: 80px; } .d2 { position: absolute; @@ -84,10 +84,10 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px background: blue; } .g1 .d2 { - width: 448px; + width: 500px; } .g2 .d2 { - width: 444px; + width: 500px; } .g2f .d2 { right: auto; @@ -95,10 +95,10 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px width: 35px; } .g3 .d2 { - width: 444px; + width: 500px; } .g4 .d2 { - width: 404px; + width: 420px; } .g4f .d2 { right: auto; @@ -106,10 +106,10 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px width: 35px; } .g5 .d2 { - width: 404px; + width: 420px; } .g6 .d2 { - width: 431px; + width: 500px; } .g6f .d2 { right: auto; @@ -117,25 +117,25 @@ body,html { color:black; background:white; font-family:monospace; font-size:16px width: 35px; } .g7 .d2 { - width: 431px; + width: 500px; } .g8 .d2 { width: 300px; } .g9 .d2 { - width: 431px; + width: 500px; } .gA .d2 { - width: 407px; + width: 420px; } .gB .d2 { - width: 407px; + width: 420px; } .gC .d2 { - width: 407px; + width: 420px; } .gD .d2 { - width: 407px; + width: 420px; } .t { grid-column: span 1; border:2px solid; } diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list index 3087ca49b..7c5e6be51 100644 --- a/layout/reftests/css-grid/reftest.list +++ b/layout/reftests/css-grid/reftest.list @@ -112,9 +112,9 @@ skip-if(Android) == grid-auto-min-sizing-percent-001.html grid-auto-min-sizing-p == grid-item-auto-min-size-clamp-001.html grid-item-auto-min-size-clamp-001-ref.html == grid-item-auto-min-size-clamp-002.html grid-item-auto-min-size-clamp-002-ref.html == grid-item-auto-min-size-clamp-003.html grid-item-auto-min-size-clamp-003-ref.html -== grid-item-auto-min-size-clamp-004.html grid-item-auto-min-size-clamp-004-ref.html +# == grid-item-auto-min-size-clamp-004.html grid-item-auto-min-size-clamp-004-ref.html # bug 1421976 == grid-item-auto-min-size-clamp-005.html grid-item-auto-min-size-clamp-005-ref.html -== grid-item-auto-min-size-clamp-006.html grid-item-auto-min-size-clamp-006-ref.html +# == grid-item-auto-min-size-clamp-006.html grid-item-auto-min-size-clamp-006-ref.html # bug 1421976 == grid-item-auto-min-size-clamp-007.html grid-item-auto-min-size-clamp-007-ref.html == grid-item-overflow-stretch-001.html grid-item-overflow-stretch-001-ref.html == grid-item-overflow-stretch-002.html grid-item-overflow-stretch-002-ref.html @@ -184,6 +184,8 @@ skip-if(Android&&isDebugBuild) == grid-row-gap-004.html grid-row-gap-004-ref.htm == grid-repeat-auto-fill-fit-009.html grid-repeat-auto-fill-fit-009-ref.html == grid-repeat-auto-fill-fit-010.html grid-repeat-auto-fill-fit-010-ref.html == grid-repeat-auto-fill-fit-011.html grid-repeat-auto-fill-fit-010-ref.html +== grid-repeat-auto-fill-fit-012.html grid-repeat-auto-fill-fit-012-ref.html +== grid-repeat-auto-fill-fit-013.html grid-repeat-auto-fill-fit-013-ref.html == grid-item-blockifying-001.html grid-item-blockifying-001-ref.html == grid-fragmentation-001.html grid-fragmentation-001-ref.html == grid-fragmentation-002.html grid-fragmentation-002-ref.html diff --git a/layout/reftests/position-sticky/inner-table-1-ref.html b/layout/reftests/position-sticky/inner-table-1-ref.html deleted file mode 100644 index 379841fae..000000000 --- a/layout/reftests/position-sticky/inner-table-1-ref.html +++ /dev/null @@ -1,26 +0,0 @@ -<!DOCTYPE html> -<!-- Any copyright is dedicated to the Public Domain. - - http://creativecommons.org/publicdomain/zero/1.0/ --> -<html> - <head> - <link rel="author" title="Corey Ford" href="mailto:corey@coreyford.name"> - </head> - <body> - <table> - <thead> - <tr> - <td>a</td> - </tr> - </thead> - <tr> - <td>b</td> - </tr> - <tr> - <td>c</td> - </tr> - <tr> - <td>d</td> - </tr> - </table> - </body> -</html> diff --git a/layout/reftests/position-sticky/inner-table-1.html b/layout/reftests/position-sticky/inner-table-1.html deleted file mode 100644 index 212e658fd..000000000 --- a/layout/reftests/position-sticky/inner-table-1.html +++ /dev/null @@ -1,35 +0,0 @@ -<!DOCTYPE html> -<!-- Any copyright is dedicated to the Public Domain. - - http://creativecommons.org/publicdomain/zero/1.0/ --> -<html> - <head> - <title>CSS Test: Sticky Positioning - inner table elements</title> - <link rel="author" title="Corey Ford" href="mailto:corey@coreyford.name"> - <link rel="match" href="inner-table-1-ref.html"> - <meta name="assert" content="Sticky positioning on inner table elements should have no effect (until bug 35168 is fixed)"> - <style> - .sticky { - position: sticky; - top: 1000px; - } - </style> - </head> - <body> - <table> - <thead class="sticky"> - <tr> - <td>a</td> - </tr> - </thead> - <tr class="sticky"> - <td>b</td> - </tr> - <tr> - <td class="sticky">c</td> - </tr> - <tr> - <td>d</td> - </tr> - </table> - </body> -</html> diff --git a/layout/reftests/position-sticky/reftest.list b/layout/reftests/position-sticky/reftest.list index 2705d08fd..01e7b1638 100644 --- a/layout/reftests/position-sticky/reftest.list +++ b/layout/reftests/position-sticky/reftest.list @@ -48,4 +48,3 @@ fails == column-contain-1a.html column-contain-1-ref.html fuzzy-if(skiaContent,1,22) fuzzy-if(winWidget&&!layersGPUAccelerated,116,1320) fuzzy-if(Android,8,1533) == block-in-inline-2.html block-in-inline-2-ref.html fuzzy-if(Android,8,630) fuzzy-if(OSX>=1008,1,11) fuzzy-if(skiaContent,1,220) fuzzy-if(winWidget&&!layersGPUAccelerated,116,1320) == block-in-inline-3.html block-in-inline-3-ref.html == block-in-inline-continuations.html block-in-inline-continuations-ref.html -fuzzy-if(winWidget&&!layersGPUAccelerated,140,140) == inner-table-1.html inner-table-1-ref.html diff --git a/layout/reftests/table-background/reftest.list b/layout/reftests/table-background/reftest.list index eb2817ca0..68dc43e95 100644 --- a/layout/reftests/table-background/reftest.list +++ b/layout/reftests/table-background/reftest.list @@ -44,11 +44,11 @@ fuzzy-if(d2d,1,1083) fuzzy-if(skiaContent,1,2200) == border-collapse-opacity-tab fails == border-collapse-opacity-table-column-group.html border-collapse-opacity-table-column-group-ref.html # bug 424274 fails == border-collapse-opacity-table-column.html border-collapse-opacity-table-column-ref.html # bug 424274 fuzzy-if(d2d,1,16359) fuzzy-if(skiaContent,1,17000) == border-collapse-opacity-table-row-group.html border-collapse-opacity-table-row-group-ref.html -fuzzy-if(d2d,1,5453) fuzzy-if(skiaContent,1,11000) == border-collapse-opacity-table-row.html border-collapse-opacity-table-row-ref.html +fuzzy-if(d2d,1,11000) fuzzy-if(skiaContent,1,11000) == border-collapse-opacity-table-row.html border-collapse-opacity-table-row-ref.html fuzzy-if(d2d||skiaContent,1,60000) == border-collapse-opacity-table.html border-collapse-opacity-table-ref.html fuzzy-if(d2d,1,2478) fuzzy-if(skiaContent,1,2500) == border-separate-opacity-table-cell.html border-separate-opacity-table-cell-ref.html -fails == border-separate-opacity-table-column-group.html border-separate-opacity-table-column-group-ref.html # bug 424274 -fails == border-separate-opacity-table-column.html border-separate-opacity-table-column-ref.html # bug 424274 +fuzzy-if(d2d,1,38000) == border-separate-opacity-table-column-group.html border-separate-opacity-table-column-group-ref.html # bug 424274 +fuzzy-if(d2d,1,13000) == border-separate-opacity-table-column.html border-separate-opacity-table-column-ref.html # bug 424274 fuzzy-if(d2d,1,37170) fuzzy-if(skiaContent,1,38000) == border-separate-opacity-table-row-group.html border-separate-opacity-table-row-group-ref.html fuzzy-if(d2d,1,12390) fuzzy-if(skiaContent,1,13000) == border-separate-opacity-table-row.html border-separate-opacity-table-row-ref.html fuzzy-if(d2d||skiaContent,1,95000) == border-separate-opacity-table.html border-separate-opacity-table-ref.html diff --git a/layout/reftests/table-bordercollapse/bc_borderradius-ref.html b/layout/reftests/table-bordercollapse/bc_borderradius-ref.html new file mode 100644 index 000000000..c7b041f79 --- /dev/null +++ b/layout/reftests/table-bordercollapse/bc_borderradius-ref.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<style> + table { + border-collapse: collapse; + } + td { + background-color: rgb(0, 255, 0); + margin-bottom: 10px; + height: 100px; + width:100px; + } +</style> +<table> + <tr> + <td></td> + </tr> +</table> diff --git a/layout/reftests/table-bordercollapse/bc_borderradius.html b/layout/reftests/table-bordercollapse/bc_borderradius.html new file mode 100644 index 000000000..3ae2a89d8 --- /dev/null +++ b/layout/reftests/table-bordercollapse/bc_borderradius.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<style> + table { + border-collapse: collapse; + } + td { + background-color: rgb(0, 255, 0); + margin-bottom: 10px; + height: 100px; + width:100px; + border-radius: 50px; + } +</style> +<table> + <tr> + <td></td> + </tr> +</table> diff --git a/layout/reftests/table-bordercollapse/reftest.list b/layout/reftests/table-bordercollapse/reftest.list index 8356dc54b..5ca6f305a 100644 --- a/layout/reftests/table-bordercollapse/reftest.list +++ b/layout/reftests/table-bordercollapse/reftest.list @@ -20,6 +20,7 @@ == bc_dyn_table3.html bc_dyn_table3_ref.html == bc_borderoffset1.html bc_borderoffset1_ref.html == bc_borderoffset2.html bc_borderoffset2_ref.html +== bc_borderradius.html bc_borderradius-ref.html == frame_above_rules_all.html frame_above_rules_all_ref.html == frame_above_rules_cols.html frame_above_rules_cols_ref.html == frame_above_rules_groups.html frame_above_rules_groups_ref.html @@ -104,4 +105,5 @@ fuzzy(255,40) == border-style-outset-becomes-groove.html border-style-outset-bec # So get 40 pixels of fuzz, 20 at each beveled corner (because the border width # is 20px). fuzzy(255,40) == border-style-inset-becomes-ridge.html border-style-inset-becomes-ridge-ref.html -fuzzy(2,8301) == 1324524.html 1324524-ref.html +fuzzy(2,11000) == 1324524.html 1324524-ref.html + diff --git a/layout/reftests/writing-mode/1174450-intrinsic-sizing-ref.html b/layout/reftests/writing-mode/1174450-intrinsic-sizing-ref.html index 629c0a917..3645fa006 100644 --- a/layout/reftests/writing-mode/1174450-intrinsic-sizing-ref.html +++ b/layout/reftests/writing-mode/1174450-intrinsic-sizing-ref.html @@ -13,20 +13,20 @@ div.v, div.h { display: block; position: relative; border: 1px dashed silver; - width:92px; - height:60px; + width:74px; + height:24px; } div.h { - width:124px; - height:98px; + width:62px; + height:61.2px; } .h span { - margin: 7px 13px 62px 25px; - padding: 1px 3px 12px 37px; + margin: 7px 13px 32px 12px; + padding: 1px 3px 6px 19px; } .v span { - margin: 7px 13px 30px 12px; - padding: 1px 3px 6px 18px; + margin: 7px 13px 30px 5px; + padding: 1px 3px 2px 7px; } span { diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 2049f70e8..07db6d3dd 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -1499,7 +1499,7 @@ CSS_PROP_COLUMN( CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_NONNEGATIVE, "", - VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC, + VARIANT_HLP | VARIANT_NORMAL | VARIANT_CALC, nullptr, offsetof(nsStyleColumn, mColumnGap), eStyleAnimType_Coord) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 08400635b..a0f65c069 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -67,6 +67,9 @@ #define alloca _alloca #endif #endif +#ifdef XP_SOLARIS +#include <alloca.h> +#endif using std::max; using std::min; diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index c8182b8f1..b257c6bb5 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -3495,7 +3495,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn uint32_t mColumnCount; // [reset] see nsStyleConsts.h nsStyleCoord mColumnWidth; // [reset] coord, auto - nsStyleCoord mColumnGap; // [reset] coord, normal + nsStyleCoord mColumnGap; // [reset] <length-percentage> | normal mozilla::StyleComplexColor mColumnRuleColor; // [reset] uint8_t mColumnRuleStyle; // [reset] diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 272931c15..c75f7b498 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -1438,7 +1438,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "normal", "1em", "calc(-2em + 3em)" ], - other_values: [ "2px", "4em", + other_values: [ "2px", "1em", "4em", "3%", "calc(3%)", "calc(1em - 3%)", "calc(2px)", "calc(-2px)", "calc(0px)", @@ -1448,7 +1448,7 @@ var gCSSProperties = { "calc(25px*3)", "calc(3*25px + 5em)", ], - invalid_values: [ "3%", "-1px", "4" ] + invalid_values: [ "-3%", "-1px", "4" ] }, "-moz-column-gap": { domProp: "MozColumnGap", diff --git a/layout/tables/moz.build b/layout/tables/moz.build index b77776320..e28e21ee0 100644 --- a/layout/tables/moz.build +++ b/layout/tables/moz.build @@ -21,7 +21,6 @@ UNIFIED_SOURCES += [ 'nsTableColFrame.cpp', 'nsTableColGroupFrame.cpp', 'nsTableFrame.cpp', - 'nsTablePainter.cpp', 'nsTableRowFrame.cpp', 'nsTableRowGroupFrame.cpp', 'nsTableWrapperFrame.cpp', diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 316a96613..ec9458f76 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -12,7 +12,6 @@ #include "nsTableColFrame.h" #include "nsTableRowFrame.h" #include "nsTableRowGroupFrame.h" -#include "nsTablePainter.h" #include "nsStyleContext.h" #include "nsStyleConsts.h" #include "nsPresContext.h" @@ -380,19 +379,6 @@ nsTableCellFrame::PaintBackground(nsRenderingContext& aRenderingContext, return nsCSSRendering::PaintBackground(params); } -// Called by nsTablePainter -DrawResult -nsTableCellFrame::PaintCellBackground(nsRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, nsPoint aPt, - uint32_t aFlags) -{ - if (!StyleVisibility()->IsVisible()) { - return DrawResult::SUCCESS; - } - - return PaintBackground(aRenderingContext, aDirtyRect, aPt, aFlags); -} - nsresult nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame, nsDisplayListBuilder* aBuilder, @@ -484,70 +470,51 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) { DO_GLOBAL_REFLOW_COUNT_DSP("nsTableCellFrame"); - if (IsVisibleInSelection(aBuilder)) { - nsTableFrame* tableFrame = GetTableFrame(); - int32_t emptyCellStyle = GetContentEmpty() && !tableFrame->IsBorderCollapse() ? - StyleTableBorder()->mEmptyCells - : NS_STYLE_TABLE_EMPTY_CELLS_SHOW; - // take account of 'empty-cells' - if (StyleVisibility()->IsVisible() && - (NS_STYLE_TABLE_EMPTY_CELLS_HIDE != emptyCellStyle)) { - // display outset box-shadows if we need to. - bool hasBoxShadow = !!StyleEffects()->mBoxShadow; - if (hasBoxShadow) { - aLists.BorderBackground()->AppendNewToTop( - new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this)); - } - - // display background if we need to. - if (aBuilder->IsForEventDelivery() || - !StyleBackground()->IsTransparent() || StyleDisplay()->mAppearance) { - if (!tableFrame->IsBorderCollapse()) { - nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, - this, - GetRectRelativeToSelf(), - aLists.BorderBackground()); - } else if (aBuilder->IsAtRootOfPseudoStackingContext() || - aBuilder->IsForEventDelivery()) { - // The cell background was not painted by the nsTablePainter, - // so we need to do it. We have special background processing here - // so we need to duplicate some code from nsFrame::DisplayBorderBackgroundOutline - nsDisplayTableItem* item = - new (aBuilder) nsDisplayTableCellBackground(aBuilder, this); - aLists.BorderBackground()->AppendNewToTop(item); - item->UpdateForFrameBackground(this); - } else { - // The nsTablePainter will paint our background. Make sure it - // knows if we're background-attachment:fixed. - nsDisplayTableItem* currentItem = aBuilder->GetCurrentTableItem(); - if (currentItem) { - currentItem->UpdateForFrameBackground(this); - } - } - } - - // display inset box-shadows if we need to. - if (hasBoxShadow) { - aLists.BorderBackground()->AppendNewToTop( - new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this)); - } - - // display borders if we need to - ProcessBorders(tableFrame, aBuilder, aLists); - - // and display the selection border if we need to - if (IsSelected()) { - aLists.BorderBackground()->AppendNewToTop(new (aBuilder) - nsDisplayGeneric(aBuilder, this, ::PaintTableCellSelection, - "TableCellSelection", - nsDisplayItem::TYPE_TABLE_CELL_SELECTION)); - } + nsTableFrame* tableFrame = GetTableFrame(); + int32_t emptyCellStyle = GetContentEmpty() && !tableFrame->IsBorderCollapse() ? + StyleTableBorder()->mEmptyCells + : NS_STYLE_TABLE_EMPTY_CELLS_SHOW; + // take account of 'empty-cells' + if (StyleVisibility()->IsVisible() && + (NS_STYLE_TABLE_EMPTY_CELLS_HIDE != emptyCellStyle)) { + // display outset box-shadows if we need to. + bool hasBoxShadow = !!StyleEffects()->mBoxShadow; + if (hasBoxShadow) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this)); + } + + // display background if we need to. + if (aBuilder->IsForEventDelivery() || + !StyleBackground()->IsTransparent() || + StyleDisplay()->mAppearance) { + nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, + this, + GetRectRelativeToSelf(), + aLists.BorderBackground()); + } + + // display inset box-shadows if we need to. + if (hasBoxShadow) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this)); + } + + // display borders if we need to + ProcessBorders(tableFrame, aBuilder, aLists); + + // and display the selection border if we need to + if (IsSelected()) { + aLists.BorderBackground()->AppendNewToTop(new (aBuilder) + nsDisplayGeneric(aBuilder, this, ::PaintTableCellSelection, + "TableCellSelection", + nsDisplayItem::TYPE_TABLE_CELL_SELECTION)); } - - // the 'empty-cells' property has no effect on 'outline' - DisplayOutline(aBuilder, aLists); } + // the 'empty-cells' property has no effect on 'outline' + DisplayOutline(aBuilder, aLists); + // Push a null 'current table item' so that descendant tables can't // accidentally mess with our table nsAutoPushCurrentTableItem pushTableItem; @@ -796,12 +763,12 @@ nsTableCellFrame::GetPrefISize(nsRenderingContext *aRenderingContext) } /* virtual */ nsIFrame::IntrinsicISizeOffsetData -nsTableCellFrame::IntrinsicISizeOffsets() +nsTableCellFrame::IntrinsicISizeOffsets(nscoord aPercentageBasis) { - IntrinsicISizeOffsetData result = nsContainerFrame::IntrinsicISizeOffsets(); + IntrinsicISizeOffsetData result = + nsContainerFrame::IntrinsicISizeOffsets(aPercentageBasis); result.hMargin = 0; - result.hPctMargin = 0; WritingMode wm = GetWritingMode(); result.hBorder = GetBorderWidth(wm).IStartEnd(wm); diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h index 6717e1b70..5f87c5f6d 100644 --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -107,18 +107,14 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) override; - DrawResult PaintCellBackground(nsRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, nsPoint aPt, - uint32_t aFlags); - - virtual nsresult ProcessBorders(nsTableFrame* aFrame, nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists); virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; - virtual IntrinsicISizeOffsetData IntrinsicISizeOffsets() override; + IntrinsicISizeOffsetData IntrinsicISizeOffsets(nscoord aPercentageBasis = + NS_UNCONSTRAINEDSIZE) override; virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, diff --git a/layout/tables/nsTableColFrame.cpp b/layout/tables/nsTableColFrame.cpp index 8f449c3d9..54b03522b 100644 --- a/layout/tables/nsTableColFrame.cpp +++ b/layout/tables/nsTableColFrame.cpp @@ -108,6 +108,14 @@ nsTableColFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } +void +nsTableColFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) +{ + nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists); +} + int32_t nsTableColFrame::GetSpan() { return StyleTable()->mSpan; diff --git a/layout/tables/nsTableColFrame.h b/layout/tables/nsTableColFrame.h index e95fe76b1..fb989061f 100644 --- a/layout/tables/nsTableColFrame.h +++ b/layout/tables/nsTableColFrame.h @@ -59,12 +59,9 @@ public: const ReflowInput& aReflowInput, nsReflowStatus& aStatus) override; - /** - * Table columns never paint anything, nor receive events. - */ virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, - const nsDisplayListSet& aLists) override {} + const nsDisplayListSet& aLists) override; /** * Get the "type" of the frame diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp index ff8879a0b..6ee7f0b24 100644 --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -383,6 +383,14 @@ nsTableColGroupFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } +void +nsTableColGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) +{ + nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists); +} + nsTableColFrame * nsTableColGroupFrame::GetFirstColumn() { return GetNextColumn(nullptr); diff --git a/layout/tables/nsTableColGroupFrame.h b/layout/tables/nsTableColGroupFrame.h index 2a25fdc44..b3dfb94e7 100644 --- a/layout/tables/nsTableColGroupFrame.h +++ b/layout/tables/nsTableColGroupFrame.h @@ -43,12 +43,9 @@ public: return static_cast<nsTableFrame*>(parent); } - /** - * ColGroups never paint anything, nor receive events. - */ virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, - const nsDisplayListSet& aLists) override {} + const nsDisplayListSet& aLists) override; /** A colgroup can be caused by three things: * 1) An element with table-column-group display diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index b9b6ca5fe..890d050fd 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -23,7 +23,6 @@ #include "nsTableRowFrame.h" #include "nsTableRowGroupFrame.h" #include "nsTableWrapperFrame.h" -#include "nsTablePainter.h" #include "BasicTableLayoutStrategy.h" #include "FixedTableLayoutStrategy.h" @@ -1131,67 +1130,40 @@ nsDisplayTableItem::ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion); } -class nsDisplayTableBorderBackground : public nsDisplayTableItem { +// A display item that draws all collapsed borders for a table. +class nsDisplayTableBorderCollapse : public nsDisplayTableItem { public: - nsDisplayTableBorderBackground(nsDisplayListBuilder* aBuilder, - nsTableFrame* aFrame, - bool aDrawsBackground) : - nsDisplayTableItem(aBuilder, aFrame, aDrawsBackground) { - MOZ_COUNT_CTOR(nsDisplayTableBorderBackground); - } + nsDisplayTableBorderCollapse(nsDisplayListBuilder* aBuilder, + nsTableFrame* aFrame) + : nsDisplayTableItem(aBuilder, aFrame) { + MOZ_COUNT_CTOR(nsDisplayTableBorderCollapse); + } #ifdef NS_BUILD_REFCNT_LOGGING - virtual ~nsDisplayTableBorderBackground() { - MOZ_COUNT_DTOR(nsDisplayTableBorderBackground); + virtual ~nsDisplayTableBorderCollapse() { + MOZ_COUNT_DTOR(nsDisplayTableBorderCollapse); } #endif virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override; - NS_DISPLAY_DECL_NAME("TableBorderBackground", TYPE_TABLE_BORDER_BACKGROUND) + NS_DISPLAY_DECL_NAME("TableBorderCollapse", TYPE_TABLE_BORDER_COLLAPSE) }; -#ifdef DEBUG -static bool -IsFrameAllowedInTable(nsIAtom* aType) -{ - return IS_TABLE_CELL(aType) || - nsGkAtoms::tableRowFrame == aType || - nsGkAtoms::tableRowGroupFrame == aType || - nsGkAtoms::scrollFrame == aType || - nsGkAtoms::tableFrame == aType || - nsGkAtoms::tableColFrame == aType || - nsGkAtoms::tableColGroupFrame == aType; -} -#endif - void -nsDisplayTableBorderBackground::Paint(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx) +nsDisplayTableBorderCollapse::Paint(nsDisplayListBuilder* aBuilder, + nsRenderingContext* aCtx) { - DrawResult result = static_cast<nsTableFrame*>(mFrame)-> - PaintTableBorderBackground(aBuilder, *aCtx, mVisibleRect, - ToReferenceFrame()); + nsPoint pt = ToReferenceFrame(); + DrawTarget* drawTarget = aCtx->GetDrawTarget(); - nsDisplayTableItemGeometry::UpdateDrawResult(this, result); -} + gfxPoint devPixelOffset = + nsLayoutUtils::PointToGfxPoint(pt, mFrame->PresContext()->AppUnitsPerDevPixel()); -static int32_t -GetTablePartRank(nsDisplayItem* aItem) -{ - nsIAtom* type = aItem->Frame()->GetType(); - if (type == nsGkAtoms::tableFrame) - return 0; - if (type == nsGkAtoms::tableRowGroupFrame) - return 1; - if (type == nsGkAtoms::tableRowFrame) - return 2; - return 3; -} + AutoRestoreTransform autoRestoreTransform(drawTarget); + drawTarget->SetTransform( + drawTarget->GetTransform().PreTranslate(ToPoint(devPixelOffset))); -static bool CompareByTablePartRank(nsDisplayItem* aItem1, nsDisplayItem* aItem2, - void* aClosure) -{ - return GetTablePartRank(aItem1) <= GetTablePartRank(aItem2); + static_cast<nsTableFrame*>(mFrame)->PaintBCBorders(*drawTarget, mVisibleRect - pt); } /* static */ void @@ -1206,31 +1178,75 @@ nsTableFrame::GenericTraversal(nsDisplayListBuilder* aBuilder, nsFrame* aFrame, // stacking context, in which case the child won't use its passed-in // BorderBackground list anyway. It does affect cell borders though; this // lets us get cell borders into the nsTableFrame's BorderBackground list. + for (nsIFrame* kid : aFrame->GetChildList(kColGroupList)) { + aFrame->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists); + } + for (nsIFrame* kid : aFrame->PrincipalChildList()) { aFrame->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists); } } +static void +PaintRowBackground(nsTableRowFrame* aRow, + nsIFrame* aFrame, + nsDisplayListBuilder* aBuilder, + const nsDisplayListSet& aLists, + const nsPoint& aOffset = nsPoint()) +{ + // Compute background rect by iterating over all cell frames. + for (nsTableCellFrame* cell = aRow->GetFirstCell(); cell; cell = cell->GetNextCell()) { + auto cellRect = cell->GetRectRelativeToSelf() + cell->GetNormalPosition() + aOffset; + nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect, + aLists.BorderBackground(), + true, nullptr, + aFrame->GetRectRelativeToSelf(), + cell); + } +} + +static void +PaintRowGroupBackground(nsTableRowGroupFrame* aRowGroup, + nsIFrame* aFrame, + nsDisplayListBuilder* aBuilder, + const nsDisplayListSet& aLists) +{ + for (nsTableRowFrame* row = aRowGroup->GetFirstRow(); row; row = row->GetNextRow()) { + PaintRowBackground(row, aFrame, aBuilder, aLists, row->GetNormalPosition()); + } +} + +static void +PaintRowGroupBackgroundByColIdx(nsTableRowGroupFrame* aRowGroup, + nsIFrame* aFrame, + nsDisplayListBuilder* aBuilder, + const nsDisplayListSet& aLists, + const nsTArray<int32_t>& aColIdx, + const nsPoint& aOffset) +{ + for (nsTableRowFrame* row = aRowGroup->GetFirstRow(); row; row = row->GetNextRow()) { + for (nsTableCellFrame* cell = row->GetFirstCell(); cell; cell = cell->GetNextCell()) { + int32_t curColIdx; + cell->GetColIndex(curColIdx); + if (aColIdx.Contains(curColIdx)) { + auto cellRect = cell->GetRectRelativeToSelf() + cell->GetNormalPosition() + row->GetNormalPosition() + aOffset; + nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect, + aLists.BorderBackground(), + true, nullptr, + aFrame->GetRectRelativeToSelf(), + cell); + } + } + } +} + /* static */ void nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder, nsFrame* aFrame, const nsRect& aDirtyRect, const nsDisplayListSet& aLists, - nsDisplayTableItem* aDisplayItem, DisplayGenericTablePartTraversal aTraversal) { - nsDisplayList eventsBorderBackground; - // If we need to sort the event backgrounds, then we'll put descendants' - // display items into their own set of lists. - bool sortEventBackgrounds = aDisplayItem && aBuilder->IsForEventDelivery(); - nsDisplayListCollection separatedCollection; - const nsDisplayListSet* lists = sortEventBackgrounds ? &separatedCollection : &aLists; - - nsAutoPushCurrentTableItem pushTableItem; - if (aDisplayItem) { - pushTableItem.Push(aBuilder, aDisplayItem); - } - if (aFrame->IsVisibleForPainting(aBuilder)) { nsDisplayTableItem* currentItem = aBuilder->GetCurrentTableItem(); // currentItem may be null, when none of the table parts have a @@ -1242,72 +1258,79 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder, // Paint the outset box-shadows for the table frames bool hasBoxShadow = aFrame->StyleEffects()->mBoxShadow != nullptr; if (hasBoxShadow) { - lists->BorderBackground()->AppendNewToTop( + aLists.BorderBackground()->AppendNewToTop( new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, aFrame)); } - // Create dedicated background display items per-frame when we're - // handling events. - // XXX how to handle collapsed borders? - if (aBuilder->IsForEventDelivery()) { + if (aFrame->GetType() == nsGkAtoms::tableRowGroupFrame) { + nsTableRowGroupFrame* rowGroup = static_cast<nsTableRowGroupFrame*>(aFrame); + PaintRowGroupBackground(rowGroup, aFrame, aBuilder, aLists); + } else if (aFrame->GetType() == nsGkAtoms::tableRowFrame) { + nsTableRowFrame* row = static_cast<nsTableRowFrame*>(aFrame); + PaintRowBackground(row, aFrame, aBuilder, aLists); + } else if (aFrame->GetType() == nsGkAtoms::tableColGroupFrame) { + // Compute background rect by iterating all cell frame. + nsTableColGroupFrame* colGroup = static_cast<nsTableColGroupFrame*>(aFrame); + // Collecting column index. + AutoTArray<int32_t, 1> colIdx; + for (nsTableColFrame* col = colGroup->GetFirstColumn(); col; col = col->GetNextCol()) { + colIdx.AppendElement(col->GetColIndex()); + } + + nsTableFrame* table = colGroup->GetTableFrame(); + RowGroupArray rowGroups; + table->OrderRowGroups(rowGroups); + for (nsTableRowGroupFrame* rowGroup : rowGroups) { + auto offset = rowGroup->GetNormalPosition() - colGroup->GetNormalPosition(); + PaintRowGroupBackgroundByColIdx(rowGroup, aFrame, aBuilder, aLists, colIdx, offset); + } + } else if (aFrame->GetType() == nsGkAtoms::tableColFrame) { + // Compute background rect by iterating all cell frame. + nsTableColFrame* col = static_cast<nsTableColFrame*>(aFrame); + AutoTArray<int32_t, 1> colIdx; + colIdx.AppendElement(col->GetColIndex()); + + nsTableFrame* table = col->GetTableFrame(); + RowGroupArray rowGroups; + table->OrderRowGroups(rowGroups); + for (nsTableRowGroupFrame* rowGroup : rowGroups) { + auto offset = rowGroup->GetNormalPosition() - + col->GetNormalPosition() - + col->GetTableColGroupFrame()->GetNormalPosition(); + PaintRowGroupBackgroundByColIdx(rowGroup, aFrame, aBuilder, aLists, colIdx, offset); + } + } else { nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, aFrame->GetRectRelativeToSelf(), - lists->BorderBackground()); + aLists.BorderBackground()); } // Paint the inset box-shadows for the table frames if (hasBoxShadow) { - lists->BorderBackground()->AppendNewToTop( + aLists.BorderBackground()->AppendNewToTop( new (aBuilder) nsDisplayBoxShadowInner(aBuilder, aFrame)); } } - aTraversal(aBuilder, aFrame, aDirtyRect, *lists); + aTraversal(aBuilder, aFrame, aDirtyRect, aLists); - if (sortEventBackgrounds) { - // Ensure that the table frame event background goes before the - // table rowgroups event backgrounds, before the table row event backgrounds, - // before everything else (cells and their blocks) - separatedCollection.BorderBackground()->Sort(CompareByTablePartRank, nullptr); - separatedCollection.MoveTo(aLists); + if (aFrame->IsVisibleForPainting(aBuilder)) { + if (aFrame->GetType() == nsGkAtoms::tableFrame) { + nsTableFrame* table = static_cast<nsTableFrame*>(aFrame); + // In the collapsed border model, overlay all collapsed borders. + if (table->IsBorderCollapse()) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table)); + } else { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayBorder(aBuilder, table)); + } + } } aFrame->DisplayOutline(aBuilder, aLists); } -static bool -AnyTablePartHasBorderOrBackground(nsIFrame* aStart, nsIFrame* aEnd) -{ - for (nsIFrame* f = aStart; f != aEnd; f = f->GetNextSibling()) { - NS_ASSERTION(IsFrameAllowedInTable(f->GetType()), "unexpected frame type"); - - if (FrameHasBorderOrBackground(f)) - return true; - - nsTableCellFrame *cellFrame = do_QueryFrame(f); - if (cellFrame) - continue; - - if (AnyTablePartHasBorderOrBackground(f->PrincipalChildList().FirstChild(), nullptr)) - return true; - } - - return false; -} - -static void -UpdateItemForColGroupBackgrounds(nsDisplayTableItem* item, - const nsFrameList& aFrames) { - for (nsFrameList::Enumerator e(aFrames); !e.AtEnd(); e.Next()) { - nsTableColGroupFrame* cg = static_cast<nsTableColGroupFrame*>(e.get()); - item->UpdateForFrameBackground(cg); - for (nsTableColFrame* colFrame = cg->GetFirstColumn(); colFrame; - colFrame = colFrame->GetNextCol()) { - item->UpdateForFrameBackground(colFrame); - } - } -} - // table paint code is concerned primarily with borders and bg color // SEC: TODO: adjust the rect for captions void @@ -1317,35 +1340,7 @@ nsTableFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, { DO_GLOBAL_REFLOW_COUNT_DSP_COLOR("nsTableFrame", NS_RGB(255,128,255)); - nsDisplayTableItem* item = nullptr; - if (IsVisibleInSelection(aBuilder)) { - nsMargin deflate = GetDeflationForBackground(PresContext()); - if (StyleVisibility()->IsVisible()) { - // If 'deflate' is (0,0,0,0) then we can paint the table background - // in its own display item, so do that to take advantage of - // opacity and visibility optimizations - if (deflate == nsMargin(0, 0, 0, 0)) { - DisplayBackgroundUnconditional(aBuilder, aLists, false); - } - } - - // This background is created if any of the table parts are visible, - // or if we're doing event handling (since DisplayGenericTablePart - // needs the item for the |sortEventBackgrounds|-dependent code). - // Specific visibility decisions are delegated to the table background - // painter, which handles borders and backgrounds for the table. - if (aBuilder->IsForEventDelivery() || - AnyTablePartHasBorderOrBackground(this, GetNextSibling()) || - AnyTablePartHasBorderOrBackground(mColGroups.FirstChild(), nullptr)) { - item = new (aBuilder) nsDisplayTableBorderBackground(aBuilder, this, - deflate != nsMargin(0, 0, 0, 0)); - aLists.BorderBackground()->AppendNewToTop(item); - } - } - DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists, item); - if (item) { - UpdateItemForColGroupBackgrounds(item, mColGroups); - } + DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists); } nsMargin @@ -1359,59 +1354,6 @@ nsTableFrame::GetDeflationForBackground(nsPresContext* aPresContext) const return GetOuterBCBorder(wm).GetPhysicalMargin(wm); } -// XXX We don't put the borders and backgrounds in tree order like we should. -// That requires some major surgery which we aren't going to do right now. -DrawResult -nsTableFrame::PaintTableBorderBackground(nsDisplayListBuilder* aBuilder, - nsRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - nsPoint aPt) -{ - nsPresContext* presContext = PresContext(); - - uint32_t bgFlags = aBuilder->GetBackgroundPaintFlags(); - PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages() - ? PaintBorderFlags::SYNC_DECODE_IMAGES - : PaintBorderFlags(); - - TableBackgroundPainter painter(this, TableBackgroundPainter::eOrigin_Table, - presContext, aRenderingContext, - aDirtyRect, aPt, bgFlags); - nsMargin deflate = GetDeflationForBackground(presContext); - // If 'deflate' is (0,0,0,0) then we'll paint the table background - // in a separate display item, so don't do it here. - DrawResult result = - painter.PaintTable(this, deflate, deflate != nsMargin(0, 0, 0, 0)); - - if (StyleVisibility()->IsVisible()) { - if (!IsBorderCollapse()) { - Sides skipSides = GetSkipSides(); - nsRect rect(aPt, mRect.Size()); - - result &= - nsCSSRendering::PaintBorder(presContext, aRenderingContext, this, - aDirtyRect, rect, mStyleContext, - borderFlags, skipSides); - } else { - DrawTarget* drawTarget = aRenderingContext.GetDrawTarget(); - - gfxPoint devPixelOffset = - nsLayoutUtils::PointToGfxPoint(aPt, - PresContext()->AppUnitsPerDevPixel()); - - // XXX we should probably get rid of this translation at some stage - // But that would mean modifying PaintBCBorders, ugh - AutoRestoreTransform autoRestoreTransform(drawTarget); - drawTarget->SetTransform( - drawTarget->GetTransform().PreTranslate(ToPoint(devPixelOffset))); - - PaintBCBorders(*drawTarget, aDirtyRect - aPt); - } - } - - return result; -} - nsIFrame::LogicalSides nsTableFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const { @@ -1564,16 +1506,15 @@ nsTableFrame::GetPrefISize(nsRenderingContext *aRenderingContext) } /* virtual */ nsIFrame::IntrinsicISizeOffsetData -nsTableFrame::IntrinsicISizeOffsets() +nsTableFrame::IntrinsicISizeOffsets(nscoord aPercentageBasis) { - IntrinsicISizeOffsetData result = nsContainerFrame::IntrinsicISizeOffsets(); + IntrinsicISizeOffsetData result = + nsContainerFrame::IntrinsicISizeOffsets(aPercentageBasis); result.hMargin = 0; - result.hPctMargin = 0; if (IsBorderCollapse()) { result.hPadding = 0; - result.hPctPadding = 0; WritingMode wm = GetWritingMode(); LogicalMargin outerBC = GetIncludedOuterBCBorder(wm); diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 7e56c28c1..a6b786402 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -250,7 +250,6 @@ public: nsFrame* aFrame, const nsRect& aDirtyRect, const nsDisplayListSet& aLists, - nsDisplayTableItem* aDisplayItem, DisplayGenericTablePartTraversal aTraversal = GenericTraversal); // Return the closest sibling of aPriorChildFrame (including aPriroChildFrame) @@ -272,16 +271,6 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) override; - /** - * Paint the background of the table and its parts (column groups, - * columns, row groups, rows, and cells), and the table border, and all - * internal borders if border-collapse is on. - */ - DrawResult PaintTableBorderBackground(nsDisplayListBuilder* aBuilder, - nsRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - nsPoint aPt); - /** Get the outer half (i.e., the part outside the height and width of * the table) of the largest segment (?) of border-collapsed border on * the table on each side, or 0 for non border-collapsed tables. @@ -324,7 +313,8 @@ public: // border to the results of these functions. virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override; virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override; - virtual IntrinsicISizeOffsetData IntrinsicISizeOffsets() override; + IntrinsicISizeOffsetData IntrinsicISizeOffsets(nscoord aPercentageBasis = + NS_UNCONSTRAINEDSIZE) override; virtual mozilla::LogicalSize ComputeSize(nsRenderingContext* aRenderingContext, diff --git a/layout/tables/nsTablePainter.cpp b/layout/tables/nsTablePainter.cpp deleted file mode 100644 index bfe2a7d42..000000000 --- a/layout/tables/nsTablePainter.cpp +++ /dev/null @@ -1,696 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsTableFrame.h" -#include "nsTableRowGroupFrame.h" -#include "nsTableRowFrame.h" -#include "nsTableColGroupFrame.h" -#include "nsTableColFrame.h" -#include "nsTableCellFrame.h" -#include "nsTablePainter.h" -#include "nsCSSRendering.h" -#include "nsDisplayList.h" -#include "mozilla/WritingModes.h" - -/* ~*~ Table Background Painting ~*~ - - Mozilla's Table Background painting follows CSS2.1:17.5.1 - That section does not, however, describe the effect of - borders on background image positioning. What we do is: - - - in separate borders, the borders are passed in so that - their width figures in image positioning, even for rows/cols, which - don't have visible borders. This is done to allow authors - to position row backgrounds by, for example, aligning the - top left corner with the top left padding corner of the - top left table cell in the row in cases where all cells - have consistent border widths. If we didn't honor these - invisible borders, there would be no way to align - backgrounds with the padding edges, and designs would be - lost underneath the border. - - - in collapsing borders, because the borders collapse, we - use the -continuous border- width to synthesize a border - style and pass that in instead of using the element's - assigned style directly. - - The continuous border on a given edge of an element is - the collapse of all borders guaranteed to be continuous - along that edge. Cell borders are ignored (because, for - example, setting a thick border on the leftmost cell - should not shift the row background over; this way a - striped background set on <tr> will line up across rows - even if the cells are assigned arbitrary border widths. - - For example, the continuous border on the top edge of a - row group is the collapse of any row group, row, and - table borders involved. (The first row group's top would - be [table-top + row group top + first row top]. It's bottom - would be [row group bottom + last row bottom + next row - top + next row group top].) - The top edge of a column group likewise includes the - table top, row group top, and first row top borders. However, - it *also* includes its own top border, since that is guaranteed - to be continuous. It does not include column borders because - those are not guaranteed to be continuous: there may be two - columns with different borders in a single column group. - - An alternative would be to define the continuous border as - [table? + row group + row] for horizontal - [table? + col group + col] for vertical - This makes it easier to line up backgrounds across elements - despite varying border widths, but it does not give much - flexibility in aligning /to/ those border widths. -*/ - - -/* ~*~ TableBackgroundPainter ~*~ - - The TableBackgroundPainter is created and destroyed in one painting call. - Its principal function is PaintTable, which paints all table element - backgrounds. The initial code in that method sets up an array of column - data that caches the background styles and the border sizes for the - columns and colgroups in TableBackgroundData structs in mCols. Data for - BC borders are calculated and stashed in a synthesized border style struct - in the data struct since collapsed borders aren't the same width as style- - assigned borders. The data struct optimizes by only doing this if there's - an image background; otherwise we don't care. //XXX should also check background-origin - The class then loops through the row groups, rows, and cells. At the cell - level, it paints the backgrounds, one over the other, inside the cell rect. - - The exception to this pattern is when a table element creates a (pseudo) - stacking context. Elements with stacking contexts (e.g., 'opacity' applied) - are <dfn>passed through</dfn>, which means their data (and their - descendants' data) are not cached. The full loop is still executed, however, - so that underlying layers can get painted at the cell level. - - The TableBackgroundPainter is then destroyed. - - Elements with stacking contexts set up their own painter to finish the - painting process, since they were skipped. They call the appropriate - sub-part of the loop (e.g. PaintRow) which will paint the frame and - descendants. - - XXX views are going - */ - -using namespace mozilla; -using namespace mozilla::image; - -TableBackgroundPainter::TableBackgroundData::TableBackgroundData() - : mFrame(nullptr) - , mVisible(false) - , mUsesSynthBorder(false) -{ -} - -TableBackgroundPainter::TableBackgroundData::TableBackgroundData(nsIFrame* aFrame) - : mFrame(aFrame) - , mRect(aFrame->GetRect()) - , mVisible(mFrame->IsVisibleForPainting()) - , mUsesSynthBorder(false) -{ -} - -inline bool -TableBackgroundPainter::TableBackgroundData::ShouldSetBCBorder() const -{ - /* we only need accurate border data when positioning background images*/ - if (!mVisible) { - return false; - } - - const nsStyleImageLayers& layers = mFrame->StyleBackground()->mImage; - NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, layers) { - if (!layers.mLayers[i].mImage.IsEmpty()) - return true; - } - return false; -} - -void -TableBackgroundPainter::TableBackgroundData::SetBCBorder(const nsMargin& aBorder) -{ - mUsesSynthBorder = true; - mSynthBorderWidths = aBorder; -} - -nsStyleBorder -TableBackgroundPainter::TableBackgroundData::StyleBorder(const nsStyleBorder& aZeroBorder) const -{ - MOZ_ASSERT(mVisible, "Don't call StyleBorder on an invisible TableBackgroundData"); - - if (mUsesSynthBorder) { - nsStyleBorder result = aZeroBorder; - NS_FOR_CSS_SIDES(side) { - result.SetBorderWidth(side, mSynthBorderWidths.Side(side)); - } - return result; - } - - MOZ_ASSERT(mFrame); - - return *mFrame->StyleBorder(); -} - -TableBackgroundPainter::TableBackgroundPainter(nsTableFrame* aTableFrame, - Origin aOrigin, - nsPresContext* aPresContext, - nsRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - const nsPoint& aRenderPt, - uint32_t aBGPaintFlags) - : mPresContext(aPresContext), - mRenderingContext(aRenderingContext), - mRenderPt(aRenderPt), - mDirtyRect(aDirtyRect), - mOrigin(aOrigin), - mZeroBorder(aPresContext), - mBGPaintFlags(aBGPaintFlags) -{ - MOZ_COUNT_CTOR(TableBackgroundPainter); - - NS_FOR_CSS_SIDES(side) { - mZeroBorder.SetBorderStyle(side, NS_STYLE_BORDER_STYLE_SOLID); - mZeroBorder.SetBorderWidth(side, 0); - } - - mIsBorderCollapse = aTableFrame->IsBorderCollapse(); -#ifdef DEBUG - mCompatMode = mPresContext->CompatibilityMode(); -#endif - mNumCols = aTableFrame->GetColCount(); -} - -TableBackgroundPainter::~TableBackgroundPainter() -{ - MOZ_COUNT_DTOR(TableBackgroundPainter); -} - -DrawResult -TableBackgroundPainter::PaintTableFrame(nsTableFrame* aTableFrame, - nsTableRowGroupFrame* aFirstRowGroup, - nsTableRowGroupFrame* aLastRowGroup, - const nsMargin& aDeflate) -{ - MOZ_ASSERT(aTableFrame, "null frame"); - TableBackgroundData tableData(aTableFrame); - tableData.mRect.MoveTo(0,0); //using table's coords - tableData.mRect.Deflate(aDeflate); - WritingMode wm = aTableFrame->GetWritingMode(); - if (mIsBorderCollapse && tableData.ShouldSetBCBorder()) { - if (aFirstRowGroup && aLastRowGroup && mNumCols > 0) { - //only handle non-degenerate tables; we need a more robust BC model - //to make degenerate tables' borders reasonable to deal with - LogicalMargin border(wm); - LogicalMargin tempBorder(wm); - nsTableColFrame* colFrame = aTableFrame->GetColFrame(mNumCols - 1); - if (colFrame) { - colFrame->GetContinuousBCBorderWidth(wm, tempBorder); - } - border.IEnd(wm) = tempBorder.IEnd(wm); - - aLastRowGroup->GetContinuousBCBorderWidth(wm, tempBorder); - border.BEnd(wm) = tempBorder.BEnd(wm); - - nsTableRowFrame* rowFrame = aFirstRowGroup->GetFirstRow(); - if (rowFrame) { - rowFrame->GetContinuousBCBorderWidth(wm, tempBorder); - border.BStart(wm) = tempBorder.BStart(wm); - } - - border.IStart(wm) = aTableFrame->GetContinuousIStartBCBorderWidth(); - - tableData.SetBCBorder(border.GetPhysicalMargin(wm)); - } - } - - DrawResult result = DrawResult::SUCCESS; - - if (tableData.IsVisible()) { - nsCSSRendering::PaintBGParams params = - nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, - mRenderingContext, - mDirtyRect, - tableData.mRect + mRenderPt, - tableData.mFrame, - mBGPaintFlags); - - result &= - nsCSSRendering::PaintBackgroundWithSC(params, - tableData.mFrame->StyleContext(), - tableData.StyleBorder(mZeroBorder)); - } - - return result; -} - -void -TableBackgroundPainter::TranslateContext(nscoord aDX, - nscoord aDY) -{ - mRenderPt += nsPoint(aDX, aDY); - for (auto& col : mCols) { - col.mCol.mRect.MoveBy(-aDX, -aDY); - } - for (auto& colGroup : mColGroups) { - colGroup.mRect.MoveBy(-aDX, -aDY); - } -} - -TableBackgroundPainter::ColData::ColData(nsIFrame* aFrame, TableBackgroundData& aColGroupBGData) - : mCol(aFrame) - , mColGroup(aColGroupBGData) -{ -} - -DrawResult -TableBackgroundPainter::PaintTable(nsTableFrame* aTableFrame, - const nsMargin& aDeflate, - bool aPaintTableBackground) -{ - NS_PRECONDITION(aTableFrame, "null table frame"); - - nsTableFrame::RowGroupArray rowGroups; - aTableFrame->OrderRowGroups(rowGroups); - WritingMode wm = aTableFrame->GetWritingMode(); - - DrawResult result = DrawResult::SUCCESS; - - if (rowGroups.Length() < 1) { //degenerate case - if (aPaintTableBackground) { - result &= PaintTableFrame(aTableFrame, nullptr, nullptr, nsMargin(0,0,0,0)); - } - /* No cells; nothing else to paint */ - return result; - } - - if (aPaintTableBackground) { - result &= - PaintTableFrame(aTableFrame, rowGroups[0], rowGroups[rowGroups.Length() - 1], - aDeflate); - } - - /*Set up column background/border data*/ - if (mNumCols > 0) { - nsFrameList& colGroupList = aTableFrame->GetColGroups(); - NS_ASSERTION(colGroupList.FirstChild(), "table should have at least one colgroup"); - - // Collect all col group frames first so that we know how many there are. - nsTArray<nsTableColGroupFrame*> colGroupFrames; - for (nsTableColGroupFrame* cgFrame = static_cast<nsTableColGroupFrame*>(colGroupList.FirstChild()); - cgFrame; cgFrame = static_cast<nsTableColGroupFrame*>(cgFrame->GetNextSibling())) { - - if (cgFrame->GetColCount() < 1) { - //No columns, no cells, so no need for data - continue; - } - colGroupFrames.AppendElement(cgFrame); - } - - // Ensure that mColGroups won't reallocate during the loop below, because - // we grab references to its contents and need those to stay valid until - // mColGroups is destroyed as part of TablePainter destruction. - mColGroups.SetCapacity(colGroupFrames.Length()); - - LogicalMargin border(wm); - /* BC iStart borders aren't stored on cols, but the previous column's - iEnd border is the next one's iStart border.*/ - //Start with table's iStart border. - nscoord lastIStartBorder = aTableFrame->GetContinuousIStartBCBorderWidth(); - - for (nsTableColGroupFrame* cgFrame : colGroupFrames) { - /*Create data struct for column group*/ - TableBackgroundData& cgData = *mColGroups.AppendElement(TableBackgroundData(cgFrame)); - if (mIsBorderCollapse && cgData.ShouldSetBCBorder()) { - border.IStart(wm) = lastIStartBorder; - cgFrame->GetContinuousBCBorderWidth(wm, border); - cgData.SetBCBorder(border.GetPhysicalMargin(wm)); - } - - /*Loop over columns in this colgroup*/ - for (nsTableColFrame* col = cgFrame->GetFirstColumn(); col; - col = static_cast<nsTableColFrame*>(col->GetNextSibling())) { - MOZ_ASSERT(size_t(col->GetColIndex()) == mCols.Length()); - // Store a reference to the colGroup in the ColData element. - ColData& colData = *mCols.AppendElement(ColData(col, cgData)); - //Bring column mRect into table's coord system - colData.mCol.mRect.MoveBy(cgData.mRect.x, cgData.mRect.y); - if (mIsBorderCollapse) { - border.IStart(wm) = lastIStartBorder; - lastIStartBorder = col->GetContinuousBCBorderWidth(wm, border); - if (colData.mCol.ShouldSetBCBorder()) { - colData.mCol.SetBCBorder(border.GetPhysicalMargin(wm)); - } - } - } - } - } - - for (uint32_t i = 0; i < rowGroups.Length(); i++) { - nsTableRowGroupFrame* rg = rowGroups[i]; - TableBackgroundData rowGroupBGData(rg); - // Need to compute the right rect via GetOffsetTo, since the row - // group may not be a child of the table. - rowGroupBGData.mRect.MoveTo(rg->GetOffsetTo(aTableFrame)); - - // We have to draw backgrounds not only within the overflow region of this - // row group, but also possibly (in the case of column / column group - // backgrounds) at its pre-relative-positioning location. - nsRect rgVisualOverflow = rg->GetVisualOverflowRectRelativeToSelf(); - nsRect rgOverflowRect = rgVisualOverflow + rg->GetPosition(); - nsRect rgNormalRect = rgVisualOverflow + rg->GetNormalPosition(); - - if (rgOverflowRect.Union(rgNormalRect).Intersects(mDirtyRect - mRenderPt)) { - result &= - PaintRowGroup(rg, rowGroupBGData, rg->IsPseudoStackingContextFromStyle()); - } - } - - return result; -} - -DrawResult -TableBackgroundPainter::PaintRowGroup(nsTableRowGroupFrame* aFrame) -{ - return PaintRowGroup(aFrame, TableBackgroundData(aFrame), false); -} - -DrawResult -TableBackgroundPainter::PaintRowGroup(nsTableRowGroupFrame* aFrame, - TableBackgroundData aRowGroupBGData, - bool aPassThrough) -{ - MOZ_ASSERT(aFrame, "null frame"); - - nsTableRowFrame* firstRow = aFrame->GetFirstRow(); - WritingMode wm = aFrame->GetWritingMode(); - - /* Load row group data */ - if (aPassThrough) { - aRowGroupBGData.MakeInvisible(); - } else { - if (mIsBorderCollapse && aRowGroupBGData.ShouldSetBCBorder()) { - LogicalMargin border(wm); - if (firstRow) { - //pick up first row's bstart border (= rg bstart border) - firstRow->GetContinuousBCBorderWidth(wm, border); - /* (row group doesn't store its bstart border) */ - } - //overwrite sides+bottom borders with rg's own - aFrame->GetContinuousBCBorderWidth(wm, border); - aRowGroupBGData.SetBCBorder(border.GetPhysicalMargin(wm)); - } - aPassThrough = !aRowGroupBGData.IsVisible(); - } - - /* translate everything into row group coord system*/ - if (eOrigin_TableRowGroup != mOrigin) { - TranslateContext(aRowGroupBGData.mRect.x, aRowGroupBGData.mRect.y); - } - nsRect rgRect = aRowGroupBGData.mRect; - aRowGroupBGData.mRect.MoveTo(0, 0); - - /* Find the right row to start with */ - - // Note that mDirtyRect - mRenderPt is guaranteed to be in the row - // group's coordinate system here, so passing its .y to - // GetFirstRowContaining is ok. - nscoord overflowAbove; - nsIFrame* cursor = aFrame->GetFirstRowContaining(mDirtyRect.y - mRenderPt.y, &overflowAbove); - - // Sadly, it seems like there may be non-row frames in there... or something? - // There are certainly null-checks in GetFirstRow() and GetNextRow(). :( - while (cursor && cursor->GetType() != nsGkAtoms::tableRowFrame) { - cursor = cursor->GetNextSibling(); - } - - // It's OK if cursor is null here. - nsTableRowFrame* row = static_cast<nsTableRowFrame*>(cursor); - if (!row) { - // No useful cursor; just start at the top. Don't bother to set up a - // cursor; if we've gotten this far then we've already built the display - // list for the rowgroup, so not having a cursor means that there's some - // good reason we don't have a cursor and we shouldn't create one here. - row = firstRow; - } - - DrawResult result = DrawResult::SUCCESS; - - /* Finally paint */ - for (; row; row = row->GetNextRow()) { - TableBackgroundData rowBackgroundData(row); - - // Be sure to consider our positions both pre- and post-relative - // positioning, since we potentially need to paint at both places. - nscoord rowY = std::min(rowBackgroundData.mRect.y, row->GetNormalPosition().y); - - // Intersect wouldn't handle rowspans. - if (cursor && - (mDirtyRect.YMost() - mRenderPt.y) <= (rowY - overflowAbove)) { - // All done; cells originating in later rows can't intersect mDirtyRect. - break; - } - - result &= - PaintRow(row, aRowGroupBGData, rowBackgroundData, - aPassThrough || row->IsPseudoStackingContextFromStyle()); - } - - /* translate back into table coord system */ - if (eOrigin_TableRowGroup != mOrigin) { - TranslateContext(-rgRect.x, -rgRect.y); - } - - return result; -} - -DrawResult -TableBackgroundPainter::PaintRow(nsTableRowFrame* aFrame) -{ - return PaintRow(aFrame, TableBackgroundData(), TableBackgroundData(aFrame), false); -} - -DrawResult -TableBackgroundPainter::PaintRow(nsTableRowFrame* aFrame, - const TableBackgroundData& aRowGroupBGData, - TableBackgroundData aRowBGData, - bool aPassThrough) -{ - MOZ_ASSERT(aFrame, "null frame"); - - /* Load row data */ - WritingMode wm = aFrame->GetWritingMode(); - if (aPassThrough) { - aRowBGData.MakeInvisible(); - } else { - if (mIsBorderCollapse && aRowBGData.ShouldSetBCBorder()) { - LogicalMargin border(wm); - nsTableRowFrame* nextRow = aFrame->GetNextRow(); - if (nextRow) { //outer bStart after us is inner bEnd for us - border.BEnd(wm) = nextRow->GetOuterBStartContBCBorderWidth(); - } - else { //acquire rg's bEnd border - nsTableRowGroupFrame* rowGroup = static_cast<nsTableRowGroupFrame*>(aFrame->GetParent()); - rowGroup->GetContinuousBCBorderWidth(wm, border); - } - //get the rest of the borders; will overwrite all but bEnd - aFrame->GetContinuousBCBorderWidth(wm, border); - - aRowBGData.SetBCBorder(border.GetPhysicalMargin(wm)); - } - aPassThrough = !aRowBGData.IsVisible(); - } - - /* Translate */ - if (eOrigin_TableRow == mOrigin) { - /* If we originate from the row, then make the row the origin. */ - aRowBGData.mRect.MoveTo(0, 0); - } - //else: Use row group's coord system -> no translation necessary - - DrawResult result = DrawResult::SUCCESS; - - for (nsTableCellFrame* cell = aFrame->GetFirstCell(); cell; cell = cell->GetNextCell()) { - nsRect cellBGRect, rowBGRect, rowGroupBGRect, colBGRect; - ComputeCellBackgrounds(cell, aRowGroupBGData, aRowBGData, - cellBGRect, rowBGRect, - rowGroupBGRect, colBGRect); - - // Find the union of all the cell background layers. - nsRect combinedRect(cellBGRect); - combinedRect.UnionRect(combinedRect, rowBGRect); - combinedRect.UnionRect(combinedRect, rowGroupBGRect); - combinedRect.UnionRect(combinedRect, colBGRect); - - if (combinedRect.Intersects(mDirtyRect)) { - bool passCell = aPassThrough || cell->IsPseudoStackingContextFromStyle(); - result &= - PaintCell(cell, aRowGroupBGData, aRowBGData, cellBGRect, rowBGRect, - rowGroupBGRect, colBGRect, passCell); - } - } - - return result; -} - -DrawResult -TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell, - const TableBackgroundData& aRowGroupBGData, - const TableBackgroundData& aRowBGData, - nsRect& aCellBGRect, - nsRect& aRowBGRect, - nsRect& aRowGroupBGRect, - nsRect& aColBGRect, - bool aPassSelf) -{ - MOZ_ASSERT(aCell, "null frame"); - - const nsStyleTableBorder* cellTableStyle; - cellTableStyle = aCell->StyleTableBorder(); - if (NS_STYLE_TABLE_EMPTY_CELLS_SHOW != cellTableStyle->mEmptyCells && - aCell->GetContentEmpty() && !mIsBorderCollapse) { - return DrawResult::SUCCESS; - } - - int32_t colIndex; - aCell->GetColIndex(colIndex); - // We're checking mNumCols instead of mCols.Length() here because mCols can - // be empty even if mNumCols > 0. - NS_ASSERTION(size_t(colIndex) < mNumCols, "out-of-bounds column index"); - if (size_t(colIndex) >= mNumCols) { - return DrawResult::SUCCESS; - } - - // If callers call PaintRowGroup or PaintRow directly, we haven't processed - // our columns. Ignore column / col group backgrounds in that case. - bool haveColumns = !mCols.IsEmpty(); - - DrawResult result = DrawResult::SUCCESS; - - //Paint column group background - if (haveColumns && mCols[colIndex].mColGroup.IsVisible()) { - nsCSSRendering::PaintBGParams params = - nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext, - mDirtyRect, - mCols[colIndex].mColGroup.mRect + mRenderPt, - mCols[colIndex].mColGroup.mFrame, - mBGPaintFlags); - params.bgClipRect = &aColBGRect; - result &= - nsCSSRendering::PaintBackgroundWithSC(params, - mCols[colIndex].mColGroup.mFrame->StyleContext(), - mCols[colIndex].mColGroup.StyleBorder(mZeroBorder)); - } - - //Paint column background - if (haveColumns && mCols[colIndex].mCol.IsVisible()) { - nsCSSRendering::PaintBGParams params = - nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext, - mDirtyRect, - mCols[colIndex].mCol.mRect + mRenderPt, - mCols[colIndex].mCol.mFrame, - mBGPaintFlags); - params.bgClipRect = &aColBGRect; - result &= - nsCSSRendering::PaintBackgroundWithSC(params, - mCols[colIndex].mCol.mFrame->StyleContext(), - mCols[colIndex].mCol.StyleBorder(mZeroBorder)); - } - - //Paint row group background - if (aRowGroupBGData.IsVisible()) { - nsCSSRendering::PaintBGParams params = - nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext, - mDirtyRect, - aRowGroupBGData.mRect + mRenderPt, - aRowGroupBGData.mFrame, mBGPaintFlags); - params.bgClipRect = &aRowGroupBGRect; - result &= - nsCSSRendering::PaintBackgroundWithSC(params, - aRowGroupBGData.mFrame->StyleContext(), - aRowGroupBGData.StyleBorder(mZeroBorder)); - } - - //Paint row background - if (aRowBGData.IsVisible()) { - nsCSSRendering::PaintBGParams params = - nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext, - mDirtyRect, - aRowBGData.mRect + mRenderPt, - aRowBGData.mFrame, mBGPaintFlags); - params.bgClipRect = &aRowBGRect; - result &= - nsCSSRendering::PaintBackgroundWithSC(params, - aRowBGData.mFrame->StyleContext(), - aRowBGData.StyleBorder(mZeroBorder)); - } - - //Paint cell background in border-collapse unless we're just passing - if (mIsBorderCollapse && !aPassSelf) { - result &= - aCell->PaintCellBackground(mRenderingContext, mDirtyRect, - aCellBGRect.TopLeft(), mBGPaintFlags); - } - - return result; -} - -void -TableBackgroundPainter::ComputeCellBackgrounds(nsTableCellFrame* aCell, - const TableBackgroundData& aRowGroupBGData, - const TableBackgroundData& aRowBGData, - nsRect& aCellBGRect, - nsRect& aRowBGRect, - nsRect& aRowGroupBGRect, - nsRect& aColBGRect) -{ - // We need to compute table background layer rects for this cell space, - // adjusted for possible relative positioning. This behavior is not specified - // at the time of this writing, but the approach below should be web - // compatible. - // - // Our goal is that relative positioning of a table part should leave - // backgrounds *under* that part unchanged. ("Under" being defined by CSS 2.1 - // Section 17.5.1.) If a cell is positioned, we do not expect the row - // background to move. On the other hand, the backgrounds of layers *above* - // the positioned part are taken along for the ride -- for example, - // positioning a row group will also cause the row background to be drawn in - // the new location, unless it has further positioning applied. - // - // Each table part layer has its position stored in the coordinate space of - // the layer below (which is to say, its geometric parent), and the stored - // position is the post-relative-positioning one. The position of each - // background layer rect is thus determined by peeling off successive table - // part layers, removing the contribution of each layer's positioning one by - // one. Every rect we generate will be the same size, the size of the cell - // space. - - // We cannot rely on the row group background data to be available, since some - // callers enter through PaintRow. - nsIFrame* rowGroupFrame = - aRowGroupBGData.mFrame ? aRowGroupBGData.mFrame : aRowBGData.mFrame->GetParent(); - - // The cell background goes at the cell's position, translated to use the same - // coordinate system as aRowBGData. - aCellBGRect = aCell->GetRect() + aRowBGData.mRect.TopLeft() + mRenderPt; - - // The row background goes at the normal position of the cell, which is to say - // the position without relative positioning applied. - aRowBGRect = aCellBGRect + (aCell->GetNormalPosition() - aCell->GetPosition()); - - // The row group background goes at the position we'd find the cell if neither - // the cell's relative positioning nor the row's were applied. - aRowGroupBGRect = aRowBGRect + - (aRowBGData.mFrame->GetNormalPosition() - aRowBGData.mFrame->GetPosition()); - - // The column and column group backgrounds (they're always at the same - // location, since relative positioning doesn't apply to columns or column - // groups) are drawn at the position we'd find the cell if none of the cell's, - // row's, or row group's relative positioning were applied. - aColBGRect = aRowGroupBGRect + - (rowGroupFrame->GetNormalPosition() - rowGroupFrame->GetPosition()); - -} diff --git a/layout/tables/nsTablePainter.h b/layout/tables/nsTablePainter.h deleted file mode 100644 index dfba42156..000000000 --- a/layout/tables/nsTablePainter.h +++ /dev/null @@ -1,268 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsTablePainter_h__ -#define nsTablePainter_h__ - -#include "imgIContainer.h" - -#include "celldata.h" - -// flags for Paint, PaintChild, PaintChildren are currently only used by tables. -//Table-based paint call; not a direct call as with views -#define NS_PAINT_FLAG_TABLE_BG_PAINT 0x00000001 -//Cells should paint their backgrounds only, no children -#define NS_PAINT_FLAG_TABLE_CELL_BG_PASS 0x00000002 - -class nsIFrame; -class nsTableFrame; -class nsTableRowGroupFrame; -class nsTableRowFrame; -class nsTableCellFrame; - -class TableBackgroundPainter -{ - /* - * Helper class for painting table backgrounds - * - */ - - typedef mozilla::image::DrawResult DrawResult; - - public: - - enum Origin { eOrigin_Table, eOrigin_TableRowGroup, eOrigin_TableRow }; - - /** Public constructor - * @param aTableFrame - the table's table frame - * @param aOrigin - what type of table frame is creating this instance - * @param aPresContext - the presentation context - * @param aRenderingContext - the rendering context - * @param aDirtyRect - the area that needs to be painted, - * relative to aRenderingContext - * @param aPt - offset of the table frame relative to - * aRenderingContext - * @param aBGPaintFlags - Flags of the nsCSSRendering::PAINTBG_* variety - */ - TableBackgroundPainter(nsTableFrame* aTableFrame, - Origin aOrigin, - nsPresContext* aPresContext, - nsRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - const nsPoint& aPt, - uint32_t aBGPaintFlags); - - /** Destructor */ - ~TableBackgroundPainter(); - - /* ~*~ The Border Collapse Painting Issue ~*~ - - In border-collapse, the *table* paints the cells' borders, - so we need to make sure the backgrounds get painted first - (underneath) by doing a cell-background-only painting pass. - */ - - /* ~*~ Using nsTablePainter Background Painting ~*~ - - A call to PaintTable will normally paint all of the table's - elements (except for the table background, if aPaintTableBackground - is false). - Elements with views however, will be skipped and must create their - own painter to call the appropriate paint function in their ::Paint - method (e.g. painter.PaintRow in nsTableRow::Paint) - */ - - /** Paint background for the table frame (if requested) and its children - * down through cells. - * (Cells themselves will only be painted in border collapse) - * Table must do a flagged TABLE_BG_PAINT ::Paint call on its - * children afterwards - * @param aTableFrame - the table frame - * @param aDeflate - deflation needed to bring table's mRect - * to the outer grid lines in border-collapse - * @param aPaintTableBackground - if true, the table background - * is included, otherwise it isn't - * @returns DrawResult::SUCCESS if all painting was successful. If some - * painting failed or an improved result could be achieved by sync - * decoding images, returns another value. - */ - DrawResult PaintTable(nsTableFrame* aTableFrame, const nsMargin& aDeflate, - bool aPaintTableBackground); - - /** Paint background for the row group and its children down through cells - * (Cells themselves will only be painted in border collapse) - * Standards mode only - * Table Row Group must do a flagged TABLE_BG_PAINT ::Paint call on its - * children afterwards - * @param aFrame - the table row group frame - * @returns DrawResult::SUCCESS if all painting was successful. If some - * painting failed or an improved result could be achieved by sync - * decoding images, returns another value. - */ - DrawResult PaintRowGroup(nsTableRowGroupFrame* aFrame); - - /** Paint background for the row and its children down through cells - * (Cells themselves will only be painted in border collapse) - * Standards mode only - * Table Row must do a flagged TABLE_BG_PAINT ::Paint call on its - * children afterwards - * @param aFrame - the table row frame - * @returns DrawResult::SUCCESS if all painting was successful. If some - * painting failed or an improved result could be achieved by sync - * decoding images, returns another value. - */ - DrawResult PaintRow(nsTableRowFrame* aFrame); - - private: - struct TableBackgroundData; - - /** Paint table frame's background - * @param aTableFrame - the table frame - * @param aFirstRowGroup - the first (in layout order) row group - * may be null - * @param aLastRowGroup - the last (in layout order) row group - * may be null - * @param aDeflate - adjustment to frame's rect (used for quirks BC) - * may be null - */ - DrawResult PaintTableFrame(nsTableFrame* aTableFrame, - nsTableRowGroupFrame* aFirstRowGroup, - nsTableRowGroupFrame* aLastRowGroup, - const nsMargin& aDeflate); - - /* aPassThrough params indicate whether to paint the element or to just - * pass through and paint underlying layers only. - * aRowGroupBGData is not a const reference because the function modifies - * its copy. Same for aRowBGData in PaintRow. - * See Public versions for function descriptions - */ - DrawResult PaintRowGroup(nsTableRowGroupFrame* aFrame, - TableBackgroundData aRowGroupBGData, - bool aPassThrough); - - DrawResult PaintRow(nsTableRowFrame* aFrame, - const TableBackgroundData& aRowGroupBGData, - TableBackgroundData aRowBGData, - bool aPassThrough); - - /** Paint table background layers for this cell space - * Also paints cell's own background in border-collapse mode - * @param aCell - the cell - * @param aRowGroupBGData - background drawing info for the row group - * @param aRowBGData - background drawing info for the row - * @param aCellBGRect - background rect for the cell - * @param aRowBGRect - background rect for the row - * @param aRowGroupBGRect - background rect for the row group - * @param aColBGRect - background rect for the column and column group - * @param aPassSelf - pass this cell; i.e. paint only underlying layers - */ - DrawResult PaintCell(nsTableCellFrame* aCell, - const TableBackgroundData& aRowGroupBGData, - const TableBackgroundData& aRowBGData, - nsRect& aCellBGRect, - nsRect& aRowBGRect, - nsRect& aRowGroupBGRect, - nsRect& aColBGRect, - bool aPassSelf); - - /** Compute table background layer positions for this cell space - * @param aCell - the cell - * @param aRowGroupBGData - background drawing info for the row group - * @param aRowBGData - background drawing info for the row - * @param aCellBGRectOut - outparam: background rect for the cell - * @param aRowBGRectOut - outparam: background rect for the row - * @param aRowGroupBGRectOut - outparam: background rect for the row group - * @param aColBGRectOut - outparam: background rect for the column - and column group - */ - void ComputeCellBackgrounds(nsTableCellFrame* aCell, - const TableBackgroundData& aRowGroupBGData, - const TableBackgroundData& aRowBGData, - nsRect& aCellBGRect, - nsRect& aRowBGRect, - nsRect& aRowGroupBGRect, - nsRect& aColBGRect); - - /** Translate mRenderingContext, mDirtyRect, and mCols' column and - * colgroup coords - * @param aDX - origin's x-coord change - * @param aDY - origin's y-coord change - */ - void TranslateContext(nscoord aDX, - nscoord aDY); - - struct TableBackgroundData { - public: - /** - * Construct an empty TableBackgroundData instance, which is invisible. - */ - TableBackgroundData(); - - /** - * Construct a TableBackgroundData instance for a frame. Visibility will - * be derived from the frame and can be overridden using MakeInvisible(). - */ - explicit TableBackgroundData(nsIFrame* aFrame); - - /** Destructor */ - ~TableBackgroundData() {} - - /** Data is valid & frame is visible */ - bool IsVisible() const { return mVisible; } - - /** Override visibility of the frame, force it to be invisible */ - void MakeInvisible() { mVisible = false; } - - /** True if need to set border-collapse border; must call SetFull beforehand */ - bool ShouldSetBCBorder() const; - - /** Set border-collapse border with aBorderWidth as widths */ - void SetBCBorder(const nsMargin& aBorderWidth); - - /** - * @param aZeroBorder An nsStyleBorder instance that has been initialized - * for the right nsPresContext, with all border widths - * set to zero and border styles set to solid. - * @return The nsStyleBorder that should be used for rendering - * this background. - */ - nsStyleBorder StyleBorder(const nsStyleBorder& aZeroBorder) const; - - nsIFrame* const mFrame; - - /** mRect is the rect of mFrame in the current coordinate system */ - nsRect mRect; - - private: - nsMargin mSynthBorderWidths; - bool mVisible; - bool mUsesSynthBorder; - }; - - struct ColData { - ColData(nsIFrame* aFrame, TableBackgroundData& aColGroupBGData); - TableBackgroundData mCol; - TableBackgroundData& mColGroup; // reference to col's parent colgroup's data, owned by TablePainter in mColGroups - }; - - nsPresContext* mPresContext; - nsRenderingContext& mRenderingContext; - nsPoint mRenderPt; - nsRect mDirtyRect; -#ifdef DEBUG - nsCompatibility mCompatMode; -#endif - bool mIsBorderCollapse; - Origin mOrigin; //user's table frame type - - nsTArray<TableBackgroundData> mColGroups; - nsTArray<ColData> mCols; - size_t mNumCols; - - nsStyleBorder mZeroBorder; //cached zero-width border - uint32_t mBGPaintFlags; -}; - -#endif diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index 1b6051ef2..ea2477b73 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -561,65 +561,12 @@ nsTableRowFrame::CalcBSize(const ReflowInput& aReflowInput) return GetInitialBSize(); } -/** - * We need a custom display item for table row backgrounds. This is only used - * when the table row is the root of a stacking context (e.g., has 'opacity'). - * Table row backgrounds can extend beyond the row frame bounds, when - * the row contains row-spanning cells. - */ -class nsDisplayTableRowBackground : public nsDisplayTableItem { -public: - nsDisplayTableRowBackground(nsDisplayListBuilder* aBuilder, - nsTableRowFrame* aFrame) : - nsDisplayTableItem(aBuilder, aFrame) { - MOZ_COUNT_CTOR(nsDisplayTableRowBackground); - } -#ifdef NS_BUILD_REFCNT_LOGGING - virtual ~nsDisplayTableRowBackground() { - MOZ_COUNT_DTOR(nsDisplayTableRowBackground); - } -#endif - - virtual void Paint(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx) override; - NS_DISPLAY_DECL_NAME("TableRowBackground", TYPE_TABLE_ROW_BACKGROUND) -}; - -void -nsDisplayTableRowBackground::Paint(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx) -{ - auto rowFrame = static_cast<nsTableRowFrame*>(mFrame); - TableBackgroundPainter painter(rowFrame->GetTableFrame(), - TableBackgroundPainter::eOrigin_TableRow, - mFrame->PresContext(), *aCtx, - mVisibleRect, ToReferenceFrame(), - aBuilder->GetBackgroundPaintFlags()); - - DrawResult result = painter.PaintRow(rowFrame); - nsDisplayTableItemGeometry::UpdateDrawResult(this, result); -} - void nsTableRowFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { - nsDisplayTableItem* item = nullptr; - if (IsVisibleInSelection(aBuilder)) { - bool isRoot = aBuilder->IsAtRootOfPseudoStackingContext(); - if (isRoot) { - // This background is created regardless of whether this frame is - // visible or not. Visibility decisions are delegated to the - // table background painter. - // We would use nsDisplayGeneric for this rare case except that we - // need the background to be larger than the row frame in some - // cases. - item = new (aBuilder) nsDisplayTableRowBackground(aBuilder, this); - aLists.BorderBackground()->AppendNewToTop(item); - } - } - nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists, item); + nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists); } nsIFrame::LogicalSides @@ -979,12 +926,11 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, // be merged into the else below if we can.) nsMargin* computedOffsetProp = kidFrame->GetProperty(nsIFrame::ComputedOffsetProperty()); - // Bug 975644: a position:sticky kid can end up with a null - // property value here. - LogicalMargin computedOffsets(wm, computedOffsetProp ? - *computedOffsetProp : nsMargin()); - ReflowInput::ApplyRelativePositioning(kidFrame, wm, computedOffsets, - &kidPosition, containerSize); + + // On our fist reflow sticky children may not have the property yet (we + // need to reflow the children first to size the scroll frame). + LogicalMargin computedOffsets(wm, computedOffsetProp ? *computedOffsetProp : nsMargin()); + ReflowInput::ApplyRelativePositioning(kidFrame, wm, computedOffsets, &kidPosition, containerSize); } // In vertical-rl mode, we are likely to have containerSize.width = 0 diff --git a/layout/tables/nsTableRowFrame.h b/layout/tables/nsTableRowFrame.h index a6aba81e7..9e15d851f 100644 --- a/layout/tables/nsTableRowFrame.h +++ b/layout/tables/nsTableRowFrame.h @@ -8,7 +8,6 @@ #include "mozilla/Attributes.h" #include "nscore.h" #include "nsContainerFrame.h" -#include "nsTablePainter.h" #include "nsTableRowGroupFrame.h" #include "mozilla/WritingModes.h" diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 8f014b204..3e4f60f62 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -154,46 +154,6 @@ nsTableRowGroupFrame::InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame return NS_OK; } -/** - * We need a custom display item for table row backgrounds. This is only used - * when the table row is the root of a stacking context (e.g., has 'opacity'). - * Table row backgrounds can extend beyond the row frame bounds, when - * the row contains row-spanning cells. - */ -class nsDisplayTableRowGroupBackground : public nsDisplayTableItem { -public: - nsDisplayTableRowGroupBackground(nsDisplayListBuilder* aBuilder, - nsTableRowGroupFrame* aFrame) : - nsDisplayTableItem(aBuilder, aFrame) { - MOZ_COUNT_CTOR(nsDisplayTableRowGroupBackground); - } -#ifdef NS_BUILD_REFCNT_LOGGING - virtual ~nsDisplayTableRowGroupBackground() { - MOZ_COUNT_DTOR(nsDisplayTableRowGroupBackground); - } -#endif - - virtual void Paint(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx) override; - - NS_DISPLAY_DECL_NAME("TableRowGroupBackground", TYPE_TABLE_ROW_GROUP_BACKGROUND) -}; - -void -nsDisplayTableRowGroupBackground::Paint(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx) -{ - auto rgFrame = static_cast<nsTableRowGroupFrame*>(mFrame); - TableBackgroundPainter painter(rgFrame->GetTableFrame(), - TableBackgroundPainter::eOrigin_TableRowGroup, - mFrame->PresContext(), *aCtx, - mVisibleRect, ToReferenceFrame(), - aBuilder->GetBackgroundPaintFlags()); - - DrawResult result = painter.PaintRowGroup(rgFrame); - nsDisplayTableItemGeometry::UpdateDrawResult(this, result); -} - // Handle the child-traversal part of DisplayGenericTablePart static void DisplayRows(nsDisplayListBuilder* aBuilder, nsFrame* aFrame, @@ -249,19 +209,8 @@ nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { - nsDisplayTableItem* item = nullptr; - if (IsVisibleInSelection(aBuilder)) { - bool isRoot = aBuilder->IsAtRootOfPseudoStackingContext(); - if (isRoot) { - // This background is created regardless of whether this frame is - // visible or not. Visibility decisions are delegated to the - // table background painter. - item = new (aBuilder) nsDisplayTableRowGroupBackground(aBuilder, this); - aLists.BorderBackground()->AppendNewToTop(item); - } - } nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, - aLists, item, DisplayRows); + aLists, DisplayRows); } nsIFrame::LogicalSides diff --git a/layout/tables/nsTableRowGroupFrame.h b/layout/tables/nsTableRowGroupFrame.h index 7abdd4b74..721d91046 100644 --- a/layout/tables/nsTableRowGroupFrame.h +++ b/layout/tables/nsTableRowGroupFrame.h @@ -10,7 +10,6 @@ #include "nsContainerFrame.h" #include "nsIAtom.h" #include "nsILineIterator.h" -#include "nsTablePainter.h" #include "nsTArray.h" #include "nsTableFrame.h" #include "mozilla/WritingModes.h" diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp index f0b6d1512..da71375d5 100644 --- a/layout/tables/nsTableWrapperFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -190,7 +190,11 @@ nsTableWrapperFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // Now we have to sort everything by content order, since the caption // may be somewhere inside the table - set.SortAllByContentOrder(GetContent()); + set.BlockBorderBackgrounds()->SortByContentOrder(GetContent()); + set.Floats()->SortByContentOrder(GetContent()); + set.Content()->SortByContentOrder(GetContent()); + set.PositionedDescendants()->SortByContentOrder(GetContent()); + set.Outlines()->SortByContentOrder(GetContent()); set.MoveTo(aLists); } diff --git a/media/libcubeb/src/cubeb.c b/media/libcubeb/src/cubeb.c index eb22a9b94..a239319a4 100644 --- a/media/libcubeb/src/cubeb.c +++ b/media/libcubeb/src/cubeb.c @@ -54,6 +54,9 @@ int audiotrack_init(cubeb ** context, char const * context_name); #if defined(USE_KAI) int kai_init(cubeb ** context, char const * context_name); #endif +#if defined(USE_SUN) +int sunaudio_init(cubeb ** context, char const * context_name); +#endif static int @@ -141,6 +144,9 @@ cubeb_init(cubeb ** context, char const * context_name) #if defined(USE_KAI) kai_init, #endif +#if defined(USE_SUN) + sunaudio_init, +#endif }; int i; diff --git a/media/libcubeb/src/cubeb_sndio.c b/media/libcubeb/src/cubeb_sndio.c index 793789765..c7ac18446 100644 --- a/media/libcubeb/src/cubeb_sndio.c +++ b/media/libcubeb/src/cubeb_sndio.c @@ -245,7 +245,7 @@ sndio_stream_init(cubeb * context, s->data_cb = data_callback; s->state_cb = state_callback; s->arg = user_ptr; - s->mtx = PTHREAD_MUTEX_INITIALIZER; + s->mtx = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER; s->rdpos = s->wrpos = 0; if (output_stream_params->format == CUBEB_SAMPLE_FLOAT32LE) { s->conv = 1; diff --git a/media/libcubeb/src/cubeb_sun.c b/media/libcubeb/src/cubeb_sun.c new file mode 100644 index 000000000..b768bca56 --- /dev/null +++ b/media/libcubeb/src/cubeb_sun.c @@ -0,0 +1,504 @@ +/* + * Copyright (c) 2013, 2017 Ginn Chen <ginnchen@gmail.com> + * + * This program is made available under an ISC-style license. See the + * accompanying file LICENSE for details. + */ +#include <poll.h> +#include <pthread.h> +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#include <fcntl.h> +#include <sys/audio.h> +#include <sys/stat.h> +#include <unistd.h> +#include <sys/stropts.h> +#include "cubeb/cubeb.h" +#include "cubeb-internal.h" + +/* Macros copied from audio_oss.h */ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (C) 4Front Technologies 1996-2008. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#define OSSIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */ +#define OSSIOC_VOID 0x00000000 /* no parameters */ +#define OSSIOC_OUT 0x20000000 /* copy out parameters */ +#define OSSIOC_IN 0x40000000 /* copy in parameters */ +#define OSSIOC_INOUT (OSSIOC_IN|OSSIOC_OUT) +#define OSSIOC_SZ(t) ((sizeof (t) & OSSIOCPARM_MASK) << 16) +#define __OSSIO(x, y) ((int)(OSSIOC_VOID|(x<<8)|y)) +#define __OSSIOR(x, y, t) ((int)(OSSIOC_OUT|OSSIOC_SZ(t)|(x<<8)|y)) +#define __OSSIOWR(x, y, t) ((int)(OSSIOC_INOUT|OSSIOC_SZ(t)|(x<<8)|y)) +#define SNDCTL_DSP_SPEED __OSSIOWR('P', 2, int) +#define SNDCTL_DSP_CHANNELS __OSSIOWR('P', 6, int) +#define SNDCTL_DSP_SETFMT __OSSIOWR('P', 5, int) /* Selects ONE fmt */ +#define SNDCTL_DSP_GETODELAY __OSSIOR('P', 23, int) +#define SNDCTL_DSP_HALT_OUTPUT __OSSIO('P', 34) +#define AFMT_S16_LE 0x00000010 +#define AFMT_S16_BE 0x00000020 + +#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) +#define AFMT_S16_NE AFMT_S16_BE +#else +#define AFMT_S16_NE AFMT_S16_LE +#endif + +#define DEFAULT_AUDIO_DEVICE "/dev/audio" +#define DEFAULT_DSP_DEVICE "/dev/dsp" + +#define BUF_SIZE_MS 10 + +#if defined(CUBEB_SUNAUDIO_DEBUG) +#define DPR(...) fprintf(stderr, __VA_ARGS__); +#else +#define DPR(...) do {} while(0) +#endif + +static struct cubeb_ops const sunaudio_ops; + +struct cubeb { + struct cubeb_ops const * ops; +}; + +struct cubeb_stream { + cubeb * context; + pthread_t th; /* to run real-time audio i/o */ + pthread_mutex_t mutex; /* protects fd and frm_played */ + int fd; /* link us to sunaudio */ + int active; /* cubec_start() called */ + int conv; /* need float->s16 conversion */ + int using_oss; + unsigned char *buf; /* data is prepared here */ + unsigned int rate; + unsigned int n_channles; + unsigned int bytes_per_ch; + unsigned int n_frm; + unsigned int buffer_size; + int64_t frm_played; + cubeb_data_callback data_cb; /* cb to preapare data */ + cubeb_state_callback state_cb; /* cb to notify about state changes */ + void *arg; /* user arg to {data,state}_cb */ +}; + +static void +float_to_s16(void *ptr, long nsamp) +{ + int16_t *dst = ptr; + float *src = ptr; + + while (nsamp-- > 0) + *(dst++) = *(src++) * 32767; +} + +static void * +sunaudio_mainloop(void *arg) +{ + struct cubeb_stream *s = arg; + int state; + + DPR("sunaudio_mainloop()\n"); + + s->state_cb(s, s->arg, CUBEB_STATE_STARTED); + + pthread_mutex_lock(&s->mutex); + DPR("sunaudio_mainloop(), started\n"); + + for (;;) { + if (!s->active) { + DPR("sunaudio_mainloop() stopped\n"); + state = CUBEB_STATE_STOPPED; + break; + } + + if (!s->using_oss) { + audio_info_t info; + ioctl(s->fd, AUDIO_GETINFO, &info); + if (s->frm_played > info.play.samples + 3 * s->n_frm) { + pthread_mutex_unlock(&s->mutex); + struct timespec ts = {0, 10000}; // 10 ms + nanosleep(&ts, NULL); + pthread_mutex_lock(&s->mutex); + continue; + } + } + + pthread_mutex_unlock(&s->mutex); + unsigned int got = s->data_cb(s, s->arg, NULL, s->buf, s->n_frm); + DPR("sunaudio_mainloop() ask %d got %d\n", s->n_frm, got); + pthread_mutex_lock(&s->mutex); + + if (got < 0) { + DPR("sunaudio_mainloop() cb err\n"); + state = CUBEB_STATE_ERROR; + break; + } + + if (s->conv) { + float_to_s16(s->buf, got * s->n_channles); + } + + unsigned int avail = got * 2 * s->n_channles; // coverted to s16 + unsigned int pos = 0; + + while (avail > 0 && s->active) { + int written = write(s->fd, s->buf + pos, avail); + if (written == -1) { + if (errno != EINTR && errno != EWOULDBLOCK) { + DPR("sunaudio_mainloop() write err\n"); + state = CUBEB_STATE_ERROR; + break; + } + pthread_mutex_unlock(&s->mutex); + struct timespec ts = {0, 10000}; // 10 ms + nanosleep(&ts, NULL); + pthread_mutex_lock(&s->mutex); + } else { + pos += written; + DPR("sunaudio_mainloop() write %d pos %d\n", written, pos); + s->frm_played += written / 2 / s->n_channles; + avail -= written; + } + } + + if ((got < s->n_frm)) { + DPR("sunaudio_mainloop() drained\n"); + state = CUBEB_STATE_DRAINED; + break; + } + } + + pthread_mutex_unlock(&s->mutex); + s->state_cb(s, s->arg, state); + + return NULL; +} + +/*static*/ int +sunaudio_init(cubeb **context, char const *context_name) +{ + DPR("sunaudio_init(%s)\n", context_name); + *context = malloc(sizeof(*context)); + (*context)->ops = &sunaudio_ops; + (void)context_name; + return CUBEB_OK; +} + +static char const * +sunaudio_get_backend_id(cubeb *context) +{ + return "sunaudio"; +} + +static void +sunaudio_destroy(cubeb *context) +{ + DPR("sunaudio_destroy()\n"); + free(context); +} + +static int +sunaudio_stream_init(cubeb *context, + cubeb_stream **stream, + char const *stream_name, + cubeb_devid input_device, + cubeb_stream_params * input_stream_params, + cubeb_devid output_device, + cubeb_stream_params * output_stream_params, + unsigned int latency, + cubeb_data_callback data_callback, + cubeb_state_callback state_callback, + void *user_ptr) +{ + struct cubeb_stream *s; + DPR("sunaudio_stream_init(%s)\n", stream_name); + size_t size; + + s = malloc(sizeof(struct cubeb_stream)); + if (s == NULL) + return CUBEB_ERROR; + s->context = context; + + // If UTAUDIODEV is set, use it with Sun Audio interface + char * sa_device_name = getenv("UTAUDIODEV"); + char * dsp_device_name = NULL; + if (!sa_device_name) { + dsp_device_name = getenv("AUDIODSP"); + if (!dsp_device_name) { + dsp_device_name = DEFAULT_DSP_DEVICE; + } + sa_device_name = getenv("AUDIODEV"); + if (!sa_device_name) { + sa_device_name = DEFAULT_AUDIO_DEVICE; + } + } + + s->using_oss = 0; + // Try to use OSS if available + if (dsp_device_name) { + s->fd = open(dsp_device_name, O_WRONLY | O_NONBLOCK); + if (s->fd >= 0) { + s->using_oss = 1; + } + } + + // Try Sun Audio + if (!s->using_oss) { + s->fd = open(sa_device_name, O_WRONLY | O_NONBLOCK); + } + + if (s->fd < 0) { + free(s); + DPR("sunaudio_stream_init(), open() failed\n"); + return CUBEB_ERROR; + } + + if (s->using_oss) { + if (ioctl(s->fd, SNDCTL_DSP_SPEED, &output_stream_params->rate) < 0) { + DPR("ioctl SNDCTL_DSP_SPEED failed.\n"); + close(s->fd); + free(s); + return CUBEB_ERROR_INVALID_FORMAT; + } + + if (ioctl(s->fd, SNDCTL_DSP_CHANNELS, &output_stream_params->channels) < 0) { + DPR("ioctl SNDCTL_DSP_CHANNELS failed.\n"); + close(s->fd); + free(s); + return CUBEB_ERROR_INVALID_FORMAT; + } + + int format = AFMT_S16_NE; + if (ioctl(s->fd, SNDCTL_DSP_SETFMT, &format) < 0) { + DPR("ioctl SNDCTL_DSP_SETFMT failed.\n"); + close(s->fd); + free(s); + return CUBEB_ERROR_INVALID_FORMAT; + } + } else { + audio_info_t audio_info; + AUDIO_INITINFO(&audio_info) + audio_info.play.sample_rate = output_stream_params->rate; + audio_info.play.channels = output_stream_params->channels; + audio_info.play.encoding = AUDIO_ENCODING_LINEAR; + audio_info.play.precision = 16; + if (ioctl(s->fd, AUDIO_SETINFO, &audio_info) == -1) { + DPR("ioctl AUDIO_SETINFO failed.\n"); + close(s->fd); + free(s); + return CUBEB_ERROR_INVALID_FORMAT; + } + } + + s->conv = 0; + switch (output_stream_params->format) { + case CUBEB_SAMPLE_S16NE: + s->bytes_per_ch = 2; + break; + case CUBEB_SAMPLE_FLOAT32NE: + s->bytes_per_ch = 4; + s->conv = 1; + break; + default: + DPR("sunaudio_stream_init() unsupported format\n"); + close(s->fd); + free(s); + return CUBEB_ERROR_INVALID_FORMAT; + } + + s->active = 0; + s->rate = output_stream_params->rate; + s->n_channles = output_stream_params->channels; + s->data_cb = data_callback; + s->state_cb = state_callback; + s->arg = user_ptr; + if (pthread_mutex_init(&s->mutex, NULL) != 0) { + free(s); + return CUBEB_ERROR; + } + s->frm_played = 0; + s->n_frm = s->rate * BUF_SIZE_MS / 1000; + s->buffer_size = s->bytes_per_ch * s->n_channles * s->n_frm; + s->buf = malloc(s->buffer_size); + if (s->buf == NULL) { + close(s->fd); + free(s); + return CUBEB_ERROR; + } + + *stream = s; + DPR("sunaudio_stream_init() end, ok\n"); + return CUBEB_OK; +} + +static void +sunaudio_stream_destroy(cubeb_stream *s) +{ + DPR("sunaudio_stream_destroy()\n"); + if (s->fd > 0) { + // Flush buffer + if (s->using_oss) { + ioctl(s->fd, SNDCTL_DSP_HALT_OUTPUT); + } else { + ioctl(s->fd, I_FLUSH); + } + close(s->fd); + } + free(s->buf); + free(s); +} + +static int +sunaudio_stream_start(cubeb_stream *s) +{ + int err; + + DPR("sunaudio_stream_start()\n"); + s->active = 1; + err = pthread_create(&s->th, NULL, sunaudio_mainloop, s); + if (err) { + s->active = 0; + return CUBEB_ERROR; + } + return CUBEB_OK; +} + +static int +sunaudio_stream_stop(cubeb_stream *s) +{ + void *dummy; + + DPR("sunaudio_stream_stop()\n"); + if (s->active) { + s->active = 0; + pthread_join(s->th, &dummy); + } + return CUBEB_OK; +} + +static int +sunaudio_stream_get_position(cubeb_stream *s, uint64_t *p) +{ + int rv = CUBEB_OK; + pthread_mutex_lock(&s->mutex); + if (s->active && s->fd > 0) { + if (s->using_oss) { + int delay; + ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay); + int64_t t = s->frm_played - delay / s->n_channles / 2; + if (t < 0) { + *p = 0; + } else { + *p = t; + } + } else { + audio_info_t info; + ioctl(s->fd, AUDIO_GETINFO, &info); + *p = info.play.samples; + } + DPR("sunaudio_stream_get_position() %lld\n", *p); + } else { + rv = CUBEB_ERROR; + } + pthread_mutex_unlock(&s->mutex); + return rv; +} + +static int +sunaudio_get_max_channel_count(cubeb * ctx, uint32_t * max_channels) +{ + if (!ctx || !max_channels) + return CUBEB_ERROR; + + *max_channels = 2; + + return CUBEB_OK; +} + +static int +sunaudio_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) +{ + if (!ctx || !rate) + return CUBEB_ERROR; + + // XXX Not yet implemented. + *rate = 44100; + + return CUBEB_OK; +} + +static int +sunaudio_get_min_latency(cubeb * ctx, cubeb_stream_params params, uint32_t * latency_ms) +{ + if (!ctx || !latency_ms) + return CUBEB_ERROR; + + // XXX Not yet implemented. + *latency_ms = 20; + + return CUBEB_OK; +} + +static int +sunaudio_stream_get_latency(cubeb_stream * s, uint32_t * latency) +{ + if (!s || !latency) + return CUBEB_ERROR; + + int rv = CUBEB_OK; + pthread_mutex_lock(&s->mutex); + if (s->active && s->fd > 0) { + if (s->using_oss) { + int delay; + ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay); + *latency = delay / s->n_channles / 2 / s->rate; + } else { + audio_info_t info; + ioctl(s->fd, AUDIO_GETINFO, &info); + *latency = (s->frm_played - info.play.samples) / s->rate; + } + DPR("sunaudio_stream_get_position() %lld\n", *p); + } else { + rv = CUBEB_ERROR; + } + pthread_mutex_unlock(&s->mutex); + return rv; +} + +static struct cubeb_ops const sunaudio_ops = { + .init = sunaudio_init, + .get_backend_id = sunaudio_get_backend_id, + .destroy = sunaudio_destroy, + .get_preferred_sample_rate = sunaudio_get_preferred_sample_rate, + .stream_init = sunaudio_stream_init, + .stream_destroy = sunaudio_stream_destroy, + .stream_start = sunaudio_stream_start, + .stream_stop = sunaudio_stream_stop, + .stream_get_position = sunaudio_stream_get_position, + .get_max_channel_count = sunaudio_get_max_channel_count, + .get_min_latency = sunaudio_get_min_latency, + .stream_get_latency = sunaudio_stream_get_latency +}; diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build index 2ca3a2f54..772aa6d39 100644 --- a/media/libcubeb/src/moz.build +++ b/media/libcubeb/src/moz.build @@ -39,12 +39,18 @@ if CONFIG['MOZ_JACK']: ] DEFINES['USE_JACK'] = True -if CONFIG['OS_ARCH'] == 'OpenBSD': +if CONFIG['MOZ_SNDIO']: SOURCES += [ 'cubeb_sndio.c', ] DEFINES['USE_SNDIO'] = True +if CONFIG['OS_ARCH'] == 'SunOS': + SOURCES += [ + 'cubeb_sun.c', + ] + DEFINES['USE_SUN'] = True + if CONFIG['OS_TARGET'] == 'Darwin': SOURCES += [ 'cubeb_audiounit.cpp', diff --git a/media/libcubeb/tests/moz.build b/media/libcubeb/tests/moz.build index 1b17c7b1c..ca63a4d8f 100644 --- a/media/libcubeb/tests/moz.build +++ b/media/libcubeb/tests/moz.build @@ -68,7 +68,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': '-framework CoreFoundation', '-framework AudioToolbox', ] -elif CONFIG['OS_TARGET'] == 'OpenBSD': +elif CONFIG['MOZ_SNDIO']: OS_LIBS += [ 'sndio', ] diff --git a/media/libpng/moz.build b/media/libpng/moz.build index 9146a8d5a..f2538484b 100644 --- a/media/libpng/moz.build +++ b/media/libpng/moz.build @@ -51,3 +51,6 @@ FINAL_LIBRARY = 'gkmedias' # We allow warnings for third-party code that can be updated from upstream. ALLOW_COMPILER_WARNINGS = True + +if CONFIG['GNU_CC']: + CFLAGS += ['-std=c89'] diff --git a/media/libstagefright/moz.build b/media/libstagefright/moz.build index 5a8c9521a..87e162112 100644 --- a/media/libstagefright/moz.build +++ b/media/libstagefright/moz.build @@ -7,7 +7,7 @@ DEFINES['ANDROID_SMP'] = 0 DEFINES['LOG_NDEBUG'] = 1 -if CONFIG['OS_TARGET'] != 'WINNT': +if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['OS_TARGET'] != 'SunOS': DEFINES['_GLIBCXX_OS_DEFINES'] = True if CONFIG['OS_TARGET'] == 'WINNT': diff --git a/media/libwebp/dsp/alpha_processing_neon.c b/media/libwebp/dsp/alpha_processing_neon.c new file mode 100644 index 000000000..53dfce2b3 --- /dev/null +++ b/media/libwebp/dsp/alpha_processing_neon.c @@ -0,0 +1,191 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Utilities for processing transparent channel, NEON version. +// +// Author: Skal (pascal.massimino@gmail.com) + +#include "../dsp/dsp.h" + +#if defined(WEBP_USE_NEON) + +#include "../dsp/neon.h" + +//------------------------------------------------------------------------------ + +#define MULTIPLIER(a) ((a) * 0x8081) +#define PREMULTIPLY(x, m) (((x) * (m)) >> 23) + +#define MULTIPLY_BY_ALPHA(V, ALPHA, OTHER) do { \ + const uint8x8_t alpha = (V).val[(ALPHA)]; \ + const uint16x8_t r1 = vmull_u8((V).val[1], alpha); \ + const uint16x8_t g1 = vmull_u8((V).val[2], alpha); \ + const uint16x8_t b1 = vmull_u8((V).val[(OTHER)], alpha); \ + /* we use: v / 255 = (v + 1 + (v >> 8)) >> 8 */ \ + const uint16x8_t r2 = vsraq_n_u16(r1, r1, 8); \ + const uint16x8_t g2 = vsraq_n_u16(g1, g1, 8); \ + const uint16x8_t b2 = vsraq_n_u16(b1, b1, 8); \ + const uint16x8_t r3 = vaddq_u16(r2, kOne); \ + const uint16x8_t g3 = vaddq_u16(g2, kOne); \ + const uint16x8_t b3 = vaddq_u16(b2, kOne); \ + (V).val[1] = vshrn_n_u16(r3, 8); \ + (V).val[2] = vshrn_n_u16(g3, 8); \ + (V).val[(OTHER)] = vshrn_n_u16(b3, 8); \ +} while (0) + +static void ApplyAlphaMultiply_NEON(uint8_t* rgba, int alpha_first, + int w, int h, int stride) { + const uint16x8_t kOne = vdupq_n_u16(1u); + while (h-- > 0) { + uint32_t* const rgbx = (uint32_t*)rgba; + int i = 0; + if (alpha_first) { + for (; i + 8 <= w; i += 8) { + // load aaaa...|rrrr...|gggg...|bbbb... + uint8x8x4_t RGBX = vld4_u8((const uint8_t*)(rgbx + i)); + MULTIPLY_BY_ALPHA(RGBX, 0, 3); + vst4_u8((uint8_t*)(rgbx + i), RGBX); + } + } else { + for (; i + 8 <= w; i += 8) { + uint8x8x4_t RGBX = vld4_u8((const uint8_t*)(rgbx + i)); + MULTIPLY_BY_ALPHA(RGBX, 3, 0); + vst4_u8((uint8_t*)(rgbx + i), RGBX); + } + } + // Finish with left-overs. + for (; i < w; ++i) { + uint8_t* const rgb = rgba + (alpha_first ? 1 : 0); + const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3); + const uint32_t a = alpha[4 * i]; + if (a != 0xff) { + const uint32_t mult = MULTIPLIER(a); + rgb[4 * i + 0] = PREMULTIPLY(rgb[4 * i + 0], mult); + rgb[4 * i + 1] = PREMULTIPLY(rgb[4 * i + 1], mult); + rgb[4 * i + 2] = PREMULTIPLY(rgb[4 * i + 2], mult); + } + } + rgba += stride; + } +} +#undef MULTIPLY_BY_ALPHA +#undef MULTIPLIER +#undef PREMULTIPLY + +//------------------------------------------------------------------------------ + +static int DispatchAlpha_NEON(const uint8_t* alpha, int alpha_stride, + int width, int height, + uint8_t* dst, int dst_stride) { + uint32_t alpha_mask = 0xffffffffu; + uint8x8_t mask8 = vdup_n_u8(0xff); + uint32_t tmp[2]; + int i, j; + for (j = 0; j < height; ++j) { + // We don't know if alpha is first or last in dst[] (depending on rgbA/Argb + // mode). So we must be sure dst[4*i + 8 - 1] is writable for the store. + // Hence the test with 'width - 1' instead of just 'width'. + for (i = 0; i + 8 <= width - 1; i += 8) { + uint8x8x4_t rgbX = vld4_u8((const uint8_t*)(dst + 4 * i)); + const uint8x8_t alphas = vld1_u8(alpha + i); + rgbX.val[0] = alphas; + vst4_u8((uint8_t*)(dst + 4 * i), rgbX); + mask8 = vand_u8(mask8, alphas); + } + for (; i < width; ++i) { + const uint32_t alpha_value = alpha[i]; + dst[4 * i] = alpha_value; + alpha_mask &= alpha_value; + } + alpha += alpha_stride; + dst += dst_stride; + } + vst1_u8((uint8_t*)tmp, mask8); + alpha_mask &= tmp[0]; + alpha_mask &= tmp[1]; + return (alpha_mask != 0xffffffffu); +} + +static void DispatchAlphaToGreen_NEON(const uint8_t* alpha, int alpha_stride, + int width, int height, + uint32_t* dst, int dst_stride) { + int i, j; + uint8x8x4_t greens; // leave A/R/B channels zero'd. + greens.val[0] = vdup_n_u8(0); + greens.val[2] = vdup_n_u8(0); + greens.val[3] = vdup_n_u8(0); + for (j = 0; j < height; ++j) { + for (i = 0; i + 8 <= width; i += 8) { + greens.val[1] = vld1_u8(alpha + i); + vst4_u8((uint8_t*)(dst + i), greens); + } + for (; i < width; ++i) dst[i] = alpha[i] << 8; + alpha += alpha_stride; + dst += dst_stride; + } +} + +static int ExtractAlpha_NEON(const uint8_t* argb, int argb_stride, + int width, int height, + uint8_t* alpha, int alpha_stride) { + uint32_t alpha_mask = 0xffffffffu; + uint8x8_t mask8 = vdup_n_u8(0xff); + uint32_t tmp[2]; + int i, j; + for (j = 0; j < height; ++j) { + // We don't know if alpha is first or last in dst[] (depending on rgbA/Argb + // mode). So we must be sure dst[4*i + 8 - 1] is writable for the store. + // Hence the test with 'width - 1' instead of just 'width'. + for (i = 0; i + 8 <= width - 1; i += 8) { + const uint8x8x4_t rgbX = vld4_u8((const uint8_t*)(argb + 4 * i)); + const uint8x8_t alphas = rgbX.val[0]; + vst1_u8((uint8_t*)(alpha + i), alphas); + mask8 = vand_u8(mask8, alphas); + } + for (; i < width; ++i) { + alpha[i] = argb[4 * i]; + alpha_mask &= alpha[i]; + } + argb += argb_stride; + alpha += alpha_stride; + } + vst1_u8((uint8_t*)tmp, mask8); + alpha_mask &= tmp[0]; + alpha_mask &= tmp[1]; + return (alpha_mask == 0xffffffffu); +} + +static void ExtractGreen_NEON(const uint32_t* argb, + uint8_t* alpha, int size) { + int i; + for (i = 0; i + 16 <= size; i += 16) { + const uint8x16x4_t rgbX = vld4q_u8((const uint8_t*)(argb + i)); + const uint8x16_t greens = rgbX.val[1]; + vst1q_u8(alpha + i, greens); + } + for (; i < size; ++i) alpha[i] = (argb[i] >> 8) & 0xff; +} + +//------------------------------------------------------------------------------ + +extern void WebPInitAlphaProcessingNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingNEON(void) { + WebPApplyAlphaMultiply = ApplyAlphaMultiply_NEON; + WebPDispatchAlpha = DispatchAlpha_NEON; + WebPDispatchAlphaToGreen = DispatchAlphaToGreen_NEON; + WebPExtractAlpha = ExtractAlpha_NEON; + WebPExtractGreen = ExtractGreen_NEON; +} + +#else // !WEBP_USE_NEON + +WEBP_DSP_INIT_STUB(WebPInitAlphaProcessingNEON) + +#endif // WEBP_USE_NEON diff --git a/media/libwebp/dsp/filters_neon.c b/media/libwebp/dsp/filters_neon.c new file mode 100644 index 000000000..4788118c9 --- /dev/null +++ b/media/libwebp/dsp/filters_neon.c @@ -0,0 +1,329 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// NEON variant of alpha filters +// +// Author: Skal (pascal.massimino@gmail.com) + +#include "../dsp/dsp.h" + +#if defined(WEBP_USE_NEON) + +#include <assert.h> +#include "../dsp/neon.h" + +//------------------------------------------------------------------------------ +// Helpful macros. + +# define SANITY_CHECK(in, out) \ + assert(in != NULL); \ + assert(out != NULL); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ + assert(row >= 0 && num_rows > 0 && row + num_rows <= height); \ + (void)height; // Silence unused warning. + +// load eight u8 and widen to s16 +#define U8_TO_S16(A) vreinterpretq_s16_u16(vmovl_u8(A)) +#define LOAD_U8_TO_S16(A) U8_TO_S16(vld1_u8(A)) + +// shift left or right by N byte, inserting zeros +#define SHIFT_RIGHT_N_Q(A, N) vextq_u8((A), zero, (N)) +#define SHIFT_LEFT_N_Q(A, N) vextq_u8(zero, (A), (16 - (N)) % 16) + +// rotate left by N bytes +#define ROTATE_LEFT_N(A, N) vext_u8((A), (A), (N)) +// rotate right by N bytes +#define ROTATE_RIGHT_N(A, N) vext_u8((A), (A), (8 - (N)) % 8) + +static void PredictLine_NEON(const uint8_t* src, const uint8_t* pred, + uint8_t* dst, int length) { + int i; + assert(length >= 0); + for (i = 0; i + 16 <= length; i += 16) { + const uint8x16_t A = vld1q_u8(&src[i]); + const uint8x16_t B = vld1q_u8(&pred[i]); + const uint8x16_t C = vsubq_u8(A, B); + vst1q_u8(&dst[i], C); + } + for (; i < length; ++i) dst[i] = src[i] - pred[i]; +} + +// Special case for left-based prediction (when preds==dst-1 or preds==src-1). +static void PredictLineLeft_NEON(const uint8_t* src, uint8_t* dst, int length) { + PredictLine_NEON(src, src - 1, dst, length); +} + +//------------------------------------------------------------------------------ +// Horizontal filter. + +static WEBP_INLINE void DoHorizontalFilter_NEON(const uint8_t* in, + int width, int height, + int stride, + int row, int num_rows, + uint8_t* out) { + const size_t start_offset = row * stride; + const int last_row = row + num_rows; + SANITY_CHECK(in, out); + in += start_offset; + out += start_offset; + + if (row == 0) { + // Leftmost pixel is the same as input for topmost scanline. + out[0] = in[0]; + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + row = 1; + in += stride; + out += stride; + } + + // Filter line-by-line. + while (row < last_row) { + // Leftmost pixel is predicted from above. + out[0] = in[0] - in[-stride]; + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + ++row; + in += stride; + out += stride; + } +} + +static void HorizontalFilter_NEON(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + DoHorizontalFilter_NEON(data, width, height, stride, 0, height, + filtered_data); +} + +//------------------------------------------------------------------------------ +// Vertical filter. + +static WEBP_INLINE void DoVerticalFilter_NEON(const uint8_t* in, + int width, int height, int stride, + int row, int num_rows, + uint8_t* out) { + const size_t start_offset = row * stride; + const int last_row = row + num_rows; + SANITY_CHECK(in, out); + in += start_offset; + out += start_offset; + + if (row == 0) { + // Very first top-left pixel is copied. + out[0] = in[0]; + // Rest of top scan-line is left-predicted. + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + row = 1; + in += stride; + out += stride; + } + + // Filter line-by-line. + while (row < last_row) { + PredictLine_NEON(in, in - stride, out, width); + ++row; + in += stride; + out += stride; + } +} + +static void VerticalFilter_NEON(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + DoVerticalFilter_NEON(data, width, height, stride, 0, height, + filtered_data); +} + +//------------------------------------------------------------------------------ +// Gradient filter. + +static WEBP_INLINE int GradientPredictor_C(uint8_t a, uint8_t b, uint8_t c) { + const int g = a + b - c; + return ((g & ~0xff) == 0) ? g : (g < 0) ? 0 : 255; // clip to 8bit +} + +static void GradientPredictDirect_NEON(const uint8_t* const row, + const uint8_t* const top, + uint8_t* const out, int length) { + int i; + for (i = 0; i + 8 <= length; i += 8) { + const uint8x8_t A = vld1_u8(&row[i - 1]); + const uint8x8_t B = vld1_u8(&top[i + 0]); + const int16x8_t C = vreinterpretq_s16_u16(vaddl_u8(A, B)); + const int16x8_t D = LOAD_U8_TO_S16(&top[i - 1]); + const uint8x8_t E = vqmovun_s16(vsubq_s16(C, D)); + const uint8x8_t F = vld1_u8(&row[i + 0]); + vst1_u8(&out[i], vsub_u8(F, E)); + } + for (; i < length; ++i) { + out[i] = row[i] - GradientPredictor_C(row[i - 1], top[i], top[i - 1]); + } +} + +static WEBP_INLINE void DoGradientFilter_NEON(const uint8_t* in, + int width, int height, + int stride, + int row, int num_rows, + uint8_t* out) { + const size_t start_offset = row * stride; + const int last_row = row + num_rows; + SANITY_CHECK(in, out); + in += start_offset; + out += start_offset; + + // left prediction for top scan-line + if (row == 0) { + out[0] = in[0]; + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + row = 1; + in += stride; + out += stride; + } + + // Filter line-by-line. + while (row < last_row) { + out[0] = in[0] - in[-stride]; + GradientPredictDirect_NEON(in + 1, in + 1 - stride, out + 1, width - 1); + ++row; + in += stride; + out += stride; + } +} + +static void GradientFilter_NEON(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + DoGradientFilter_NEON(data, width, height, stride, 0, height, + filtered_data); +} + +#undef SANITY_CHECK + +//------------------------------------------------------------------------------ +// Inverse transforms + +static void HorizontalUnfilter_NEON(const uint8_t* prev, const uint8_t* in, + uint8_t* out, int width) { + int i; + const uint8x16_t zero = vdupq_n_u8(0); + uint8x16_t last; + out[0] = in[0] + (prev == NULL ? 0 : prev[0]); + if (width <= 1) return; + last = vsetq_lane_u8(out[0], zero, 0); + for (i = 1; i + 16 <= width; i += 16) { + const uint8x16_t A0 = vld1q_u8(&in[i]); + const uint8x16_t A1 = vaddq_u8(A0, last); + const uint8x16_t A2 = SHIFT_LEFT_N_Q(A1, 1); + const uint8x16_t A3 = vaddq_u8(A1, A2); + const uint8x16_t A4 = SHIFT_LEFT_N_Q(A3, 2); + const uint8x16_t A5 = vaddq_u8(A3, A4); + const uint8x16_t A6 = SHIFT_LEFT_N_Q(A5, 4); + const uint8x16_t A7 = vaddq_u8(A5, A6); + const uint8x16_t A8 = SHIFT_LEFT_N_Q(A7, 8); + const uint8x16_t A9 = vaddq_u8(A7, A8); + vst1q_u8(&out[i], A9); + last = SHIFT_RIGHT_N_Q(A9, 15); + } + for (; i < width; ++i) out[i] = in[i] + out[i - 1]; +} + +static void VerticalUnfilter_NEON(const uint8_t* prev, const uint8_t* in, + uint8_t* out, int width) { + if (prev == NULL) { + HorizontalUnfilter_NEON(NULL, in, out, width); + } else { + int i; + assert(width >= 0); + for (i = 0; i + 16 <= width; i += 16) { + const uint8x16_t A = vld1q_u8(&in[i]); + const uint8x16_t B = vld1q_u8(&prev[i]); + const uint8x16_t C = vaddq_u8(A, B); + vst1q_u8(&out[i], C); + } + for (; i < width; ++i) out[i] = in[i] + prev[i]; + } +} + +// GradientUnfilter_NEON is correct but slower than the C-version, +// at least on ARM64. For armv7, it's a wash. +// So best is to disable it for now, but keep the idea around... +#if !defined(USE_GRADIENT_UNFILTER) +#define USE_GRADIENT_UNFILTER 0 // ALTERNATE_CODE +#endif + +#if (USE_GRADIENT_UNFILTER == 1) +#define GRAD_PROCESS_LANE(L) do { \ + const uint8x8_t tmp1 = ROTATE_RIGHT_N(pred, 1); /* rotate predictor in */ \ + const int16x8_t tmp2 = vaddq_s16(BC, U8_TO_S16(tmp1)); \ + const uint8x8_t delta = vqmovun_s16(tmp2); \ + pred = vadd_u8(D, delta); \ + out = vext_u8(out, ROTATE_LEFT_N(pred, (L)), 1); \ +} while (0) + +static void GradientPredictInverse_NEON(const uint8_t* const in, + const uint8_t* const top, + uint8_t* const row, int length) { + if (length > 0) { + int i; + uint8x8_t pred = vdup_n_u8(row[-1]); // left sample + uint8x8_t out = vdup_n_u8(0); + for (i = 0; i + 8 <= length; i += 8) { + const int16x8_t B = LOAD_U8_TO_S16(&top[i + 0]); + const int16x8_t C = LOAD_U8_TO_S16(&top[i - 1]); + const int16x8_t BC = vsubq_s16(B, C); // unclipped gradient basis B - C + const uint8x8_t D = vld1_u8(&in[i]); // base input + GRAD_PROCESS_LANE(0); + GRAD_PROCESS_LANE(1); + GRAD_PROCESS_LANE(2); + GRAD_PROCESS_LANE(3); + GRAD_PROCESS_LANE(4); + GRAD_PROCESS_LANE(5); + GRAD_PROCESS_LANE(6); + GRAD_PROCESS_LANE(7); + vst1_u8(&row[i], out); + } + for (; i < length; ++i) { + row[i] = in[i] + GradientPredictor_C(row[i - 1], top[i], top[i - 1]); + } + } +} +#undef GRAD_PROCESS_LANE + +static void GradientUnfilter_NEON(const uint8_t* prev, const uint8_t* in, + uint8_t* out, int width) { + if (prev == NULL) { + HorizontalUnfilter_NEON(NULL, in, out, width); + } else { + out[0] = in[0] + prev[0]; // predict from above + GradientPredictInverse_NEON(in + 1, prev + 1, out + 1, width - 1); + } +} + +#endif // USE_GRADIENT_UNFILTER + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8FiltersInitNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitNEON(void) { + WebPUnfilters[WEBP_FILTER_HORIZONTAL] = HorizontalUnfilter_NEON; + WebPUnfilters[WEBP_FILTER_VERTICAL] = VerticalUnfilter_NEON; +#if (USE_GRADIENT_UNFILTER == 1) + WebPUnfilters[WEBP_FILTER_GRADIENT] = GradientUnfilter_NEON; +#endif + + WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter_NEON; + WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter_NEON; + WebPFilters[WEBP_FILTER_GRADIENT] = GradientFilter_NEON; +} + +#else // !WEBP_USE_NEON + +WEBP_DSP_INIT_STUB(VP8FiltersInitNEON) + +#endif // WEBP_USE_NEON diff --git a/media/libwebp/dsp/moz.build b/media/libwebp/dsp/moz.build index fa6df9e9e..f3c2bdd0b 100644 --- a/media/libwebp/dsp/moz.build +++ b/media/libwebp/dsp/moz.build @@ -9,6 +9,7 @@ with Files('**'): SOURCES += [ 'alpha_processing.c', + 'alpha_processing_neon.c', 'alpha_processing_sse2.c', 'alpha_processing_sse41.c', 'dec.c', @@ -17,6 +18,7 @@ SOURCES += [ 'dec_sse2.c', 'dec_sse41.c', 'filters.c', + 'filters_neon.c', 'filters_sse2.c', 'lossless.c', 'lossless_neon.c', @@ -29,15 +31,19 @@ SOURCES += [ 'upsampling_sse2.c', 'upsampling_sse41.c', 'yuv.c', + 'yuv_neon.c', 'yuv_sse2.c', 'yuv_sse41.c', ] if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']: + SOURCES['alpha_processing_neon.c'].flags += CONFIG['NEON_FLAGS'] SOURCES['dec_neon.c'].flags += CONFIG['NEON_FLAGS'] + SOURCES['filters_neon.c'].flags += CONFIG['NEON_FLAGS'] SOURCES['lossless_neon.c'].flags += CONFIG['NEON_FLAGS'] SOURCES['rescaler_neon.c'].flags += CONFIG['NEON_FLAGS'] SOURCES['upsampling_neon.c'].flags += CONFIG['NEON_FLAGS'] + SOURCES['yuv_neon.c'].flags += CONFIG['NEON_FLAGS'] elif CONFIG['INTEL_ARCHITECTURE']: SOURCES['alpha_processing_sse2.c'].flags += CONFIG['SSE2_FLAGS'] SOURCES['alpha_processing_sse41.c'].flags += CONFIG['SSE2_FLAGS'] diff --git a/media/libwebp/dsp/yuv_neon.c b/media/libwebp/dsp/yuv_neon.c new file mode 100644 index 000000000..81f00fe5a --- /dev/null +++ b/media/libwebp/dsp/yuv_neon.c @@ -0,0 +1,288 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// YUV->RGB conversion functions +// +// Author: Skal (pascal.massimino@gmail.com) + +#include "../dsp/yuv.h" + +#if defined(WEBP_USE_NEON) + +#include <assert.h> +#include <stdlib.h> + +#include "../dsp/neon.h" + +//----------------------------------------------------------------------------- + +static uint8x8_t ConvertRGBToY_NEON(const uint8x8_t R, + const uint8x8_t G, + const uint8x8_t B) { + const uint16x8_t r = vmovl_u8(R); + const uint16x8_t g = vmovl_u8(G); + const uint16x8_t b = vmovl_u8(B); + const uint16x4_t r_lo = vget_low_u16(r); + const uint16x4_t r_hi = vget_high_u16(r); + const uint16x4_t g_lo = vget_low_u16(g); + const uint16x4_t g_hi = vget_high_u16(g); + const uint16x4_t b_lo = vget_low_u16(b); + const uint16x4_t b_hi = vget_high_u16(b); + const uint32x4_t tmp0_lo = vmull_n_u16( r_lo, 16839u); + const uint32x4_t tmp0_hi = vmull_n_u16( r_hi, 16839u); + const uint32x4_t tmp1_lo = vmlal_n_u16(tmp0_lo, g_lo, 33059u); + const uint32x4_t tmp1_hi = vmlal_n_u16(tmp0_hi, g_hi, 33059u); + const uint32x4_t tmp2_lo = vmlal_n_u16(tmp1_lo, b_lo, 6420u); + const uint32x4_t tmp2_hi = vmlal_n_u16(tmp1_hi, b_hi, 6420u); + const uint16x8_t Y1 = vcombine_u16(vrshrn_n_u32(tmp2_lo, 16), + vrshrn_n_u32(tmp2_hi, 16)); + const uint16x8_t Y2 = vaddq_u16(Y1, vdupq_n_u16(16)); + return vqmovn_u16(Y2); +} + +static void ConvertRGB24ToY_NEON(const uint8_t* rgb, uint8_t* y, int width) { + int i; + for (i = 0; i + 8 <= width; i += 8, rgb += 3 * 8) { + const uint8x8x3_t RGB = vld3_u8(rgb); + const uint8x8_t Y = ConvertRGBToY_NEON(RGB.val[0], RGB.val[1], RGB.val[2]); + vst1_u8(y + i, Y); + } + for (; i < width; ++i, rgb += 3) { // left-over + y[i] = VP8RGBToY(rgb[0], rgb[1], rgb[2], YUV_HALF); + } +} + +static void ConvertBGR24ToY_NEON(const uint8_t* bgr, uint8_t* y, int width) { + int i; + for (i = 0; i + 8 <= width; i += 8, bgr += 3 * 8) { + const uint8x8x3_t BGR = vld3_u8(bgr); + const uint8x8_t Y = ConvertRGBToY_NEON(BGR.val[2], BGR.val[1], BGR.val[0]); + vst1_u8(y + i, Y); + } + for (; i < width; ++i, bgr += 3) { // left-over + y[i] = VP8RGBToY(bgr[2], bgr[1], bgr[0], YUV_HALF); + } +} + +static void ConvertARGBToY_NEON(const uint32_t* argb, uint8_t* y, int width) { + int i; + for (i = 0; i + 8 <= width; i += 8) { + const uint8x8x4_t RGB = vld4_u8((const uint8_t*)&argb[i]); + const uint8x8_t Y = ConvertRGBToY_NEON(RGB.val[2], RGB.val[1], RGB.val[0]); + vst1_u8(y + i, Y); + } + for (; i < width; ++i) { // left-over + const uint32_t p = argb[i]; + y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, + YUV_HALF); + } +} + +//----------------------------------------------------------------------------- + +// computes: DST_s16 = [(C0 * r + C1 * g + C2 * b) >> 16] + CST +#define MULTIPLY_16b_PREAMBLE(r, g, b) \ + const int16x4_t r_lo = vreinterpret_s16_u16(vget_low_u16(r)); \ + const int16x4_t r_hi = vreinterpret_s16_u16(vget_high_u16(r)); \ + const int16x4_t g_lo = vreinterpret_s16_u16(vget_low_u16(g)); \ + const int16x4_t g_hi = vreinterpret_s16_u16(vget_high_u16(g)); \ + const int16x4_t b_lo = vreinterpret_s16_u16(vget_low_u16(b)); \ + const int16x4_t b_hi = vreinterpret_s16_u16(vget_high_u16(b)) + +#define MULTIPLY_16b(C0, C1, C2, CST, DST_s16) do { \ + const int32x4_t tmp0_lo = vmull_n_s16( r_lo, C0); \ + const int32x4_t tmp0_hi = vmull_n_s16( r_hi, C0); \ + const int32x4_t tmp1_lo = vmlal_n_s16(tmp0_lo, g_lo, C1); \ + const int32x4_t tmp1_hi = vmlal_n_s16(tmp0_hi, g_hi, C1); \ + const int32x4_t tmp2_lo = vmlal_n_s16(tmp1_lo, b_lo, C2); \ + const int32x4_t tmp2_hi = vmlal_n_s16(tmp1_hi, b_hi, C2); \ + const int16x8_t tmp3 = vcombine_s16(vshrn_n_s32(tmp2_lo, 16), \ + vshrn_n_s32(tmp2_hi, 16)); \ + DST_s16 = vaddq_s16(tmp3, vdupq_n_s16(CST)); \ +} while (0) + +// This needs to be a macro, since (128 << SHIFT) needs to be an immediate. +#define CONVERT_RGB_TO_UV(r, g, b, SHIFT, U_DST, V_DST) do { \ + MULTIPLY_16b_PREAMBLE(r, g, b); \ + MULTIPLY_16b(-9719, -19081, 28800, 128 << SHIFT, U_DST); \ + MULTIPLY_16b(28800, -24116, -4684, 128 << SHIFT, V_DST); \ +} while (0) + +static void ConvertRGBA32ToUV_NEON(const uint16_t* rgb, + uint8_t* u, uint8_t* v, int width) { + int i; + for (i = 0; i + 8 <= width; i += 8, rgb += 4 * 8) { + const uint16x8x4_t RGB = vld4q_u16((const uint16_t*)rgb); + int16x8_t U, V; + CONVERT_RGB_TO_UV(RGB.val[0], RGB.val[1], RGB.val[2], 2, U, V); + vst1_u8(u + i, vqrshrun_n_s16(U, 2)); + vst1_u8(v + i, vqrshrun_n_s16(V, 2)); + } + for (; i < width; i += 1, rgb += 4) { + const int r = rgb[0], g = rgb[1], b = rgb[2]; + u[i] = VP8RGBToU(r, g, b, YUV_HALF << 2); + v[i] = VP8RGBToV(r, g, b, YUV_HALF << 2); + } +} + +static void ConvertARGBToUV_NEON(const uint32_t* argb, uint8_t* u, uint8_t* v, + int src_width, int do_store) { + int i; + for (i = 0; i + 16 <= src_width; i += 16, u += 8, v += 8) { + const uint8x16x4_t RGB = vld4q_u8((const uint8_t*)&argb[i]); + const uint16x8_t R = vpaddlq_u8(RGB.val[2]); // pair-wise adds + const uint16x8_t G = vpaddlq_u8(RGB.val[1]); + const uint16x8_t B = vpaddlq_u8(RGB.val[0]); + int16x8_t U_tmp, V_tmp; + CONVERT_RGB_TO_UV(R, G, B, 1, U_tmp, V_tmp); + { + const uint8x8_t U = vqrshrun_n_s16(U_tmp, 1); + const uint8x8_t V = vqrshrun_n_s16(V_tmp, 1); + if (do_store) { + vst1_u8(u, U); + vst1_u8(v, V); + } else { + const uint8x8_t prev_u = vld1_u8(u); + const uint8x8_t prev_v = vld1_u8(v); + vst1_u8(u, vrhadd_u8(U, prev_u)); + vst1_u8(v, vrhadd_u8(V, prev_v)); + } + } + } + if (i < src_width) { // left-over + WebPConvertARGBToUV_C(argb + i, u, v, src_width - i, do_store); + } +} + + +//------------------------------------------------------------------------------ + +extern void WebPInitConvertARGBToYUVNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPInitConvertARGBToYUVNEON(void) { + WebPConvertRGB24ToY = ConvertRGB24ToY_NEON; + WebPConvertBGR24ToY = ConvertBGR24ToY_NEON; + WebPConvertARGBToY = ConvertARGBToY_NEON; + WebPConvertARGBToUV = ConvertARGBToUV_NEON; + WebPConvertRGBA32ToUV = ConvertRGBA32ToUV_NEON; +} + +//------------------------------------------------------------------------------ + +#define MAX_Y ((1 << 10) - 1) // 10b precision over 16b-arithmetic +static uint16_t clip_y_NEON(int v) { + return (v < 0) ? 0 : (v > MAX_Y) ? MAX_Y : (uint16_t)v; +} + +static uint64_t SharpYUVUpdateY_NEON(const uint16_t* ref, const uint16_t* src, + uint16_t* dst, int len) { + int i; + const int16x8_t zero = vdupq_n_s16(0); + const int16x8_t max = vdupq_n_s16(MAX_Y); + uint64x2_t sum = vdupq_n_u64(0); + uint64_t diff; + + for (i = 0; i + 8 <= len; i += 8) { + const int16x8_t A = vreinterpretq_s16_u16(vld1q_u16(ref + i)); + const int16x8_t B = vreinterpretq_s16_u16(vld1q_u16(src + i)); + const int16x8_t C = vreinterpretq_s16_u16(vld1q_u16(dst + i)); + const int16x8_t D = vsubq_s16(A, B); // diff_y + const int16x8_t F = vaddq_s16(C, D); // new_y + const uint16x8_t H = + vreinterpretq_u16_s16(vmaxq_s16(vminq_s16(F, max), zero)); + const int16x8_t I = vabsq_s16(D); // abs(diff_y) + vst1q_u16(dst + i, H); + sum = vpadalq_u32(sum, vpaddlq_u16(vreinterpretq_u16_s16(I))); + } + diff = vgetq_lane_u64(sum, 0) + vgetq_lane_u64(sum, 1); + for (; i < len; ++i) { + const int diff_y = ref[i] - src[i]; + const int new_y = (int)(dst[i]) + diff_y; + dst[i] = clip_y_NEON(new_y); + diff += (uint64_t)(abs(diff_y)); + } + return diff; +} + +static void SharpYUVUpdateRGB_NEON(const int16_t* ref, const int16_t* src, + int16_t* dst, int len) { + int i; + for (i = 0; i + 8 <= len; i += 8) { + const int16x8_t A = vld1q_s16(ref + i); + const int16x8_t B = vld1q_s16(src + i); + const int16x8_t C = vld1q_s16(dst + i); + const int16x8_t D = vsubq_s16(A, B); // diff_uv + const int16x8_t E = vaddq_s16(C, D); // new_uv + vst1q_s16(dst + i, E); + } + for (; i < len; ++i) { + const int diff_uv = ref[i] - src[i]; + dst[i] += diff_uv; + } +} + +static void SharpYUVFilterRow_NEON(const int16_t* A, const int16_t* B, int len, + const uint16_t* best_y, uint16_t* out) { + int i; + const int16x8_t max = vdupq_n_s16(MAX_Y); + const int16x8_t zero = vdupq_n_s16(0); + for (i = 0; i + 8 <= len; i += 8) { + const int16x8_t a0 = vld1q_s16(A + i + 0); + const int16x8_t a1 = vld1q_s16(A + i + 1); + const int16x8_t b0 = vld1q_s16(B + i + 0); + const int16x8_t b1 = vld1q_s16(B + i + 1); + const int16x8_t a0b1 = vaddq_s16(a0, b1); + const int16x8_t a1b0 = vaddq_s16(a1, b0); + const int16x8_t a0a1b0b1 = vaddq_s16(a0b1, a1b0); // A0+A1+B0+B1 + const int16x8_t a0b1_2 = vaddq_s16(a0b1, a0b1); // 2*(A0+B1) + const int16x8_t a1b0_2 = vaddq_s16(a1b0, a1b0); // 2*(A1+B0) + const int16x8_t c0 = vshrq_n_s16(vaddq_s16(a0b1_2, a0a1b0b1), 3); + const int16x8_t c1 = vshrq_n_s16(vaddq_s16(a1b0_2, a0a1b0b1), 3); + const int16x8_t d0 = vaddq_s16(c1, a0); + const int16x8_t d1 = vaddq_s16(c0, a1); + const int16x8_t e0 = vrshrq_n_s16(d0, 1); + const int16x8_t e1 = vrshrq_n_s16(d1, 1); + const int16x8x2_t f = vzipq_s16(e0, e1); + const int16x8_t g0 = vreinterpretq_s16_u16(vld1q_u16(best_y + 2 * i + 0)); + const int16x8_t g1 = vreinterpretq_s16_u16(vld1q_u16(best_y + 2 * i + 8)); + const int16x8_t h0 = vaddq_s16(g0, f.val[0]); + const int16x8_t h1 = vaddq_s16(g1, f.val[1]); + const int16x8_t i0 = vmaxq_s16(vminq_s16(h0, max), zero); + const int16x8_t i1 = vmaxq_s16(vminq_s16(h1, max), zero); + vst1q_u16(out + 2 * i + 0, vreinterpretq_u16_s16(i0)); + vst1q_u16(out + 2 * i + 8, vreinterpretq_u16_s16(i1)); + } + for (; i < len; ++i) { + const int a0b1 = A[i + 0] + B[i + 1]; + const int a1b0 = A[i + 1] + B[i + 0]; + const int a0a1b0b1 = a0b1 + a1b0 + 8; + const int v0 = (8 * A[i + 0] + 2 * a1b0 + a0a1b0b1) >> 4; + const int v1 = (8 * A[i + 1] + 2 * a0b1 + a0a1b0b1) >> 4; + out[2 * i + 0] = clip_y_NEON(best_y[2 * i + 0] + v0); + out[2 * i + 1] = clip_y_NEON(best_y[2 * i + 1] + v1); + } +} +#undef MAX_Y + +//------------------------------------------------------------------------------ + +extern void WebPInitSharpYUVNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPInitSharpYUVNEON(void) { + WebPSharpYUVUpdateY = SharpYUVUpdateY_NEON; + WebPSharpYUVUpdateRGB = SharpYUVUpdateRGB_NEON; + WebPSharpYUVFilterRow = SharpYUVFilterRow_NEON; +} + +#else // !WEBP_USE_NEON + +WEBP_DSP_INIT_STUB(WebPInitConvertARGBToYUVNEON) +WEBP_DSP_INIT_STUB(WebPInitSharpYUVNEON) + +#endif // WEBP_USE_NEON diff --git a/media/libwebp/update.sh b/media/libwebp/update.sh index 652993004..4fff43d69 100644 --- a/media/libwebp/update.sh +++ b/media/libwebp/update.sh @@ -38,6 +38,7 @@ cp $1/src/demux/demux.c demux mkdir -p dsp cp $1/src/dsp/*.h dsp cp $1/src/dsp/alpha_processing.c dsp +cp $1/src/dsp/alpha_processing_neon.c dsp cp $1/src/dsp/alpha_processing_sse2.c dsp cp $1/src/dsp/alpha_processing_sse41.c dsp cp $1/src/dsp/dec.c dsp @@ -46,6 +47,7 @@ cp $1/src/dsp/dec_neon.c dsp cp $1/src/dsp/dec_sse2.c dsp cp $1/src/dsp/dec_sse41.c dsp cp $1/src/dsp/filters.c dsp +cp $1/src/dsp/filters_neon.c dsp cp $1/src/dsp/filters_sse2.c dsp cp $1/src/dsp/lossless.c dsp cp $1/src/dsp/lossless_neon.c dsp @@ -58,6 +60,7 @@ cp $1/src/dsp/upsampling_neon.c dsp cp $1/src/dsp/upsampling_sse2.c dsp cp $1/src/dsp/upsampling_sse41.c dsp cp $1/src/dsp/yuv.c dsp +cp $1/src/dsp/yuv_neon.c dsp cp $1/src/dsp/yuv_sse2.c dsp cp $1/src/dsp/yuv_sse41.c dsp diff --git a/media/mtransport/third_party/nICEr/src/ice/ice_component.c b/media/mtransport/third_party/nICEr/src/ice/ice_component.c index 2be25efca..11b4fcbc1 100644 --- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c +++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c @@ -909,7 +909,6 @@ static int nr_ice_component_process_incoming_check(nr_ice_component *comp, nr_tr nr_ice_candidate_pair_set_state(pair->pctx,pair,NR_ICE_PAIR_STATE_FROZEN); if(r=nr_ice_component_insert_pair(comp,pair)) { *error=(r==R_NO_MEMORY)?500:400; - nr_ice_candidate_pair_destroy(&pair); ABORT(r); } @@ -1615,6 +1614,7 @@ int nr_ice_component_finalize(nr_ice_component *lcomp, nr_ice_component *rcomp) int nr_ice_component_insert_pair(nr_ice_component *pcomp, nr_ice_cand_pair *pair) { int r,_status; + int pair_inserted=0; /* Pairs for peer reflexive are marked SUCCEEDED immediately */ if (pair->state != NR_ICE_PAIR_STATE_FROZEN && @@ -1626,6 +1626,8 @@ int nr_ice_component_insert_pair(nr_ice_component *pcomp, nr_ice_cand_pair *pair if(r=nr_ice_candidate_pair_insert(&pair->remote->stream->check_list,pair)) ABORT(r); + pair_inserted=1; + /* Make sure the check timer is running, if the stream was previously * started. We will not start streams just because a pair was created, * unless it is the first pair to be created across all streams. */ @@ -1642,6 +1644,9 @@ int nr_ice_component_insert_pair(nr_ice_component *pcomp, nr_ice_cand_pair *pair _status=0; abort: + if (_status && !pair_inserted) { + nr_ice_candidate_pair_destroy(&pair); + } return(_status); } diff --git a/memory/mozalloc/mozalloc_abort.cpp b/memory/mozalloc/mozalloc_abort.cpp index a998d8164..85e566db0 100644 --- a/memory/mozalloc/mozalloc_abort.cpp +++ b/memory/mozalloc/mozalloc_abort.cpp @@ -68,7 +68,7 @@ void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) { // // That segmentation fault will be interpreted as another bug by ASan and as a // result, ASan will just exit(1) instead of aborting. -void abort(void) +extern "C" void abort(void) { #ifdef MOZ_WIDGET_ANDROID char msg[64] = {}; diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c index 9a97bbb09..acaf2572c 100644 --- a/memory/mozjemalloc/jemalloc.c +++ b/memory/mozjemalloc/jemalloc.c @@ -280,7 +280,9 @@ typedef long ssize_t; #define JEMALLOC_RECYCLE #ifndef MOZ_MEMORY_WINDOWS +#ifndef MOZ_MEMORY_SOLARIS #include <sys/cdefs.h> +#endif #ifndef __DECONST # define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) #endif @@ -306,7 +308,7 @@ __FBSDID("$FreeBSD: head/lib/libc/stdlib/malloc.c 180599 2008-07-18 19:35:44Z ja #endif #include <sys/time.h> #include <sys/types.h> -#if !defined(MOZ_MEMORY_ANDROID) +#if !defined(MOZ_MEMORY_SOLARIS) && !defined(MOZ_MEMORY_ANDROID) #include <sys/sysctl.h> #endif #include <sys/uio.h> @@ -408,6 +410,10 @@ void *_mmap(void *addr, size_t length, int prot, int flags, #endif #endif +#if defined(MOZ_MEMORY_SOLARIS) && defined(MAP_ALIGN) && !defined(JEMALLOC_NEVER_USES_MAP_ALIGN) +#define JEMALLOC_USES_MAP_ALIGN /* Required on Solaris 10. Might improve performance elsewhere. */ +#endif + #ifndef __DECONST #define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) #endif @@ -1034,7 +1040,7 @@ static const bool config_recycle = false; * will abort. * Platform specific page size conditions copied from js/public/HeapAPI.h */ -#if (defined(__FreeBSD__)) && \ +#if (defined(SOLARIS) || defined(__FreeBSD__)) && \ (defined(__sparc) || defined(__sparcv9) || defined(__ia64)) #define pagesize_2pow ((size_t) 13) #elif defined(__powerpc64__) @@ -2640,8 +2646,13 @@ pages_purge(void *addr, size_t length) # define JEMALLOC_MADV_PURGE MADV_FREE # define JEMALLOC_MADV_ZEROS false # endif +#ifdef MOZ_MEMORY_SOLARIS + int err = posix_madvise(addr, length, JEMALLOC_MADV_PURGE); + unzeroed = (JEMALLOC_MADV_ZEROS == false || err != 0); +#else int err = madvise(addr, length, JEMALLOC_MADV_PURGE); unzeroed = (JEMALLOC_MADV_ZEROS == false || err != 0); +#endif # undef JEMALLOC_MADV_PURGE # undef JEMALLOC_MADV_ZEROS # endif @@ -3597,9 +3608,14 @@ arena_purge(arena_t *arena, bool all) #endif #ifndef MALLOC_DECOMMIT +#ifdef MOZ_MEMORY_SOLARIS + posix_madvise((void*)((uintptr_t)chunk + (i << pagesize_2pow)), + (npages << pagesize_2pow),MADV_FREE); +#else madvise((void *)((uintptr_t)chunk + (i << pagesize_2pow)), (npages << pagesize_2pow), MADV_FREE); +#endif # ifdef MALLOC_DOUBLE_PURGE madvised = true; # endif @@ -5120,6 +5136,13 @@ malloc_ncpus(void) else return (n); } +#elif (defined(MOZ_MEMORY_SOLARIS)) + +static inline unsigned +malloc_ncpus(void) +{ + return sysconf(_SC_NPROCESSORS_ONLN); +} #elif (defined(MOZ_MEMORY_WINDOWS)) static inline unsigned malloc_ncpus(void) @@ -5916,9 +5939,15 @@ RETURN: #define MOZ_MEMORY_ELF #endif +#ifdef MOZ_MEMORY_SOLARIS +# if (defined(__GNUC__)) +__attribute__((noinline)) +# endif +#else #if (defined(MOZ_MEMORY_ELF)) __attribute__((visibility ("hidden"))) #endif +#endif #endif /* MOZ_REPLACE_MALLOC */ #ifdef MOZ_MEMORY_ELF diff --git a/mfbt/Poison.cpp b/mfbt/Poison.cpp index b2767011d..7972dbea3 100644 --- a/mfbt/Poison.cpp +++ b/mfbt/Poison.cpp @@ -129,7 +129,11 @@ ReleaseRegion(void* aRegion, uintptr_t aSize) static bool ProbeRegion(uintptr_t aRegion, uintptr_t aSize) { +#ifdef XP_SOLARIS + if (posix_madvise(reinterpret_cast<void*>(aRegion), aSize, POSIX_MADV_NORMAL)) { +#else if (madvise(reinterpret_cast<void*>(aRegion), aSize, MADV_NORMAL)) { +#endif return true; } else { return false; diff --git a/mfbt/tests/TestPoisonArea.cpp b/mfbt/tests/TestPoisonArea.cpp index 6f1b61ed3..fb39ccf79 100644 --- a/mfbt/tests/TestPoisonArea.cpp +++ b/mfbt/tests/TestPoisonArea.cpp @@ -266,7 +266,11 @@ ReleaseRegion(void* aPage) static bool ProbeRegion(uintptr_t aPage) { +#ifdef XP_SOLARIS + return !!posix_madvise(reinterpret_cast<void*>(aPage), PageSize(), POSIX_MADV_NORMAL); +#else return !!madvise(reinterpret_cast<void*>(aPage), PageSize(), MADV_NORMAL); +#endif } static int diff --git a/modules/fdlibm/patches/12_define_u_int32_t_and_u_int64_t_on_windows.patch b/modules/fdlibm/patches/12_define_u_int32_t_and_u_int64_t_on_windows.patch index b8f238c74..c0e9814aa 100644 --- a/modules/fdlibm/patches/12_define_u_int32_t_and_u_int64_t_on_windows.patch +++ b/modules/fdlibm/patches/12_define_u_int32_t_and_u_int64_t_on_windows.patch @@ -10,8 +10,10 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private * endianness at run time. */ -+#ifdef WIN32 ++#ifndef u_int32_t +#define u_int32_t uint32_t ++#endif ++#ifndef u_int64_t +#define u_int64_t uint64_t +#endif + diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h index 6947cecc0..86597e75f 100644 --- a/modules/fdlibm/src/math_private.h +++ b/modules/fdlibm/src/math_private.h @@ -38,8 +38,10 @@ * endianness at run time. */ -#ifdef WIN32 +#ifndef u_int32_t #define u_int32_t uint32_t +#endif +#ifndef u_int64_t #define u_int64_t uint64_t #endif diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index 429de1011..841503ebf 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -688,7 +688,9 @@ MOZ_WIN_MEM_TRY_BEGIN // Success means optimized jar layout from bug 559961 is in effect uint32_t readaheadLength = xtolong(startp); if (readaheadLength) { -#if defined(XP_UNIX) +#ifdef XP_SOLARIS + posix_madvise(const_cast<uint8_t*>(startp), readaheadLength, POSIX_MADV_WILLNEED); +#elif defined(XP_UNIX) madvise(const_cast<uint8_t*>(startp), readaheadLength, MADV_WILLNEED); #elif defined(XP_WIN) if (aFd) { diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index e69a985ce..ea76c30e5 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -732,13 +732,20 @@ pref("gfx.layerscope.port", 23456); // This should be use to quickly find which slow paths are used by test cases. pref("gfx.perf-warnings.enabled", false); -// 0 = Off, 1 = Full, 2 = Tagged Images Only. +// Color Management System +// 0 = Off, 1 = All Images, 2 = Tagged Images Only. // See eCMSMode in gfx/thebes/gfxPlatform.h +// Enabled by default on Windows and Mac, disabled elsewhere +#if defined(XP_WIN) || defined(XP_MACOSX) pref("gfx.color_management.mode", 2); +#else +pref("gfx.color_management.mode", 0); +#endif pref("gfx.color_management.display_profile", ""); pref("gfx.color_management.rendering_intent", 0); pref("gfx.color_management.enablev4", true); + pref("gfx.downloadable_fonts.enabled", true); pref("gfx.downloadable_fonts.fallback_delay", 3000); pref("gfx.downloadable_fonts.fallback_delay_short", 100); diff --git a/mozglue/build/WindowsDllBlocklist.cpp b/mozglue/build/WindowsDllBlocklist.cpp index c7d14041d..0686b64cb 100644 --- a/mozglue/build/WindowsDllBlocklist.cpp +++ b/mozglue/build/WindowsDllBlocklist.cpp @@ -227,6 +227,9 @@ static DllBlockInfo sWindowsDllBlocklist[] = { // Comodo IS old versions, startup crash on 64-bit, bug 1140397 { "guard64.dll", MAKE_VERSION(6, 3, 0, 0) }, + // 360 Safeguard/360 Total Security causes a11y crashes, bug 1536227. + { "safemon64.dll", ALL_VERSIONS }, + { nullptr, 0 } }; diff --git a/mozilla-config.h.in b/mozilla-config.h.in index 7484180b0..6883a7be2 100644 --- a/mozilla-config.h.in +++ b/mozilla-config.h.in @@ -13,7 +13,7 @@ #endif #endif -// Expands to all the defines from configure. +/* Expands to all the defines from configure. */ #undef ALLDEFINES /* diff --git a/netwerk/protocol/http/Http2Session.cpp b/netwerk/protocol/http/Http2Session.cpp index 86e8c74f6..726b39f74 100644 --- a/netwerk/protocol/http/Http2Session.cpp +++ b/netwerk/protocol/http/Http2Session.cpp @@ -2182,6 +2182,7 @@ Http2Session::RecvAltSvc(Http2Session *self) } if (NS_FAILED(self->SetInputFrameDataStream(self->mInputFrameID)) || + !self->mInputFrameDataStream || !self->mInputFrameDataStream->Transaction() || !self->mInputFrameDataStream->Transaction()->RequestHead()) { LOG3(("Http2Session::RecvAltSvc %p got frame w/o origin on invalid stream", self)); diff --git a/old-configure.in b/old-configure.in index 1525ecc9b..6638ea688 100644 --- a/old-configure.in +++ b/old-configure.in @@ -761,7 +761,7 @@ case "$host" in HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" ;; - + *) HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}" @@ -1197,6 +1197,14 @@ case "$target" in fi ;; +i*86-*-solaris*) + MOZ_FIX_LINK_PATHS="-L${DIST}/bin -R'\$\$ORIGIN':/usr/gcc/7/lib" + ;; + +x86_64-*-solaris*) + MOZ_FIX_LINK_PATHS="-L${DIST}/bin -R'\$\$ORIGIN':/usr/gcc/7/lib/amd64" + ;; + esac AC_SUBST_LIST(MMX_FLAGS) @@ -3138,6 +3146,23 @@ fi AC_SUBST(MOZ_PULSEAUDIO) dnl ======================================================== +dnl = Enable sndio +dnl ======================================================== +MOZ_ARG_ENABLE_BOOL(sndio, +[ --enable-sndio Enable sndio support], + MOZ_SNDIO=1, + MOZ_SNDIO= ) + +if test -n "$MOZ_SNDIO"; then + AC_DEFINE(MOZ_SNDIO) + MOZ_CHECK_HEADER([sndio.h], [], + AC_MSG_ERROR( + [--enable-sndio specified but it requires sndio development headers])) + AC_DEFINE(MOZ_SNDIO) +fi +AC_SUBST(MOZ_SNDIO) + +dnl ======================================================== dnl NegotiateAuth dnl ======================================================== @@ -4142,7 +4167,7 @@ if test -f "${srcdir}/${MOZ_BUILD_APP}/configure.in" ; then _subconfigure_config_args="$ac_configure_args" } tmpscript=`$PYTHON -c 'import os, tempfile; print tempfile.mktemp(prefix="subscript.").replace(os.sep, "/")'` || exit 1 - m4 "${srcdir}/build/autoconf/subconfigure.m4" \ + ${TOOLCHAIN_PREFIX}m4 "${srcdir}/build/autoconf/subconfigure.m4" \ "${srcdir}/build/autoconf/altoptions.m4" \ "${srcdir}/${MOZ_BUILD_APP}/configure.in" > $tmpscript . $tmpscript diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c index 93a817764..6ab140c89 100644 --- a/parser/expat/lib/xmlparse.c +++ b/parser/expat/lib/xmlparse.c @@ -335,7 +335,7 @@ initializeEncoding(XML_Parser parser); static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr, - XML_Bool haveMore); + XML_Bool haveMore, XML_Bool allowClosingDoctype); static enum XML_Error processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl); @@ -3760,7 +3760,7 @@ externalParEntProcessor(XML_Parser parser, processor = prologProcessor; return doProlog(parser, encoding, s, end, tok, next, - nextPtr, (XML_Bool)!ps_finalBuffer); + nextPtr, (XML_Bool)!ps_finalBuffer, XML_TRUE); } static enum XML_Error PTRCALL @@ -3810,7 +3810,7 @@ prologProcessor(XML_Parser parser, const char *next = s; int tok = XmlPrologTok(encoding, s, end, &next); return doProlog(parser, encoding, s, end, tok, next, - nextPtr, (XML_Bool)!ps_finalBuffer); + nextPtr, (XML_Bool)!ps_finalBuffer, XML_TRUE); } static enum XML_Error @@ -3821,7 +3821,8 @@ doProlog(XML_Parser parser, int tok, const char *next, const char **nextPtr, - XML_Bool haveMore) + XML_Bool haveMore, + XML_Bool allowClosingDoctype) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = { '#' , '\0' }; @@ -3987,6 +3988,11 @@ doProlog(XML_Parser parser, } break; case XML_ROLE_DOCTYPE_CLOSE: + if (allowClosingDoctype != XML_TRUE) { + /* Must not close doctype from within expanded parameter entities */ + return XML_ERROR_INVALID_TOKEN; + } + if (doctypeName) { startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid, doctypePubid, 0); @@ -4892,7 +4898,7 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, if (entity->is_param) { int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next); result = doProlog(parser, internalEncoding, textStart, textEnd, tok, - next, &next, XML_FALSE); + next, &next, XML_FALSE, XML_FALSE); } else #endif /* XML_DTD */ @@ -4959,7 +4965,7 @@ internalEntityProcessor(XML_Parser parser, if (entity->is_param) { int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next); result = doProlog(parser, internalEncoding, textStart, textEnd, tok, - next, &next, XML_FALSE); + next, &next, XML_FALSE, XML_TRUE); } else #endif /* XML_DTD */ @@ -4986,7 +4992,7 @@ internalEntityProcessor(XML_Parser parser, processor = prologProcessor; tok = XmlPrologTok(encoding, s, end, &next); return doProlog(parser, encoding, s, end, tok, next, nextPtr, - (XML_Bool)!ps_finalBuffer); + (XML_Bool)!ps_finalBuffer, XML_TRUE); } else #endif /* XML_DTD */ diff --git a/parser/html/jArray.h b/parser/html/jArray.h index 45548a077..98889059c 100644 --- a/parser/html/jArray.h +++ b/parser/html/jArray.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -44,32 +45,66 @@ struct staticJArray { } }; -template<class T, class L> -struct jArray { +template <class T, class L> +class autoJArray; + +template <class T, class L> +class jArray { + friend class autoJArray<T, L>; + +private: T* arr; + +public: L length; + static jArray<T,L> newJArray(L const len) { MOZ_ASSERT(len >= 0, "Negative length."); jArray<T,L> newArray = { new T[size_t(len)], len }; return newArray; } + static jArray<T,L> newFallibleJArray(L const len) { MOZ_ASSERT(len >= 0, "Negative length."); T* a = new (mozilla::fallible) T[size_t(len)]; jArray<T,L> newArray = { a, a ? len : 0 }; return newArray; } - operator T*() { return arr; } + + operator T*() { + return arr; + } + T& operator[] (L const index) { MOZ_ASSERT(index >= 0, "Array access with negative index."); MOZ_ASSERT(index < length, "Array index out of bounds."); return arr[index]; } + void operator=(staticJArray<T,L>& other) { arr = (T*)other.arr; length = other.length; } -}; + + MOZ_IMPLICIT jArray(decltype(nullptr)) + : arr(nullptr) + , length(0) + { + } + + jArray() + : arr(nullptr) + , length(0) + { + } + +private: + jArray(T* aArr, L aLength) + : arr(aArr) + , length(aLength) + { + } +}; // class jArray template<class T, class L> class autoJArray { diff --git a/parser/html/java/Makefile b/parser/html/java/Makefile deleted file mode 100644 index b43523e03..000000000 --- a/parser/html/java/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -libs:: translator - -translator:: javaparser \ -; mkdir -p htmlparser/bin && \ - find htmlparser/translator-src/nu/validator/htmlparser -name "*.java" | \ - xargs javac -cp javaparser.jar -g -d htmlparser/bin && \ - jar cfm translator.jar manifest.txt -C htmlparser/bin . - -javaparser:: \ -; mkdir -p javaparser/bin && \ - find javaparser/src -name "*.java" | \ - xargs javac -encoding ISO-8859-1 -g -d javaparser/bin && \ - jar cf javaparser.jar -C javaparser/bin . - -sync_javaparser:: \ -; if [ ! -d javaparser/.git ] ; \ - then rm -rf javaparser ; \ - git clone https://github.com/javaparser/javaparser.git ; \ - fi ; \ - cd javaparser ; git checkout javaparser-1.0.6 ; cd .. - -sync_htmlparser:: \ -; if [ -d htmlparser/.hg ] ; \ - then cd htmlparser ; hg pull --rebase ; cd .. ; \ - else \ - rm -rf htmlparser ; \ - hg clone https://hg.mozilla.org/projects/htmlparser ; \ - fi - -sync:: sync_javaparser sync_htmlparser - -translate:: translator \ -; mkdir -p ../javasrc ; \ - java -jar translator.jar \ - htmlparser/src/nu/validator/htmlparser/impl \ - .. ../nsHtml5AtomList.h - -translate_from_snapshot:: translator \ -; mkdir -p ../javasrc ; \ - java -jar translator.jar \ - ../javasrc \ - .. ../nsHtml5AtomList.h - -named_characters:: translator \ -; java -cp translator.jar \ - nu.validator.htmlparser.generator.GenerateNamedCharactersCpp \ - named-character-references.html ../ - -clean_javaparser:: \ -; rm -rf javaparser/bin javaparser.jar - -clean_htmlparser:: \ -; rm -rf htmlparser/bin translator.jar - -clean:: clean_javaparser clean_htmlparser diff --git a/parser/html/java/README.txt b/parser/html/java/README.txt deleted file mode 100644 index df1bfcd4c..000000000 --- a/parser/html/java/README.txt +++ /dev/null @@ -1,46 +0,0 @@ -If this is your first time building the HTML5 parser, you need to execute the -following commands (from this directory) to bootstrap the translation: - - make sync # fetch remote source files and licenses - make translate # perform the Java-to-C++ translation from the remote - # sources - make named_characters # Generate tables for named character tokenization - -If you make changes to the translator or the javaparser, you can rebuild by -retyping 'make' in this directory. If you make changes to the HTML5 Java -implementation, you can retranslate the Java sources from the htmlparser -repository by retyping 'make translate' in this directory. - -The makefile supports the following targets: - -sync_htmlparser: - Retrieves the HTML parser and Java to C++ translator sources from Mozilla's - htmlparser repository. -sync_javaparser: - Retrieves the javaparser sources from GitHub. -sync: - Runs both sync_javaparser and sync_htmlparser. -javaparser: - Builds the javaparser library retrieved earlier by sync_javaparser. -translator: - Runs the javaparser target and then builds the Java to C++ translator from - sources retrieved earlier by sync_htmlparser. -libs: - The default target. Alias for translator -translate: - Runs the translator target and then translates the HTML parser sources - retrieved by sync_htmlparser copying the Java sources to ../javasrc. -translate_from_snapshot: - Runs the translator target and then translates the HTML parser sources - stored in ../javasrc. -named_characters: - Generates data tables for named character tokenization. -clean_javaparser: - Removes the build products of the javaparser target. -clean_htmlparser: - Removes the build products of the translator target. -clean: - Runs both clean_javaparser and clean_htmlparser. - -Ben Newman (23 September 2009) -Henri Sivonen (11 August 2016) diff --git a/parser/html/java/manifest.txt b/parser/html/java/manifest.txt deleted file mode 100644 index 14cd9d081..000000000 --- a/parser/html/java/manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -Main-Class: nu.validator.htmlparser.cpptranslate.Main -Class-Path: javaparser.jar diff --git a/parser/html/java/named-character-references.html b/parser/html/java/named-character-references.html deleted file mode 100644 index c8d1e08da..000000000 --- a/parser/html/java/named-character-references.html +++ /dev/null @@ -1,7 +0,0 @@ -<!-- -Spec rev 4381 ---> - - <table><thead><tr><th> Name </th> <th> Character </th> <tbody><tr><td> <code title="">AElig;</code> </td> <td> U+000C6 </td> <tr><td> <code title="">AElig</code> </td> <td> U+000C6 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">AMP;</code> </td> <td> U+00026 </td> <tr><td> <code title="">AMP</code> </td> <td> U+00026 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Aacute;</code> </td> <td> U+000C1 </td> <tr><td> <code title="">Aacute</code> </td> <td> U+000C1 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Abreve;</code> </td> <td> U+00102 </td> <tr><td> <code title="">Acirc;</code> </td> <td> U+000C2 </td> <tr><td> <code title="">Acirc</code> </td> <td> U+000C2 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Acy;</code> </td> <td> U+00410 </td> <tr><td> <code title="">Afr;</code> </td> <td> U+1D504 </td> <tr><td> <code title="">Agrave;</code> </td> <td> U+000C0 </td> <tr><td> <code title="">Agrave</code> </td> <td> U+000C0 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Alpha;</code> </td> <td> U+00391 </td> <tr><td> <code title="">Amacr;</code> </td> <td> U+00100 </td> <tr><td> <code title="">And;</code> </td> <td> U+02A53 </td> <tr><td> <code title="">Aogon;</code> </td> <td> U+00104 </td> <tr><td> <code title="">Aopf;</code> </td> <td> U+1D538 </td> <tr><td> <code title="">ApplyFunction;</code> </td> <td> U+02061 </td> <tr><td> <code title="">Aring;</code> </td> <td> U+000C5 </td> <tr><td> <code title="">Aring</code> </td> <td> U+000C5 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ascr;</code> </td> <td> U+1D49C </td> <tr><td> <code title="">Assign;</code> </td> <td> U+02254 </td> <tr><td> <code title="">Atilde;</code> </td> <td> U+000C3 </td> <tr><td> <code title="">Atilde</code> </td> <td> U+000C3 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Auml;</code> </td> <td> U+000C4 </td> <tr><td> <code title="">Auml</code> </td> <td> U+000C4 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Backslash;</code> </td> <td> U+02216 </td> <tr><td> <code title="">Barv;</code> </td> <td> U+02AE7 </td> <tr><td> <code title="">Barwed;</code> </td> <td> U+02306 </td> <tr><td> <code title="">Bcy;</code> </td> <td> U+00411 </td> <tr><td> <code title="">Because;</code> </td> <td> U+02235 </td> <tr><td> <code title="">Bernoullis;</code> </td> <td> U+0212C </td> <tr><td> <code title="">Beta;</code> </td> <td> U+00392 </td> <tr><td> <code title="">Bfr;</code> </td> <td> U+1D505 </td> <tr><td> <code title="">Bopf;</code> </td> <td> U+1D539 </td> <tr><td> <code title="">Breve;</code> </td> <td> U+002D8 </td> <tr><td> <code title="">Bscr;</code> </td> <td> U+0212C </td> <tr><td> <code title="">Bumpeq;</code> </td> <td> U+0224E </td> <tr><td> <code title="">CHcy;</code> </td> <td> U+00427 </td> <tr><td> <code title="">COPY;</code> </td> <td> U+000A9 </td> <tr><td> <code title="">COPY</code> </td> <td> U+000A9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Cacute;</code> </td> <td> U+00106 </td> <tr><td> <code title="">Cap;</code> </td> <td> U+022D2 </td> <tr><td> <code title="">CapitalDifferentialD;</code> </td> <td> U+02145 </td> <tr><td> <code title="">Cayleys;</code> </td> <td> U+0212D </td> <tr><td> <code title="">Ccaron;</code> </td> <td> U+0010C </td> <tr><td> <code title="">Ccedil;</code> </td> <td> U+000C7 </td> <tr><td> <code title="">Ccedil</code> </td> <td> U+000C7 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ccirc;</code> </td> <td> U+00108 </td> <tr><td> <code title="">Cconint;</code> </td> <td> U+02230 </td> <tr><td> <code title="">Cdot;</code> </td> <td> U+0010A </td> <tr><td> <code title="">Cedilla;</code> </td> <td> U+000B8 </td> <tr><td> <code title="">CenterDot;</code> </td> <td> U+000B7 </td> <tr><td> <code title="">Cfr;</code> </td> <td> U+0212D </td> <tr><td> <code title="">Chi;</code> </td> <td> U+003A7 </td> <tr><td> <code title="">CircleDot;</code> </td> <td> U+02299 </td> <tr><td> <code title="">CircleMinus;</code> </td> <td> U+02296 </td> <tr><td> <code title="">CirclePlus;</code> </td> <td> U+02295 </td> <tr><td> <code title="">CircleTimes;</code> </td> <td> U+02297 </td> <tr><td> <code title="">ClockwiseContourIntegral;</code> </td> <td> U+02232 </td> <tr><td> <code title="">CloseCurlyDoubleQuote;</code> </td> <td> U+0201D </td> <tr><td> <code title="">CloseCurlyQuote;</code> </td> <td> U+02019 </td> <tr><td> <code title="">Colon;</code> </td> <td> U+02237 </td> <tr><td> <code title="">Colone;</code> </td> <td> U+02A74 </td> <tr><td> <code title="">Congruent;</code> </td> <td> U+02261 </td> <tr><td> <code title="">Conint;</code> </td> <td> U+0222F </td> <tr><td> <code title="">ContourIntegral;</code> </td> <td> U+0222E </td> <tr><td> <code title="">Copf;</code> </td> <td> U+02102 </td> <tr><td> <code title="">Coproduct;</code> </td> <td> U+02210 </td> <tr><td> <code title="">CounterClockwiseContourIntegral;</code> </td> <td> U+02233 </td> <tr><td> <code title="">Cross;</code> </td> <td> U+02A2F </td> <tr><td> <code title="">Cscr;</code> </td> <td> U+1D49E </td> <tr><td> <code title="">Cup;</code> </td> <td> U+022D3 </td> <tr><td> <code title="">CupCap;</code> </td> <td> U+0224D </td> <tr><td> <code title="">DD;</code> </td> <td> U+02145 </td> <tr><td> <code title="">DDotrahd;</code> </td> <td> U+02911 </td> <tr><td> <code title="">DJcy;</code> </td> <td> U+00402 </td> <tr><td> <code title="">DScy;</code> </td> <td> U+00405 </td> <tr><td> <code title="">DZcy;</code> </td> <td> U+0040F </td> <tr><td> <code title="">Dagger;</code> </td> <td> U+02021 </td> <tr><td> <code title="">Darr;</code> </td> <td> U+021A1 </td> <tr><td> <code title="">Dashv;</code> </td> <td> U+02AE4 </td> <tr><td> <code title="">Dcaron;</code> </td> <td> U+0010E </td> <tr><td> <code title="">Dcy;</code> </td> <td> U+00414 </td> <tr><td> <code title="">Del;</code> </td> <td> U+02207 </td> <tr><td> <code title="">Delta;</code> </td> <td> U+00394 </td> <tr><td> <code title="">Dfr;</code> </td> <td> U+1D507 </td> <tr><td> <code title="">DiacriticalAcute;</code> </td> <td> U+000B4 </td> <tr><td> <code title="">DiacriticalDot;</code> </td> <td> U+002D9 </td> <tr><td> <code title="">DiacriticalDoubleAcute;</code> </td> <td> U+002DD </td> <tr><td> <code title="">DiacriticalGrave;</code> </td> <td> U+00060 </td> <tr><td> <code title="">DiacriticalTilde;</code> </td> <td> U+002DC </td> <tr><td> <code title="">Diamond;</code> </td> <td> U+022C4 </td> <tr><td> <code title="">DifferentialD;</code> </td> <td> U+02146 </td> <tr><td> <code title="">Dopf;</code> </td> <td> U+1D53B </td> <tr><td> <code title="">Dot;</code> </td> <td> U+000A8 </td> <tr><td> <code title="">DotDot;</code> </td> <td> U+020DC </td> <tr><td> <code title="">DotEqual;</code> </td> <td> U+02250 </td> <tr><td> <code title="">DoubleContourIntegral;</code> </td> <td> U+0222F </td> <tr><td> <code title="">DoubleDot;</code> </td> <td> U+000A8 </td> <tr><td> <code title="">DoubleDownArrow;</code> </td> <td> U+021D3 </td> <tr><td> <code title="">DoubleLeftArrow;</code> </td> <td> U+021D0 </td> <tr><td> <code title="">DoubleLeftRightArrow;</code> </td> <td> U+021D4 </td> <tr><td> <code title="">DoubleLeftTee;</code> </td> <td> U+02AE4 </td> <tr><td> <code title="">DoubleLongLeftArrow;</code> </td> <td> U+027F8 </td> <tr><td> <code title="">DoubleLongLeftRightArrow;</code> </td> <td> U+027FA </td> <tr><td> <code title="">DoubleLongRightArrow;</code> </td> <td> U+027F9 </td> <tr><td> <code title="">DoubleRightArrow;</code> </td> <td> U+021D2 </td> <tr><td> <code title="">DoubleRightTee;</code> </td> <td> U+022A8 </td> <tr><td> <code title="">DoubleUpArrow;</code> </td> <td> U+021D1 </td> <tr><td> <code title="">DoubleUpDownArrow;</code> </td> <td> U+021D5 </td> <tr><td> <code title="">DoubleVerticalBar;</code> </td> <td> U+02225 </td> <tr><td> <code title="">DownArrow;</code> </td> <td> U+02193 </td> <tr><td> <code title="">DownArrowBar;</code> </td> <td> U+02913 </td> <tr><td> <code title="">DownArrowUpArrow;</code> </td> <td> U+021F5 </td> <tr><td> <code title="">DownBreve;</code> </td> <td> U+00311 </td> <tr><td> <code title="">DownLeftRightVector;</code> </td> <td> U+02950 </td> <tr><td> <code title="">DownLeftTeeVector;</code> </td> <td> U+0295E </td> <tr><td> <code title="">DownLeftVector;</code> </td> <td> U+021BD </td> <tr><td> <code title="">DownLeftVectorBar;</code> </td> <td> U+02956 </td> <tr><td> <code title="">DownRightTeeVector;</code> </td> <td> U+0295F </td> <tr><td> <code title="">DownRightVector;</code> </td> <td> U+021C1 </td> <tr><td> <code title="">DownRightVectorBar;</code> </td> <td> U+02957 </td> <tr><td> <code title="">DownTee;</code> </td> <td> U+022A4 </td> <tr><td> <code title="">DownTeeArrow;</code> </td> <td> U+021A7 </td> <tr><td> <code title="">Downarrow;</code> </td> <td> U+021D3 </td> <tr><td> <code title="">Dscr;</code> </td> <td> U+1D49F </td> <tr><td> <code title="">Dstrok;</code> </td> <td> U+00110 </td> <tr><td> <code title="">ENG;</code> </td> <td> U+0014A </td> <tr><td> <code title="">ETH;</code> </td> <td> U+000D0 </td> <tr><td> <code title="">ETH</code> </td> <td> U+000D0 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Eacute;</code> </td> <td> U+000C9 </td> <tr><td> <code title="">Eacute</code> </td> <td> U+000C9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ecaron;</code> </td> <td> U+0011A </td> <tr><td> <code title="">Ecirc;</code> </td> <td> U+000CA </td> <tr><td> <code title="">Ecirc</code> </td> <td> U+000CA </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ecy;</code> </td> <td> U+0042D </td> <tr><td> <code title="">Edot;</code> </td> <td> U+00116 </td> <tr><td> <code title="">Efr;</code> </td> <td> U+1D508 </td> <tr><td> <code title="">Egrave;</code> </td> <td> U+000C8 </td> <tr><td> <code title="">Egrave</code> </td> <td> U+000C8 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Element;</code> </td> <td> U+02208 </td> <tr><td> <code title="">Emacr;</code> </td> <td> U+00112 </td> <tr><td> <code title="">EmptySmallSquare;</code> </td> <td> U+025FB </td> <tr><td> <code title="">EmptyVerySmallSquare;</code> </td> <td> U+025AB </td> <tr><td> <code title="">Eogon;</code> </td> <td> U+00118 </td> <tr><td> <code title="">Eopf;</code> </td> <td> U+1D53C </td> <tr><td> <code title="">Epsilon;</code> </td> <td> U+00395 </td> <tr><td> <code title="">Equal;</code> </td> <td> U+02A75 </td> <tr><td> <code title="">EqualTilde;</code> </td> <td> U+02242 </td> <tr><td> <code title="">Equilibrium;</code> </td> <td> U+021CC </td> <tr><td> <code title="">Escr;</code> </td> <td> U+02130 </td> <tr><td> <code title="">Esim;</code> </td> <td> U+02A73 </td> <tr><td> <code title="">Eta;</code> </td> <td> U+00397 </td> <tr><td> <code title="">Euml;</code> </td> <td> U+000CB </td> <tr><td> <code title="">Euml</code> </td> <td> U+000CB </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Exists;</code> </td> <td> U+02203 </td> <tr><td> <code title="">ExponentialE;</code> </td> <td> U+02147 </td> <tr><td> <code title="">Fcy;</code> </td> <td> U+00424 </td> <tr><td> <code title="">Ffr;</code> </td> <td> U+1D509 </td> <tr><td> <code title="">FilledSmallSquare;</code> </td> <td> U+025FC </td> <tr><td> <code title="">FilledVerySmallSquare;</code> </td> <td> U+025AA </td> <tr><td> <code title="">Fopf;</code> </td> <td> U+1D53D </td> <tr><td> <code title="">ForAll;</code> </td> <td> U+02200 </td> <tr><td> <code title="">Fouriertrf;</code> </td> <td> U+02131 </td> <tr><td> <code title="">Fscr;</code> </td> <td> U+02131 </td> <tr><td> <code title="">GJcy;</code> </td> <td> U+00403 </td> <tr><td> <code title="">GT;</code> </td> <td> U+0003E </td> <tr><td> <code title="">GT</code> </td> <td> U+0003E </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Gamma;</code> </td> <td> U+00393 </td> <tr><td> <code title="">Gammad;</code> </td> <td> U+003DC </td> <tr><td> <code title="">Gbreve;</code> </td> <td> U+0011E </td> <tr><td> <code title="">Gcedil;</code> </td> <td> U+00122 </td> <tr><td> <code title="">Gcirc;</code> </td> <td> U+0011C </td> <tr><td> <code title="">Gcy;</code> </td> <td> U+00413 </td> <tr><td> <code title="">Gdot;</code> </td> <td> U+00120 </td> <tr><td> <code title="">Gfr;</code> </td> <td> U+1D50A </td> <tr><td> <code title="">Gg;</code> </td> <td> U+022D9 </td> <tr><td> <code title="">Gopf;</code> </td> <td> U+1D53E </td> <tr><td> <code title="">GreaterEqual;</code> </td> <td> U+02265 </td> <tr><td> <code title="">GreaterEqualLess;</code> </td> <td> U+022DB </td> <tr><td> <code title="">GreaterFullEqual;</code> </td> <td> U+02267 </td> <tr><td> <code title="">GreaterGreater;</code> </td> <td> U+02AA2 </td> <tr><td> <code title="">GreaterLess;</code> </td> <td> U+02277 </td> <tr><td> <code title="">GreaterSlantEqual;</code> </td> <td> U+02A7E </td> <tr><td> <code title="">GreaterTilde;</code> </td> <td> U+02273 </td> <tr><td> <code title="">Gscr;</code> </td> <td> U+1D4A2 </td> <tr><td> <code title="">Gt;</code> </td> <td> U+0226B </td> <tr><td> <code title="">HARDcy;</code> </td> <td> U+0042A </td> <tr><td> <code title="">Hacek;</code> </td> <td> U+002C7 </td> <tr><td> <code title="">Hat;</code> </td> <td> U+0005E </td> <tr><td> <code title="">Hcirc;</code> </td> <td> U+00124 </td> <tr><td> <code title="">Hfr;</code> </td> <td> U+0210C </td> <tr><td> <code title="">HilbertSpace;</code> </td> <td> U+0210B </td> <tr><td> <code title="">Hopf;</code> </td> <td> U+0210D </td> <tr><td> <code title="">HorizontalLine;</code> </td> <td> U+02500 </td> <tr><td> <code title="">Hscr;</code> </td> <td> U+0210B </td> <tr><td> <code title="">Hstrok;</code> </td> <td> U+00126 </td> <tr><td> <code title="">HumpDownHump;</code> </td> <td> U+0224E </td> <tr><td> <code title="">HumpEqual;</code> </td> <td> U+0224F </td> <tr><td> <code title="">IEcy;</code> </td> <td> U+00415 </td> <tr><td> <code title="">IJlig;</code> </td> <td> U+00132 </td> <tr><td> <code title="">IOcy;</code> </td> <td> U+00401 </td> <tr><td> <code title="">Iacute;</code> </td> <td> U+000CD </td> <tr><td> <code title="">Iacute</code> </td> <td> U+000CD </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Icirc;</code> </td> <td> U+000CE </td> <tr><td> <code title="">Icirc</code> </td> <td> U+000CE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Icy;</code> </td> <td> U+00418 </td> <tr><td> <code title="">Idot;</code> </td> <td> U+00130 </td> <tr><td> <code title="">Ifr;</code> </td> <td> U+02111 </td> <tr><td> <code title="">Igrave;</code> </td> <td> U+000CC </td> <tr><td> <code title="">Igrave</code> </td> <td> U+000CC </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Im;</code> </td> <td> U+02111 </td> <tr><td> <code title="">Imacr;</code> </td> <td> U+0012A </td> <tr><td> <code title="">ImaginaryI;</code> </td> <td> U+02148 </td> <tr><td> <code title="">Implies;</code> </td> <td> U+021D2 </td> <tr><td> <code title="">Int;</code> </td> <td> U+0222C </td> <tr><td> <code title="">Integral;</code> </td> <td> U+0222B </td> <tr><td> <code title="">Intersection;</code> </td> <td> U+022C2 </td> <tr><td> <code title="">InvisibleComma;</code> </td> <td> U+02063 </td> <tr><td> <code title="">InvisibleTimes;</code> </td> <td> U+02062 </td> <tr><td> <code title="">Iogon;</code> </td> <td> U+0012E </td> <tr><td> <code title="">Iopf;</code> </td> <td> U+1D540 </td> <tr><td> <code title="">Iota;</code> </td> <td> U+00399 </td> <tr><td> <code title="">Iscr;</code> </td> <td> U+02110 </td> <tr><td> <code title="">Itilde;</code> </td> <td> U+00128 </td> <tr><td> <code title="">Iukcy;</code> </td> <td> U+00406 </td> <tr><td> <code title="">Iuml;</code> </td> <td> U+000CF </td> <tr><td> <code title="">Iuml</code> </td> <td> U+000CF </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Jcirc;</code> </td> <td> U+00134 </td> <tr><td> <code title="">Jcy;</code> </td> <td> U+00419 </td> <tr><td> <code title="">Jfr;</code> </td> <td> U+1D50D </td> <tr><td> <code title="">Jopf;</code> </td> <td> U+1D541 </td> <tr><td> <code title="">Jscr;</code> </td> <td> U+1D4A5 </td> <tr><td> <code title="">Jsercy;</code> </td> <td> U+00408 </td> <tr><td> <code title="">Jukcy;</code> </td> <td> U+00404 </td> <tr><td> <code title="">KHcy;</code> </td> <td> U+00425 </td> <tr><td> <code title="">KJcy;</code> </td> <td> U+0040C </td> <tr><td> <code title="">Kappa;</code> </td> <td> U+0039A </td> <tr><td> <code title="">Kcedil;</code> </td> <td> U+00136 </td> <tr><td> <code title="">Kcy;</code> </td> <td> U+0041A </td> <tr><td> <code title="">Kfr;</code> </td> <td> U+1D50E </td> <tr><td> <code title="">Kopf;</code> </td> <td> U+1D542 </td> <tr><td> <code title="">Kscr;</code> </td> <td> U+1D4A6 </td> <tr><td> <code title="">LJcy;</code> </td> <td> U+00409 </td> <tr><td> <code title="">LT;</code> </td> <td> U+0003C </td> <tr><td> <code title="">LT</code> </td> <td> U+0003C </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Lacute;</code> </td> <td> U+00139 </td> <tr><td> <code title="">Lambda;</code> </td> <td> U+0039B </td> <tr><td> <code title="">Lang;</code> </td> <td> U+027EA </td> <tr><td> <code title="">Laplacetrf;</code> </td> <td> U+02112 </td> <tr><td> <code title="">Larr;</code> </td> <td> U+0219E </td> <tr><td> <code title="">Lcaron;</code> </td> <td> U+0013D </td> <tr><td> <code title="">Lcedil;</code> </td> <td> U+0013B </td> <tr><td> <code title="">Lcy;</code> </td> <td> U+0041B </td> <tr><td> <code title="">LeftAngleBracket;</code> </td> <td> U+027E8 </td> <tr><td> <code title="">LeftArrow;</code> </td> <td> U+02190 </td> <tr><td> <code title="">LeftArrowBar;</code> </td> <td> U+021E4 </td> <tr><td> <code title="">LeftArrowRightArrow;</code> </td> <td> U+021C6 </td> <tr><td> <code title="">LeftCeiling;</code> </td> <td> U+02308 </td> <tr><td> <code title="">LeftDoubleBracket;</code> </td> <td> U+027E6 </td> <tr><td> <code title="">LeftDownTeeVector;</code> </td> <td> U+02961 </td> <tr><td> <code title="">LeftDownVector;</code> </td> <td> U+021C3 </td> <tr><td> <code title="">LeftDownVectorBar;</code> </td> <td> U+02959 </td> <tr><td> <code title="">LeftFloor;</code> </td> <td> U+0230A </td> <tr><td> <code title="">LeftRightArrow;</code> </td> <td> U+02194 </td> <tr><td> <code title="">LeftRightVector;</code> </td> <td> U+0294E </td> <tr><td> <code title="">LeftTee;</code> </td> <td> U+022A3 </td> <tr><td> <code title="">LeftTeeArrow;</code> </td> <td> U+021A4 </td> <tr><td> <code title="">LeftTeeVector;</code> </td> <td> U+0295A </td> <tr><td> <code title="">LeftTriangle;</code> </td> <td> U+022B2 </td> <tr><td> <code title="">LeftTriangleBar;</code> </td> <td> U+029CF </td> <tr><td> <code title="">LeftTriangleEqual;</code> </td> <td> U+022B4 </td> <tr><td> <code title="">LeftUpDownVector;</code> </td> <td> U+02951 </td> <tr><td> <code title="">LeftUpTeeVector;</code> </td> <td> U+02960 </td> <tr><td> <code title="">LeftUpVector;</code> </td> <td> U+021BF </td> <tr><td> <code title="">LeftUpVectorBar;</code> </td> <td> U+02958 </td> <tr><td> <code title="">LeftVector;</code> </td> <td> U+021BC </td> <tr><td> <code title="">LeftVectorBar;</code> </td> <td> U+02952 </td> <tr><td> <code title="">Leftarrow;</code> </td> <td> U+021D0 </td> <tr><td> <code title="">Leftrightarrow;</code> </td> <td> U+021D4 </td> <tr><td> <code title="">LessEqualGreater;</code> </td> <td> U+022DA </td> <tr><td> <code title="">LessFullEqual;</code> </td> <td> U+02266 </td> <tr><td> <code title="">LessGreater;</code> </td> <td> U+02276 </td> <tr><td> <code title="">LessLess;</code> </td> <td> U+02AA1 </td> <tr><td> <code title="">LessSlantEqual;</code> </td> <td> U+02A7D </td> <tr><td> <code title="">LessTilde;</code> </td> <td> U+02272 </td> <tr><td> <code title="">Lfr;</code> </td> <td> U+1D50F </td> <tr><td> <code title="">Ll;</code> </td> <td> U+022D8 </td> <tr><td> <code title="">Lleftarrow;</code> </td> <td> U+021DA </td> <tr><td> <code title="">Lmidot;</code> </td> <td> U+0013F </td> <tr><td> <code title="">LongLeftArrow;</code> </td> <td> U+027F5 </td> <tr><td> <code title="">LongLeftRightArrow;</code> </td> <td> U+027F7 </td> <tr><td> <code title="">LongRightArrow;</code> </td> <td> U+027F6 </td> <tr><td> <code title="">Longleftarrow;</code> </td> <td> U+027F8 </td> <tr><td> <code title="">Longleftrightarrow;</code> </td> <td> U+027FA </td> <tr><td> <code title="">Longrightarrow;</code> </td> <td> U+027F9 </td> <tr><td> <code title="">Lopf;</code> </td> <td> U+1D543 </td> <tr><td> <code title="">LowerLeftArrow;</code> </td> <td> U+02199 </td> <tr><td> <code title="">LowerRightArrow;</code> </td> <td> U+02198 </td> <tr><td> <code title="">Lscr;</code> </td> <td> U+02112 </td> <tr><td> <code title="">Lsh;</code> </td> <td> U+021B0 </td> <tr><td> <code title="">Lstrok;</code> </td> <td> U+00141 </td> <tr><td> <code title="">Lt;</code> </td> <td> U+0226A </td> <tr><td> <code title="">Map;</code> </td> <td> U+02905 </td> <tr><td> <code title="">Mcy;</code> </td> <td> U+0041C </td> <tr><td> <code title="">MediumSpace;</code> </td> <td> U+0205F </td> <tr><td> <code title="">Mellintrf;</code> </td> <td> U+02133 </td> <tr><td> <code title="">Mfr;</code> </td> <td> U+1D510 </td> <tr><td> <code title="">MinusPlus;</code> </td> <td> U+02213 </td> <tr><td> <code title="">Mopf;</code> </td> <td> U+1D544 </td> <tr><td> <code title="">Mscr;</code> </td> <td> U+02133 </td> <tr><td> <code title="">Mu;</code> </td> <td> U+0039C </td> <tr><td> <code title="">NJcy;</code> </td> <td> U+0040A </td> <tr><td> <code title="">Nacute;</code> </td> <td> U+00143 </td> <tr><td> <code title="">Ncaron;</code> </td> <td> U+00147 </td> <tr><td> <code title="">Ncedil;</code> </td> <td> U+00145 </td> <tr><td> <code title="">Ncy;</code> </td> <td> U+0041D </td> <tr><td> <code title="">NegativeMediumSpace;</code> </td> <td> U+0200B </td> <tr><td> <code title="">NegativeThickSpace;</code> </td> <td> U+0200B </td> <tr><td> <code title="">NegativeThinSpace;</code> </td> <td> U+0200B </td> <tr><td> <code title="">NegativeVeryThinSpace;</code> </td> <td> U+0200B </td> <tr><td> <code title="">NestedGreaterGreater;</code> </td> <td> U+0226B </td> <tr><td> <code title="">NestedLessLess;</code> </td> <td> U+0226A </td> <tr><td> <code title="">NewLine;</code> </td> <td> U+0000A </td> <tr><td> <code title="">Nfr;</code> </td> <td> U+1D511 </td> <tr><td> <code title="">NoBreak;</code> </td> <td> U+02060 </td> <tr><td> <code title="">NonBreakingSpace;</code> </td> <td> U+000A0 </td> <tr><td> <code title="">Nopf;</code> </td> <td> U+02115 </td> <tr><td> <code title="">Not;</code> </td> <td> U+02AEC </td> <tr><td> <code title="">NotCongruent;</code> </td> <td> U+02262 </td> <tr><td> <code title="">NotCupCap;</code> </td> <td> U+0226D </td> <tr><td> <code title="">NotDoubleVerticalBar;</code> </td> <td> U+02226 </td> <tr><td> <code title="">NotElement;</code> </td> <td> U+02209 </td> <tr><td> <code title="">NotEqual;</code> </td> <td> U+02260 </td> <tr><td> <code title="">NotExists;</code> </td> <td> U+02204 </td> <tr><td> <code title="">NotGreater;</code> </td> <td> U+0226F </td> <tr><td> <code title="">NotGreaterEqual;</code> </td> <td> U+02271 </td> <tr><td> <code title="">NotGreaterLess;</code> </td> <td> U+02279 </td> <tr><td> <code title="">NotGreaterTilde;</code> </td> <td> U+02275 </td> <tr><td> <code title="">NotLeftTriangle;</code> </td> <td> U+022EA </td> <tr><td> <code title="">NotLeftTriangleEqual;</code> </td> <td> U+022EC </td> <tr><td> <code title="">NotLess;</code> </td> <td> U+0226E </td> <tr><td> <code title="">NotLessEqual;</code> </td> <td> U+02270 </td> <tr><td> <code title="">NotLessGreater;</code> </td> <td> U+02278 </td> <tr><td> <code title="">NotLessTilde;</code> </td> <td> U+02274 </td> <tr><td> <code title="">NotPrecedes;</code> </td> <td> U+02280 </td> <tr><td> <code title="">NotPrecedesSlantEqual;</code> </td> <td> U+022E0 </td> <tr><td> <code title="">NotReverseElement;</code> </td> <td> U+0220C </td> <tr><td> <code title="">NotRightTriangle;</code> </td> <td> U+022EB </td> <tr><td> <code title="">NotRightTriangleEqual;</code> </td> <td> U+022ED </td> <tr><td> <code title="">NotSquareSubsetEqual;</code> </td> <td> U+022E2 </td> <tr><td> <code title="">NotSquareSupersetEqual;</code> </td> <td> U+022E3 </td> <tr><td> <code title="">NotSubsetEqual;</code> </td> <td> U+02288 </td> <tr><td> <code title="">NotSucceeds;</code> </td> <td> U+02281 </td> <tr><td> <code title="">NotSucceedsSlantEqual;</code> </td> <td> U+022E1 </td> <tr><td> <code title="">NotSupersetEqual;</code> </td> <td> U+02289 </td> <tr><td> <code title="">NotTilde;</code> </td> <td> U+02241 </td> <tr><td> <code title="">NotTildeEqual;</code> </td> <td> U+02244 </td> <tr><td> <code title="">NotTildeFullEqual;</code> </td> <td> U+02247 </td> <tr><td> <code title="">NotTildeTilde;</code> </td> <td> U+02249 </td> <tr><td> <code title="">NotVerticalBar;</code> </td> <td> U+02224 </td> <tr><td> <code title="">Nscr;</code> </td> <td> U+1D4A9 </td> <tr><td> <code title="">Ntilde;</code> </td> <td> U+000D1 </td> <tr><td> <code title="">Ntilde</code> </td> <td> U+000D1 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Nu;</code> </td> <td> U+0039D </td> <tr><td> <code title="">OElig;</code> </td> <td> U+00152 </td> <tr><td> <code title="">Oacute;</code> </td> <td> U+000D3 </td> <tr><td> <code title="">Oacute</code> </td> <td> U+000D3 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ocirc;</code> </td> <td> U+000D4 </td> <tr><td> <code title="">Ocirc</code> </td> <td> U+000D4 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ocy;</code> </td> <td> U+0041E </td> <tr><td> <code title="">Odblac;</code> </td> <td> U+00150 </td> <tr><td> <code title="">Ofr;</code> </td> <td> U+1D512 </td> <tr><td> <code title="">Ograve;</code> </td> <td> U+000D2 </td> <tr><td> <code title="">Ograve</code> </td> <td> U+000D2 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Omacr;</code> </td> <td> U+0014C </td> <tr><td> <code title="">Omega;</code> </td> <td> U+003A9 </td> <tr><td> <code title="">Omicron;</code> </td> <td> U+0039F </td> <tr><td> <code title="">Oopf;</code> </td> <td> U+1D546 </td> <tr><td> <code title="">OpenCurlyDoubleQuote;</code> </td> <td> U+0201C </td> <tr><td> <code title="">OpenCurlyQuote;</code> </td> <td> U+02018 </td> <tr><td> <code title="">Or;</code> </td> <td> U+02A54 </td> <tr><td> <code title="">Oscr;</code> </td> <td> U+1D4AA </td> <tr><td> <code title="">Oslash;</code> </td> <td> U+000D8 </td> <tr><td> <code title="">Oslash</code> </td> <td> U+000D8 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Otilde;</code> </td> <td> U+000D5 </td> <tr><td> <code title="">Otilde</code> </td> <td> U+000D5 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Otimes;</code> </td> <td> U+02A37 </td> <tr><td> <code title="">Ouml;</code> </td> <td> U+000D6 </td> <tr><td> <code title="">Ouml</code> </td> <td> U+000D6 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">OverBar;</code> </td> <td> U+0203E </td> <tr><td> <code title="">OverBrace;</code> </td> <td> U+023DE </td> <tr><td> <code title="">OverBracket;</code> </td> <td> U+023B4 </td> <tr><td> <code title="">OverParenthesis;</code> </td> <td> U+023DC </td> <tr><td> <code title="">PartialD;</code> </td> <td> U+02202 </td> <tr><td> <code title="">Pcy;</code> </td> <td> U+0041F </td> <tr><td> <code title="">Pfr;</code> </td> <td> U+1D513 </td> <tr><td> <code title="">Phi;</code> </td> <td> U+003A6 </td> <tr><td> <code title="">Pi;</code> </td> <td> U+003A0 </td> <tr><td> <code title="">PlusMinus;</code> </td> <td> U+000B1 </td> <tr><td> <code title="">Poincareplane;</code> </td> <td> U+0210C </td> <tr><td> <code title="">Popf;</code> </td> <td> U+02119 </td> <tr><td> <code title="">Pr;</code> </td> <td> U+02ABB </td> <tr><td> <code title="">Precedes;</code> </td> <td> U+0227A </td> <tr><td> <code title="">PrecedesEqual;</code> </td> <td> U+02AAF </td> <tr><td> <code title="">PrecedesSlantEqual;</code> </td> <td> U+0227C </td> <tr><td> <code title="">PrecedesTilde;</code> </td> <td> U+0227E </td> <tr><td> <code title="">Prime;</code> </td> <td> U+02033 </td> <tr><td> <code title="">Product;</code> </td> <td> U+0220F </td> <tr><td> <code title="">Proportion;</code> </td> <td> U+02237 </td> <tr><td> <code title="">Proportional;</code> </td> <td> U+0221D </td> <tr><td> <code title="">Pscr;</code> </td> <td> U+1D4AB </td> <tr><td> <code title="">Psi;</code> </td> <td> U+003A8 </td> <tr><td> <code title="">QUOT;</code> </td> <td> U+00022 </td> <tr><td> <code title="">QUOT</code> </td> <td> U+00022 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Qfr;</code> </td> <td> U+1D514 </td> <tr><td> <code title="">Qopf;</code> </td> <td> U+0211A </td> <tr><td> <code title="">Qscr;</code> </td> <td> U+1D4AC </td> <tr><td> <code title="">RBarr;</code> </td> <td> U+02910 </td> <tr><td> <code title="">REG;</code> </td> <td> U+000AE </td> <tr><td> <code title="">REG</code> </td> <td> U+000AE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Racute;</code> </td> <td> U+00154 </td> <tr><td> <code title="">Rang;</code> </td> <td> U+027EB </td> <tr><td> <code title="">Rarr;</code> </td> <td> U+021A0 </td> <tr><td> <code title="">Rarrtl;</code> </td> <td> U+02916 </td> <tr><td> <code title="">Rcaron;</code> </td> <td> U+00158 </td> <tr><td> <code title="">Rcedil;</code> </td> <td> U+00156 </td> <tr><td> <code title="">Rcy;</code> </td> <td> U+00420 </td> <tr><td> <code title="">Re;</code> </td> <td> U+0211C </td> <tr><td> <code title="">ReverseElement;</code> </td> <td> U+0220B </td> <tr><td> <code title="">ReverseEquilibrium;</code> </td> <td> U+021CB </td> <tr><td> <code title="">ReverseUpEquilibrium;</code> </td> <td> U+0296F </td> <tr><td> <code title="">Rfr;</code> </td> <td> U+0211C </td> <tr><td> <code title="">Rho;</code> </td> <td> U+003A1 </td> <tr><td> <code title="">RightAngleBracket;</code> </td> <td> U+027E9 </td> <tr><td> <code title="">RightArrow;</code> </td> <td> U+02192 </td> <tr><td> <code title="">RightArrowBar;</code> </td> <td> U+021E5 </td> <tr><td> <code title="">RightArrowLeftArrow;</code> </td> <td> U+021C4 </td> <tr><td> <code title="">RightCeiling;</code> </td> <td> U+02309 </td> <tr><td> <code title="">RightDoubleBracket;</code> </td> <td> U+027E7 </td> <tr><td> <code title="">RightDownTeeVector;</code> </td> <td> U+0295D </td> <tr><td> <code title="">RightDownVector;</code> </td> <td> U+021C2 </td> <tr><td> <code title="">RightDownVectorBar;</code> </td> <td> U+02955 </td> <tr><td> <code title="">RightFloor;</code> </td> <td> U+0230B </td> <tr><td> <code title="">RightTee;</code> </td> <td> U+022A2 </td> <tr><td> <code title="">RightTeeArrow;</code> </td> <td> U+021A6 </td> <tr><td> <code title="">RightTeeVector;</code> </td> <td> U+0295B </td> <tr><td> <code title="">RightTriangle;</code> </td> <td> U+022B3 </td> <tr><td> <code title="">RightTriangleBar;</code> </td> <td> U+029D0 </td> <tr><td> <code title="">RightTriangleEqual;</code> </td> <td> U+022B5 </td> <tr><td> <code title="">RightUpDownVector;</code> </td> <td> U+0294F </td> <tr><td> <code title="">RightUpTeeVector;</code> </td> <td> U+0295C </td> <tr><td> <code title="">RightUpVector;</code> </td> <td> U+021BE </td> <tr><td> <code title="">RightUpVectorBar;</code> </td> <td> U+02954 </td> <tr><td> <code title="">RightVector;</code> </td> <td> U+021C0 </td> <tr><td> <code title="">RightVectorBar;</code> </td> <td> U+02953 </td> <tr><td> <code title="">Rightarrow;</code> </td> <td> U+021D2 </td> <tr><td> <code title="">Ropf;</code> </td> <td> U+0211D </td> <tr><td> <code title="">RoundImplies;</code> </td> <td> U+02970 </td> <tr><td> <code title="">Rrightarrow;</code> </td> <td> U+021DB </td> <tr><td> <code title="">Rscr;</code> </td> <td> U+0211B </td> <tr><td> <code title="">Rsh;</code> </td> <td> U+021B1 </td> <tr><td> <code title="">RuleDelayed;</code> </td> <td> U+029F4 </td> <tr><td> <code title="">SHCHcy;</code> </td> <td> U+00429 </td> <tr><td> <code title="">SHcy;</code> </td> <td> U+00428 </td> <tr><td> <code title="">SOFTcy;</code> </td> <td> U+0042C </td> <tr><td> <code title="">Sacute;</code> </td> <td> U+0015A </td> <tr><td> <code title="">Sc;</code> </td> <td> U+02ABC </td> <tr><td> <code title="">Scaron;</code> </td> <td> U+00160 </td> <tr><td> <code title="">Scedil;</code> </td> <td> U+0015E </td> <tr><td> <code title="">Scirc;</code> </td> <td> U+0015C </td> <tr><td> <code title="">Scy;</code> </td> <td> U+00421 </td> <tr><td> <code title="">Sfr;</code> </td> <td> U+1D516 </td> <tr><td> <code title="">ShortDownArrow;</code> </td> <td> U+02193 </td> <tr><td> <code title="">ShortLeftArrow;</code> </td> <td> U+02190 </td> <tr><td> <code title="">ShortRightArrow;</code> </td> <td> U+02192 </td> <tr><td> <code title="">ShortUpArrow;</code> </td> <td> U+02191 </td> <tr><td> <code title="">Sigma;</code> </td> <td> U+003A3 </td> <tr><td> <code title="">SmallCircle;</code> </td> <td> U+02218 </td> <tr><td> <code title="">Sopf;</code> </td> <td> U+1D54A </td> <tr><td> <code title="">Sqrt;</code> </td> <td> U+0221A </td> <tr><td> <code title="">Square;</code> </td> <td> U+025A1 </td> <tr><td> <code title="">SquareIntersection;</code> </td> <td> U+02293 </td> <tr><td> <code title="">SquareSubset;</code> </td> <td> U+0228F </td> <tr><td> <code title="">SquareSubsetEqual;</code> </td> <td> U+02291 </td> <tr><td> <code title="">SquareSuperset;</code> </td> <td> U+02290 </td> <tr><td> <code title="">SquareSupersetEqual;</code> </td> <td> U+02292 </td> <tr><td> <code title="">SquareUnion;</code> </td> <td> U+02294 </td> <tr><td> <code title="">Sscr;</code> </td> <td> U+1D4AE </td> <tr><td> <code title="">Star;</code> </td> <td> U+022C6 </td> <tr><td> <code title="">Sub;</code> </td> <td> U+022D0 </td> <tr><td> <code title="">Subset;</code> </td> <td> U+022D0 </td> <tr><td> <code title="">SubsetEqual;</code> </td> <td> U+02286 </td> <tr><td> <code title="">Succeeds;</code> </td> <td> U+0227B </td> <tr><td> <code title="">SucceedsEqual;</code> </td> <td> U+02AB0 </td> <tr><td> <code title="">SucceedsSlantEqual;</code> </td> <td> U+0227D </td> <tr><td> <code title="">SucceedsTilde;</code> </td> <td> U+0227F </td> <tr><td> <code title="">SuchThat;</code> </td> <td> U+0220B </td> <tr><td> <code title="">Sum;</code> </td> <td> U+02211 </td> <tr><td> <code title="">Sup;</code> </td> <td> U+022D1 </td> <tr><td> <code title="">Superset;</code> </td> <td> U+02283 </td> <tr><td> <code title="">SupersetEqual;</code> </td> <td> U+02287 </td> <tr><td> <code title="">Supset;</code> </td> <td> U+022D1 </td> <tr><td> <code title="">THORN;</code> </td> <td> U+000DE </td> <tr><td> <code title="">THORN</code> </td> <td> U+000DE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">TRADE;</code> </td> <td> U+02122 </td> <tr><td> <code title="">TSHcy;</code> </td> <td> U+0040B </td> <tr><td> <code title="">TScy;</code> </td> <td> U+00426 </td> <tr><td> <code title="">Tab;</code> </td> <td> U+00009 </td> <tr><td> <code title="">Tau;</code> </td> <td> U+003A4 </td> <tr><td> <code title="">Tcaron;</code> </td> <td> U+00164 </td> <tr><td> <code title="">Tcedil;</code> </td> <td> U+00162 </td> <tr><td> <code title="">Tcy;</code> </td> <td> U+00422 </td> <tr><td> <code title="">Tfr;</code> </td> <td> U+1D517 </td> <tr><td> <code title="">Therefore;</code> </td> <td> U+02234 </td> <tr><td> <code title="">Theta;</code> </td> <td> U+00398 </td> <tr><td> <code title="">ThinSpace;</code> </td> <td> U+02009 </td> <tr><td> <code title="">Tilde;</code> </td> <td> U+0223C </td> <tr><td> <code title="">TildeEqual;</code> </td> <td> U+02243 </td> <tr><td> <code title="">TildeFullEqual;</code> </td> <td> U+02245 </td> <tr><td> <code title="">TildeTilde;</code> </td> <td> U+02248 </td> <tr><td> <code title="">Topf;</code> </td> <td> U+1D54B </td> <tr><td> <code title="">TripleDot;</code> </td> <td> U+020DB </td> <tr><td> <code title="">Tscr;</code> </td> <td> U+1D4AF </td> <tr><td> <code title="">Tstrok;</code> </td> <td> U+00166 </td> <tr><td> <code title="">Uacute;</code> </td> <td> U+000DA </td> <tr><td> <code title="">Uacute</code> </td> <td> U+000DA </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Uarr;</code> </td> <td> U+0219F </td> <tr><td> <code title="">Uarrocir;</code> </td> <td> U+02949 </td> <tr><td> <code title="">Ubrcy;</code> </td> <td> U+0040E </td> <tr><td> <code title="">Ubreve;</code> </td> <td> U+0016C </td> <tr><td> <code title="">Ucirc;</code> </td> <td> U+000DB </td> <tr><td> <code title="">Ucirc</code> </td> <td> U+000DB </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ucy;</code> </td> <td> U+00423 </td> <tr><td> <code title="">Udblac;</code> </td> <td> U+00170 </td> <tr><td> <code title="">Ufr;</code> </td> <td> U+1D518 </td> <tr><td> <code title="">Ugrave;</code> </td> <td> U+000D9 </td> <tr><td> <code title="">Ugrave</code> </td> <td> U+000D9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Umacr;</code> </td> <td> U+0016A </td> <tr><td> <code title="">UnderBar;</code> </td> <td> U+0005F </td> <tr><td> <code title="">UnderBrace;</code> </td> <td> U+023DF </td> <tr><td> <code title="">UnderBracket;</code> </td> <td> U+023B5 </td> <tr><td> <code title="">UnderParenthesis;</code> </td> <td> U+023DD </td> <tr><td> <code title="">Union;</code> </td> <td> U+022C3 </td> <tr><td> <code title="">UnionPlus;</code> </td> <td> U+0228E </td> <tr><td> <code title="">Uogon;</code> </td> <td> U+00172 </td> <tr><td> <code title="">Uopf;</code> </td> <td> U+1D54C </td> <tr><td> <code title="">UpArrow;</code> </td> <td> U+02191 </td> <tr><td> <code title="">UpArrowBar;</code> </td> <td> U+02912 </td> <tr><td> <code title="">UpArrowDownArrow;</code> </td> <td> U+021C5 </td> <tr><td> <code title="">UpDownArrow;</code> </td> <td> U+02195 </td> <tr><td> <code title="">UpEquilibrium;</code> </td> <td> U+0296E </td> <tr><td> <code title="">UpTee;</code> </td> <td> U+022A5 </td> <tr><td> <code title="">UpTeeArrow;</code> </td> <td> U+021A5 </td> <tr><td> <code title="">Uparrow;</code> </td> <td> U+021D1 </td> <tr><td> <code title="">Updownarrow;</code> </td> <td> U+021D5 </td> <tr><td> <code title="">UpperLeftArrow;</code> </td> <td> U+02196 </td> <tr><td> <code title="">UpperRightArrow;</code> </td> <td> U+02197 </td> <tr><td> <code title="">Upsi;</code> </td> <td> U+003D2 </td> <tr><td> <code title="">Upsilon;</code> </td> <td> U+003A5 </td> <tr><td> <code title="">Uring;</code> </td> <td> U+0016E </td> <tr><td> <code title="">Uscr;</code> </td> <td> U+1D4B0 </td> <tr><td> <code title="">Utilde;</code> </td> <td> U+00168 </td> <tr><td> <code title="">Uuml;</code> </td> <td> U+000DC </td> <tr><td> <code title="">Uuml</code> </td> <td> U+000DC </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">VDash;</code> </td> <td> U+022AB </td> <tr><td> <code title="">Vbar;</code> </td> <td> U+02AEB </td> <tr><td> <code title="">Vcy;</code> </td> <td> U+00412 </td> <tr><td> <code title="">Vdash;</code> </td> <td> U+022A9 </td> <tr><td> <code title="">Vdashl;</code> </td> <td> U+02AE6 </td> <tr><td> <code title="">Vee;</code> </td> <td> U+022C1 </td> <tr><td> <code title="">Verbar;</code> </td> <td> U+02016 </td> <tr><td> <code title="">Vert;</code> </td> <td> U+02016 </td> <tr><td> <code title="">VerticalBar;</code> </td> <td> U+02223 </td> <tr><td> <code title="">VerticalLine;</code> </td> <td> U+0007C </td> <tr><td> <code title="">VerticalSeparator;</code> </td> <td> U+02758 </td> <tr><td> <code title="">VerticalTilde;</code> </td> <td> U+02240 </td> <tr><td> <code title="">VeryThinSpace;</code> </td> <td> U+0200A </td> <tr><td> <code title="">Vfr;</code> </td> <td> U+1D519 </td> <tr><td> <code title="">Vopf;</code> </td> <td> U+1D54D </td> <tr><td> <code title="">Vscr;</code> </td> <td> U+1D4B1 </td> <tr><td> <code title="">Vvdash;</code> </td> <td> U+022AA </td> <tr><td> <code title="">Wcirc;</code> </td> <td> U+00174 </td> <tr><td> <code title="">Wedge;</code> </td> <td> U+022C0 </td> <tr><td> <code title="">Wfr;</code> </td> <td> U+1D51A </td> <tr><td> <code title="">Wopf;</code> </td> <td> U+1D54E </td> <tr><td> <code title="">Wscr;</code> </td> <td> U+1D4B2 </td> <tr><td> <code title="">Xfr;</code> </td> <td> U+1D51B </td> <tr><td> <code title="">Xi;</code> </td> <td> U+0039E </td> <tr><td> <code title="">Xopf;</code> </td> <td> U+1D54F </td> <tr><td> <code title="">Xscr;</code> </td> <td> U+1D4B3 </td> <tr><td> <code title="">YAcy;</code> </td> <td> U+0042F </td> <tr><td> <code title="">YIcy;</code> </td> <td> U+00407 </td> <tr><td> <code title="">YUcy;</code> </td> <td> U+0042E </td> <tr><td> <code title="">Yacute;</code> </td> <td> U+000DD </td> <tr><td> <code title="">Yacute</code> </td> <td> U+000DD </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">Ycirc;</code> </td> <td> U+00176 </td> <tr><td> <code title="">Ycy;</code> </td> <td> U+0042B </td> <tr><td> <code title="">Yfr;</code> </td> <td> U+1D51C </td> <tr><td> <code title="">Yopf;</code> </td> <td> U+1D550 </td> <tr><td> <code title="">Yscr;</code> </td> <td> U+1D4B4 </td> <tr><td> <code title="">Yuml;</code> </td> <td> U+00178 </td> <tr><td> <code title="">ZHcy;</code> </td> <td> U+00416 </td> <tr><td> <code title="">Zacute;</code> </td> <td> U+00179 </td> <tr><td> <code title="">Zcaron;</code> </td> <td> U+0017D </td> <tr><td> <code title="">Zcy;</code> </td> <td> U+00417 </td> <tr><td> <code title="">Zdot;</code> </td> <td> U+0017B </td> <tr><td> <code title="">ZeroWidthSpace;</code> </td> <td> U+0200B </td> <tr><td> <code title="">Zeta;</code> </td> <td> U+00396 </td> <tr><td> <code title="">Zfr;</code> </td> <td> U+02128 </td> <tr><td> <code title="">Zopf;</code> </td> <td> U+02124 </td> <tr><td> <code title="">Zscr;</code> </td> <td> U+1D4B5 </td> <tr><td> <code title="">aacute;</code> </td> <td> U+000E1 </td> <tr><td> <code title="">aacute</code> </td> <td> U+000E1 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">abreve;</code> </td> <td> U+00103 </td> <tr><td> <code title="">ac;</code> </td> <td> U+0223E </td> <tr><td> <code title="">acd;</code> </td> <td> U+0223F </td> <tr><td> <code title="">acirc;</code> </td> <td> U+000E2 </td> <tr><td> <code title="">acirc</code> </td> <td> U+000E2 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">acute;</code> </td> <td> U+000B4 </td> <tr><td> <code title="">acute</code> </td> <td> U+000B4 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">acy;</code> </td> <td> U+00430 </td> <tr><td> <code title="">aelig;</code> </td> <td> U+000E6 </td> <tr><td> <code title="">aelig</code> </td> <td> U+000E6 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">af;</code> </td> <td> U+02061 </td> <tr><td> <code title="">afr;</code> </td> <td> U+1D51E </td> <tr><td> <code title="">agrave;</code> </td> <td> U+000E0 </td> <tr><td> <code title="">agrave</code> </td> <td> U+000E0 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">alefsym;</code> </td> <td> U+02135 </td> <tr><td> <code title="">aleph;</code> </td> <td> U+02135 </td> <tr><td> <code title="">alpha;</code> </td> <td> U+003B1 </td> <tr><td> <code title="">amacr;</code> </td> <td> U+00101 </td> <tr><td> <code title="">amalg;</code> </td> <td> U+02A3F </td> <tr><td> <code title="">amp;</code> </td> <td> U+00026 </td> <tr><td> <code title="">amp</code> </td> <td> U+00026 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">and;</code> </td> <td> U+02227 </td> <tr><td> <code title="">andand;</code> </td> <td> U+02A55 </td> <tr><td> <code title="">andd;</code> </td> <td> U+02A5C </td> <tr><td> <code title="">andslope;</code> </td> <td> U+02A58 </td> <tr><td> <code title="">andv;</code> </td> <td> U+02A5A </td> <tr><td> <code title="">ang;</code> </td> <td> U+02220 </td> <tr><td> <code title="">ange;</code> </td> <td> U+029A4 </td> <tr><td> <code title="">angle;</code> </td> <td> U+02220 </td> <tr><td> <code title="">angmsd;</code> </td> <td> U+02221 </td> <tr><td> <code title="">angmsdaa;</code> </td> <td> U+029A8 </td> <tr><td> <code title="">angmsdab;</code> </td> <td> U+029A9 </td> <tr><td> <code title="">angmsdac;</code> </td> <td> U+029AA </td> <tr><td> <code title="">angmsdad;</code> </td> <td> U+029AB </td> <tr><td> <code title="">angmsdae;</code> </td> <td> U+029AC </td> <tr><td> <code title="">angmsdaf;</code> </td> <td> U+029AD </td> <tr><td> <code title="">angmsdag;</code> </td> <td> U+029AE </td> <tr><td> <code title="">angmsdah;</code> </td> <td> U+029AF </td> <tr><td> <code title="">angrt;</code> </td> <td> U+0221F </td> <tr><td> <code title="">angrtvb;</code> </td> <td> U+022BE </td> <tr><td> <code title="">angrtvbd;</code> </td> <td> U+0299D </td> <tr><td> <code title="">angsph;</code> </td> <td> U+02222 </td> <tr><td> <code title="">angst;</code> </td> <td> U+000C5 </td> <tr><td> <code title="">angzarr;</code> </td> <td> U+0237C </td> <tr><td> <code title="">aogon;</code> </td> <td> U+00105 </td> <tr><td> <code title="">aopf;</code> </td> <td> U+1D552 </td> <tr><td> <code title="">ap;</code> </td> <td> U+02248 </td> <tr><td> <code title="">apE;</code> </td> <td> U+02A70 </td> <tr><td> <code title="">apacir;</code> </td> <td> U+02A6F </td> <tr><td> <code title="">ape;</code> </td> <td> U+0224A </td> <tr><td> <code title="">apid;</code> </td> <td> U+0224B </td> <tr><td> <code title="">apos;</code> </td> <td> U+00027 </td> <tr><td> <code title="">approx;</code> </td> <td> U+02248 </td> <tr><td> <code title="">approxeq;</code> </td> <td> U+0224A </td> <tr><td> <code title="">aring;</code> </td> <td> U+000E5 </td> <tr><td> <code title="">aring</code> </td> <td> U+000E5 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ascr;</code> </td> <td> U+1D4B6 </td> <tr><td> <code title="">ast;</code> </td> <td> U+0002A </td> <tr><td> <code title="">asymp;</code> </td> <td> U+02248 </td> <tr><td> <code title="">asympeq;</code> </td> <td> U+0224D </td> <tr><td> <code title="">atilde;</code> </td> <td> U+000E3 </td> <tr><td> <code title="">atilde</code> </td> <td> U+000E3 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">auml;</code> </td> <td> U+000E4 </td> <tr><td> <code title="">auml</code> </td> <td> U+000E4 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">awconint;</code> </td> <td> U+02233 </td> <tr><td> <code title="">awint;</code> </td> <td> U+02A11 </td> <tr><td> <code title="">bNot;</code> </td> <td> U+02AED </td> <tr><td> <code title="">backcong;</code> </td> <td> U+0224C </td> <tr><td> <code title="">backepsilon;</code> </td> <td> U+003F6 </td> <tr><td> <code title="">backprime;</code> </td> <td> U+02035 </td> <tr><td> <code title="">backsim;</code> </td> <td> U+0223D </td> <tr><td> <code title="">backsimeq;</code> </td> <td> U+022CD </td> <tr><td> <code title="">barvee;</code> </td> <td> U+022BD </td> <tr><td> <code title="">barwed;</code> </td> <td> U+02305 </td> <tr><td> <code title="">barwedge;</code> </td> <td> U+02305 </td> <tr><td> <code title="">bbrk;</code> </td> <td> U+023B5 </td> <tr><td> <code title="">bbrktbrk;</code> </td> <td> U+023B6 </td> <tr><td> <code title="">bcong;</code> </td> <td> U+0224C </td> <tr><td> <code title="">bcy;</code> </td> <td> U+00431 </td> <tr><td> <code title="">bdquo;</code> </td> <td> U+0201E </td> <tr><td> <code title="">becaus;</code> </td> <td> U+02235 </td> <tr><td> <code title="">because;</code> </td> <td> U+02235 </td> <tr><td> <code title="">bemptyv;</code> </td> <td> U+029B0 </td> <tr><td> <code title="">bepsi;</code> </td> <td> U+003F6 </td> <tr><td> <code title="">bernou;</code> </td> <td> U+0212C </td> <tr><td> <code title="">beta;</code> </td> <td> U+003B2 </td> <tr><td> <code title="">beth;</code> </td> <td> U+02136 </td> <tr><td> <code title="">between;</code> </td> <td> U+0226C </td> <tr><td> <code title="">bfr;</code> </td> <td> U+1D51F </td> <tr><td> <code title="">bigcap;</code> </td> <td> U+022C2 </td> <tr><td> <code title="">bigcirc;</code> </td> <td> U+025EF </td> <tr><td> <code title="">bigcup;</code> </td> <td> U+022C3 </td> <tr><td> <code title="">bigodot;</code> </td> <td> U+02A00 </td> <tr><td> <code title="">bigoplus;</code> </td> <td> U+02A01 </td> <tr><td> <code title="">bigotimes;</code> </td> <td> U+02A02 </td> <tr><td> <code title="">bigsqcup;</code> </td> <td> U+02A06 </td> <tr><td> <code title="">bigstar;</code> </td> <td> U+02605 </td> <tr><td> <code title="">bigtriangledown;</code> </td> <td> U+025BD </td> <tr><td> <code title="">bigtriangleup;</code> </td> <td> U+025B3 </td> <tr><td> <code title="">biguplus;</code> </td> <td> U+02A04 </td> <tr><td> <code title="">bigvee;</code> </td> <td> U+022C1 </td> <tr><td> <code title="">bigwedge;</code> </td> <td> U+022C0 </td> <tr><td> <code title="">bkarow;</code> </td> <td> U+0290D </td> <tr><td> <code title="">blacklozenge;</code> </td> <td> U+029EB </td> <tr><td> <code title="">blacksquare;</code> </td> <td> U+025AA </td> <tr><td> <code title="">blacktriangle;</code> </td> <td> U+025B4 </td> <tr><td> <code title="">blacktriangledown;</code> </td> <td> U+025BE </td> <tr><td> <code title="">blacktriangleleft;</code> </td> <td> U+025C2 </td> <tr><td> <code title="">blacktriangleright;</code> </td> <td> U+025B8 </td> <tr><td> <code title="">blank;</code> </td> <td> U+02423 </td> <tr><td> <code title="">blk12;</code> </td> <td> U+02592 </td> <tr><td> <code title="">blk14;</code> </td> <td> U+02591 </td> <tr><td> <code title="">blk34;</code> </td> <td> U+02593 </td> <tr><td> <code title="">block;</code> </td> <td> U+02588 </td> <tr><td> <code title="">bnot;</code> </td> <td> U+02310 </td> <tr><td> <code title="">bopf;</code> </td> <td> U+1D553 </td> <tr><td> <code title="">bot;</code> </td> <td> U+022A5 </td> <tr><td> <code title="">bottom;</code> </td> <td> U+022A5 </td> <tr><td> <code title="">bowtie;</code> </td> <td> U+022C8 </td> <tr><td> <code title="">boxDL;</code> </td> <td> U+02557 </td> <tr><td> <code title="">boxDR;</code> </td> <td> U+02554 </td> <tr><td> <code title="">boxDl;</code> </td> <td> U+02556 </td> <tr><td> <code title="">boxDr;</code> </td> <td> U+02553 </td> <tr><td> <code title="">boxH;</code> </td> <td> U+02550 </td> <tr><td> <code title="">boxHD;</code> </td> <td> U+02566 </td> <tr><td> <code title="">boxHU;</code> </td> <td> U+02569 </td> <tr><td> <code title="">boxHd;</code> </td> <td> U+02564 </td> <tr><td> <code title="">boxHu;</code> </td> <td> U+02567 </td> <tr><td> <code title="">boxUL;</code> </td> <td> U+0255D </td> <tr><td> <code title="">boxUR;</code> </td> <td> U+0255A </td> <tr><td> <code title="">boxUl;</code> </td> <td> U+0255C </td> <tr><td> <code title="">boxUr;</code> </td> <td> U+02559 </td> <tr><td> <code title="">boxV;</code> </td> <td> U+02551 </td> <tr><td> <code title="">boxVH;</code> </td> <td> U+0256C </td> <tr><td> <code title="">boxVL;</code> </td> <td> U+02563 </td> <tr><td> <code title="">boxVR;</code> </td> <td> U+02560 </td> <tr><td> <code title="">boxVh;</code> </td> <td> U+0256B </td> <tr><td> <code title="">boxVl;</code> </td> <td> U+02562 </td> <tr><td> <code title="">boxVr;</code> </td> <td> U+0255F </td> <tr><td> <code title="">boxbox;</code> </td> <td> U+029C9 </td> <tr><td> <code title="">boxdL;</code> </td> <td> U+02555 </td> <tr><td> <code title="">boxdR;</code> </td> <td> U+02552 </td> <tr><td> <code title="">boxdl;</code> </td> <td> U+02510 </td> <tr><td> <code title="">boxdr;</code> </td> <td> U+0250C </td> <tr><td> <code title="">boxh;</code> </td> <td> U+02500 </td> <tr><td> <code title="">boxhD;</code> </td> <td> U+02565 </td> <tr><td> <code title="">boxhU;</code> </td> <td> U+02568 </td> <tr><td> <code title="">boxhd;</code> </td> <td> U+0252C </td> <tr><td> <code title="">boxhu;</code> </td> <td> U+02534 </td> <tr><td> <code title="">boxminus;</code> </td> <td> U+0229F </td> <tr><td> <code title="">boxplus;</code> </td> <td> U+0229E </td> <tr><td> <code title="">boxtimes;</code> </td> <td> U+022A0 </td> <tr><td> <code title="">boxuL;</code> </td> <td> U+0255B </td> <tr><td> <code title="">boxuR;</code> </td> <td> U+02558 </td> <tr><td> <code title="">boxul;</code> </td> <td> U+02518 </td> <tr><td> <code title="">boxur;</code> </td> <td> U+02514 </td> <tr><td> <code title="">boxv;</code> </td> <td> U+02502 </td> <tr><td> <code title="">boxvH;</code> </td> <td> U+0256A </td> <tr><td> <code title="">boxvL;</code> </td> <td> U+02561 </td> <tr><td> <code title="">boxvR;</code> </td> <td> U+0255E </td> <tr><td> <code title="">boxvh;</code> </td> <td> U+0253C </td> <tr><td> <code title="">boxvl;</code> </td> <td> U+02524 </td> <tr><td> <code title="">boxvr;</code> </td> <td> U+0251C </td> <tr><td> <code title="">bprime;</code> </td> <td> U+02035 </td> <tr><td> <code title="">breve;</code> </td> <td> U+002D8 </td> <tr><td> <code title="">brvbar;</code> </td> <td> U+000A6 </td> <tr><td> <code title="">brvbar</code> </td> <td> U+000A6 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">bscr;</code> </td> <td> U+1D4B7 </td> <tr><td> <code title="">bsemi;</code> </td> <td> U+0204F </td> <tr><td> <code title="">bsim;</code> </td> <td> U+0223D </td> <tr><td> <code title="">bsime;</code> </td> <td> U+022CD </td> <tr><td> <code title="">bsol;</code> </td> <td> U+0005C </td> <tr><td> <code title="">bsolb;</code> </td> <td> U+029C5 </td> <tr><td> <code title="">bsolhsub;</code> </td> <td> U+027C8 </td> <tr><td> <code title="">bull;</code> </td> <td> U+02022 </td> <tr><td> <code title="">bullet;</code> </td> <td> U+02022 </td> <tr><td> <code title="">bump;</code> </td> <td> U+0224E </td> <tr><td> <code title="">bumpE;</code> </td> <td> U+02AAE </td> <tr><td> <code title="">bumpe;</code> </td> <td> U+0224F </td> <tr><td> <code title="">bumpeq;</code> </td> <td> U+0224F </td> <tr><td> <code title="">cacute;</code> </td> <td> U+00107 </td> <tr><td> <code title="">cap;</code> </td> <td> U+02229 </td> <tr><td> <code title="">capand;</code> </td> <td> U+02A44 </td> <tr><td> <code title="">capbrcup;</code> </td> <td> U+02A49 </td> <tr><td> <code title="">capcap;</code> </td> <td> U+02A4B </td> <tr><td> <code title="">capcup;</code> </td> <td> U+02A47 </td> <tr><td> <code title="">capdot;</code> </td> <td> U+02A40 </td> <tr><td> <code title="">caret;</code> </td> <td> U+02041 </td> <tr><td> <code title="">caron;</code> </td> <td> U+002C7 </td> <tr><td> <code title="">ccaps;</code> </td> <td> U+02A4D </td> <tr><td> <code title="">ccaron;</code> </td> <td> U+0010D </td> <tr><td> <code title="">ccedil;</code> </td> <td> U+000E7 </td> <tr><td> <code title="">ccedil</code> </td> <td> U+000E7 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ccirc;</code> </td> <td> U+00109 </td> <tr><td> <code title="">ccups;</code> </td> <td> U+02A4C </td> <tr><td> <code title="">ccupssm;</code> </td> <td> U+02A50 </td> <tr><td> <code title="">cdot;</code> </td> <td> U+0010B </td> <tr><td> <code title="">cedil;</code> </td> <td> U+000B8 </td> <tr><td> <code title="">cedil</code> </td> <td> U+000B8 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">cemptyv;</code> </td> <td> U+029B2 </td> <tr><td> <code title="">cent;</code> </td> <td> U+000A2 </td> <tr><td> <code title="">cent</code> </td> <td> U+000A2 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">centerdot;</code> </td> <td> U+000B7 </td> <tr><td> <code title="">cfr;</code> </td> <td> U+1D520 </td> <tr><td> <code title="">chcy;</code> </td> <td> U+00447 </td> <tr><td> <code title="">check;</code> </td> <td> U+02713 </td> <tr><td> <code title="">checkmark;</code> </td> <td> U+02713 </td> <tr><td> <code title="">chi;</code> </td> <td> U+003C7 </td> <tr><td> <code title="">cir;</code> </td> <td> U+025CB </td> <tr><td> <code title="">cirE;</code> </td> <td> U+029C3 </td> <tr><td> <code title="">circ;</code> </td> <td> U+002C6 </td> <tr><td> <code title="">circeq;</code> </td> <td> U+02257 </td> <tr><td> <code title="">circlearrowleft;</code> </td> <td> U+021BA </td> <tr><td> <code title="">circlearrowright;</code> </td> <td> U+021BB </td> <tr><td> <code title="">circledR;</code> </td> <td> U+000AE </td> <tr><td> <code title="">circledS;</code> </td> <td> U+024C8 </td> <tr><td> <code title="">circledast;</code> </td> <td> U+0229B </td> <tr><td> <code title="">circledcirc;</code> </td> <td> U+0229A </td> <tr><td> <code title="">circleddash;</code> </td> <td> U+0229D </td> <tr><td> <code title="">cire;</code> </td> <td> U+02257 </td> <tr><td> <code title="">cirfnint;</code> </td> <td> U+02A10 </td> <tr><td> <code title="">cirmid;</code> </td> <td> U+02AEF </td> <tr><td> <code title="">cirscir;</code> </td> <td> U+029C2 </td> <tr><td> <code title="">clubs;</code> </td> <td> U+02663 </td> <tr><td> <code title="">clubsuit;</code> </td> <td> U+02663 </td> <tr><td> <code title="">colon;</code> </td> <td> U+0003A </td> <tr><td> <code title="">colone;</code> </td> <td> U+02254 </td> <tr><td> <code title="">coloneq;</code> </td> <td> U+02254 </td> <tr><td> <code title="">comma;</code> </td> <td> U+0002C </td> <tr><td> <code title="">commat;</code> </td> <td> U+00040 </td> <tr><td> <code title="">comp;</code> </td> <td> U+02201 </td> <tr><td> <code title="">compfn;</code> </td> <td> U+02218 </td> <tr><td> <code title="">complement;</code> </td> <td> U+02201 </td> <tr><td> <code title="">complexes;</code> </td> <td> U+02102 </td> <tr><td> <code title="">cong;</code> </td> <td> U+02245 </td> <tr><td> <code title="">congdot;</code> </td> <td> U+02A6D </td> <tr><td> <code title="">conint;</code> </td> <td> U+0222E </td> <tr><td> <code title="">copf;</code> </td> <td> U+1D554 </td> <tr><td> <code title="">coprod;</code> </td> <td> U+02210 </td> <tr><td> <code title="">copy;</code> </td> <td> U+000A9 </td> <tr><td> <code title="">copy</code> </td> <td> U+000A9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">copysr;</code> </td> <td> U+02117 </td> <tr><td> <code title="">crarr;</code> </td> <td> U+021B5 </td> <tr><td> <code title="">cross;</code> </td> <td> U+02717 </td> <tr><td> <code title="">cscr;</code> </td> <td> U+1D4B8 </td> <tr><td> <code title="">csub;</code> </td> <td> U+02ACF </td> <tr><td> <code title="">csube;</code> </td> <td> U+02AD1 </td> <tr><td> <code title="">csup;</code> </td> <td> U+02AD0 </td> <tr><td> <code title="">csupe;</code> </td> <td> U+02AD2 </td> <tr><td> <code title="">ctdot;</code> </td> <td> U+022EF </td> <tr><td> <code title="">cudarrl;</code> </td> <td> U+02938 </td> <tr><td> <code title="">cudarrr;</code> </td> <td> U+02935 </td> <tr><td> <code title="">cuepr;</code> </td> <td> U+022DE </td> <tr><td> <code title="">cuesc;</code> </td> <td> U+022DF </td> <tr><td> <code title="">cularr;</code> </td> <td> U+021B6 </td> <tr><td> <code title="">cularrp;</code> </td> <td> U+0293D </td> <tr><td> <code title="">cup;</code> </td> <td> U+0222A </td> <tr><td> <code title="">cupbrcap;</code> </td> <td> U+02A48 </td> <tr><td> <code title="">cupcap;</code> </td> <td> U+02A46 </td> <tr><td> <code title="">cupcup;</code> </td> <td> U+02A4A </td> <tr><td> <code title="">cupdot;</code> </td> <td> U+0228D </td> <tr><td> <code title="">cupor;</code> </td> <td> U+02A45 </td> <tr><td> <code title="">curarr;</code> </td> <td> U+021B7 </td> <tr><td> <code title="">curarrm;</code> </td> <td> U+0293C </td> <tr><td> <code title="">curlyeqprec;</code> </td> <td> U+022DE </td> <tr><td> <code title="">curlyeqsucc;</code> </td> <td> U+022DF </td> <tr><td> <code title="">curlyvee;</code> </td> <td> U+022CE </td> <tr><td> <code title="">curlywedge;</code> </td> <td> U+022CF </td> <tr><td> <code title="">curren;</code> </td> <td> U+000A4 </td> <tr><td> <code title="">curren</code> </td> <td> U+000A4 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">curvearrowleft;</code> </td> <td> U+021B6 </td> <tr><td> <code title="">curvearrowright;</code> </td> <td> U+021B7 </td> <tr><td> <code title="">cuvee;</code> </td> <td> U+022CE </td> <tr><td> <code title="">cuwed;</code> </td> <td> U+022CF </td> <tr><td> <code title="">cwconint;</code> </td> <td> U+02232 </td> <tr><td> <code title="">cwint;</code> </td> <td> U+02231 </td> <tr><td> <code title="">cylcty;</code> </td> <td> U+0232D </td> <tr><td> <code title="">dArr;</code> </td> <td> U+021D3 </td> <tr><td> <code title="">dHar;</code> </td> <td> U+02965 </td> <tr><td> <code title="">dagger;</code> </td> <td> U+02020 </td> <tr><td> <code title="">daleth;</code> </td> <td> U+02138 </td> <tr><td> <code title="">darr;</code> </td> <td> U+02193 </td> <tr><td> <code title="">dash;</code> </td> <td> U+02010 </td> <tr><td> <code title="">dashv;</code> </td> <td> U+022A3 </td> <tr><td> <code title="">dbkarow;</code> </td> <td> U+0290F </td> <tr><td> <code title="">dblac;</code> </td> <td> U+002DD </td> <tr><td> <code title="">dcaron;</code> </td> <td> U+0010F </td> <tr><td> <code title="">dcy;</code> </td> <td> U+00434 </td> <tr><td> <code title="">dd;</code> </td> <td> U+02146 </td> <tr><td> <code title="">ddagger;</code> </td> <td> U+02021 </td> <tr><td> <code title="">ddarr;</code> </td> <td> U+021CA </td> <tr><td> <code title="">ddotseq;</code> </td> <td> U+02A77 </td> <tr><td> <code title="">deg;</code> </td> <td> U+000B0 </td> <tr><td> <code title="">deg</code> </td> <td> U+000B0 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">delta;</code> </td> <td> U+003B4 </td> <tr><td> <code title="">demptyv;</code> </td> <td> U+029B1 </td> <tr><td> <code title="">dfisht;</code> </td> <td> U+0297F </td> <tr><td> <code title="">dfr;</code> </td> <td> U+1D521 </td> <tr><td> <code title="">dharl;</code> </td> <td> U+021C3 </td> <tr><td> <code title="">dharr;</code> </td> <td> U+021C2 </td> <tr><td> <code title="">diam;</code> </td> <td> U+022C4 </td> <tr><td> <code title="">diamond;</code> </td> <td> U+022C4 </td> <tr><td> <code title="">diamondsuit;</code> </td> <td> U+02666 </td> <tr><td> <code title="">diams;</code> </td> <td> U+02666 </td> <tr><td> <code title="">die;</code> </td> <td> U+000A8 </td> <tr><td> <code title="">digamma;</code> </td> <td> U+003DD </td> <tr><td> <code title="">disin;</code> </td> <td> U+022F2 </td> <tr><td> <code title="">div;</code> </td> <td> U+000F7 </td> <tr><td> <code title="">divide;</code> </td> <td> U+000F7 </td> <tr><td> <code title="">divide</code> </td> <td> U+000F7 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">divideontimes;</code> </td> <td> U+022C7 </td> <tr><td> <code title="">divonx;</code> </td> <td> U+022C7 </td> <tr><td> <code title="">djcy;</code> </td> <td> U+00452 </td> <tr><td> <code title="">dlcorn;</code> </td> <td> U+0231E </td> <tr><td> <code title="">dlcrop;</code> </td> <td> U+0230D </td> <tr><td> <code title="">dollar;</code> </td> <td> U+00024 </td> <tr><td> <code title="">dopf;</code> </td> <td> U+1D555 </td> <tr><td> <code title="">dot;</code> </td> <td> U+002D9 </td> <tr><td> <code title="">doteq;</code> </td> <td> U+02250 </td> <tr><td> <code title="">doteqdot;</code> </td> <td> U+02251 </td> <tr><td> <code title="">dotminus;</code> </td> <td> U+02238 </td> <tr><td> <code title="">dotplus;</code> </td> <td> U+02214 </td> <tr><td> <code title="">dotsquare;</code> </td> <td> U+022A1 </td> <tr><td> <code title="">doublebarwedge;</code> </td> <td> U+02306 </td> <tr><td> <code title="">downarrow;</code> </td> <td> U+02193 </td> <tr><td> <code title="">downdownarrows;</code> </td> <td> U+021CA </td> <tr><td> <code title="">downharpoonleft;</code> </td> <td> U+021C3 </td> <tr><td> <code title="">downharpoonright;</code> </td> <td> U+021C2 </td> <tr><td> <code title="">drbkarow;</code> </td> <td> U+02910 </td> <tr><td> <code title="">drcorn;</code> </td> <td> U+0231F </td> <tr><td> <code title="">drcrop;</code> </td> <td> U+0230C </td> <tr><td> <code title="">dscr;</code> </td> <td> U+1D4B9 </td> <tr><td> <code title="">dscy;</code> </td> <td> U+00455 </td> <tr><td> <code title="">dsol;</code> </td> <td> U+029F6 </td> <tr><td> <code title="">dstrok;</code> </td> <td> U+00111 </td> <tr><td> <code title="">dtdot;</code> </td> <td> U+022F1 </td> <tr><td> <code title="">dtri;</code> </td> <td> U+025BF </td> <tr><td> <code title="">dtrif;</code> </td> <td> U+025BE </td> <tr><td> <code title="">duarr;</code> </td> <td> U+021F5 </td> <tr><td> <code title="">duhar;</code> </td> <td> U+0296F </td> <tr><td> <code title="">dwangle;</code> </td> <td> U+029A6 </td> <tr><td> <code title="">dzcy;</code> </td> <td> U+0045F </td> <tr><td> <code title="">dzigrarr;</code> </td> <td> U+027FF </td> <tr><td> <code title="">eDDot;</code> </td> <td> U+02A77 </td> <tr><td> <code title="">eDot;</code> </td> <td> U+02251 </td> <tr><td> <code title="">eacute;</code> </td> <td> U+000E9 </td> <tr><td> <code title="">eacute</code> </td> <td> U+000E9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">easter;</code> </td> <td> U+02A6E </td> <tr><td> <code title="">ecaron;</code> </td> <td> U+0011B </td> <tr><td> <code title="">ecir;</code> </td> <td> U+02256 </td> <tr><td> <code title="">ecirc;</code> </td> <td> U+000EA </td> <tr><td> <code title="">ecirc</code> </td> <td> U+000EA </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ecolon;</code> </td> <td> U+02255 </td> <tr><td> <code title="">ecy;</code> </td> <td> U+0044D </td> <tr><td> <code title="">edot;</code> </td> <td> U+00117 </td> <tr><td> <code title="">ee;</code> </td> <td> U+02147 </td> <tr><td> <code title="">efDot;</code> </td> <td> U+02252 </td> <tr><td> <code title="">efr;</code> </td> <td> U+1D522 </td> <tr><td> <code title="">eg;</code> </td> <td> U+02A9A </td> <tr><td> <code title="">egrave;</code> </td> <td> U+000E8 </td> <tr><td> <code title="">egrave</code> </td> <td> U+000E8 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">egs;</code> </td> <td> U+02A96 </td> <tr><td> <code title="">egsdot;</code> </td> <td> U+02A98 </td> <tr><td> <code title="">el;</code> </td> <td> U+02A99 </td> <tr><td> <code title="">elinters;</code> </td> <td> U+023E7 </td> <tr><td> <code title="">ell;</code> </td> <td> U+02113 </td> <tr><td> <code title="">els;</code> </td> <td> U+02A95 </td> <tr><td> <code title="">elsdot;</code> </td> <td> U+02A97 </td> <tr><td> <code title="">emacr;</code> </td> <td> U+00113 </td> <tr><td> <code title="">empty;</code> </td> <td> U+02205 </td> <tr><td> <code title="">emptyset;</code> </td> <td> U+02205 </td> <tr><td> <code title="">emptyv;</code> </td> <td> U+02205 </td> <tr><td> <code title="">emsp13;</code> </td> <td> U+02004 </td> <tr><td> <code title="">emsp14;</code> </td> <td> U+02005 </td> <tr><td> <code title="">emsp;</code> </td> <td> U+02003 </td> <tr><td> <code title="">eng;</code> </td> <td> U+0014B </td> <tr><td> <code title="">ensp;</code> </td> <td> U+02002 </td> <tr><td> <code title="">eogon;</code> </td> <td> U+00119 </td> <tr><td> <code title="">eopf;</code> </td> <td> U+1D556 </td> <tr><td> <code title="">epar;</code> </td> <td> U+022D5 </td> <tr><td> <code title="">eparsl;</code> </td> <td> U+029E3 </td> <tr><td> <code title="">eplus;</code> </td> <td> U+02A71 </td> <tr><td> <code title="">epsi;</code> </td> <td> U+003B5 </td> <tr><td> <code title="">epsilon;</code> </td> <td> U+003B5 </td> <tr><td> <code title="">epsiv;</code> </td> <td> U+003F5 </td> <tr><td> <code title="">eqcirc;</code> </td> <td> U+02256 </td> <tr><td> <code title="">eqcolon;</code> </td> <td> U+02255 </td> <tr><td> <code title="">eqsim;</code> </td> <td> U+02242 </td> <tr><td> <code title="">eqslantgtr;</code> </td> <td> U+02A96 </td> <tr><td> <code title="">eqslantless;</code> </td> <td> U+02A95 </td> <tr><td> <code title="">equals;</code> </td> <td> U+0003D </td> <tr><td> <code title="">equest;</code> </td> <td> U+0225F </td> <tr><td> <code title="">equiv;</code> </td> <td> U+02261 </td> <tr><td> <code title="">equivDD;</code> </td> <td> U+02A78 </td> <tr><td> <code title="">eqvparsl;</code> </td> <td> U+029E5 </td> <tr><td> <code title="">erDot;</code> </td> <td> U+02253 </td> <tr><td> <code title="">erarr;</code> </td> <td> U+02971 </td> <tr><td> <code title="">escr;</code> </td> <td> U+0212F </td> <tr><td> <code title="">esdot;</code> </td> <td> U+02250 </td> <tr><td> <code title="">esim;</code> </td> <td> U+02242 </td> <tr><td> <code title="">eta;</code> </td> <td> U+003B7 </td> <tr><td> <code title="">eth;</code> </td> <td> U+000F0 </td> <tr><td> <code title="">eth</code> </td> <td> U+000F0 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">euml;</code> </td> <td> U+000EB </td> <tr><td> <code title="">euml</code> </td> <td> U+000EB </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">euro;</code> </td> <td> U+020AC </td> <tr><td> <code title="">excl;</code> </td> <td> U+00021 </td> <tr><td> <code title="">exist;</code> </td> <td> U+02203 </td> <tr><td> <code title="">expectation;</code> </td> <td> U+02130 </td> <tr><td> <code title="">exponentiale;</code> </td> <td> U+02147 </td> <tr><td> <code title="">fallingdotseq;</code> </td> <td> U+02252 </td> <tr><td> <code title="">fcy;</code> </td> <td> U+00444 </td> <tr><td> <code title="">female;</code> </td> <td> U+02640 </td> <tr><td> <code title="">ffilig;</code> </td> <td> U+0FB03 </td> <tr><td> <code title="">fflig;</code> </td> <td> U+0FB00 </td> <tr><td> <code title="">ffllig;</code> </td> <td> U+0FB04 </td> <tr><td> <code title="">ffr;</code> </td> <td> U+1D523 </td> <tr><td> <code title="">filig;</code> </td> <td> U+0FB01 </td> <tr><td> <code title="">flat;</code> </td> <td> U+0266D </td> <tr><td> <code title="">fllig;</code> </td> <td> U+0FB02 </td> <tr><td> <code title="">fltns;</code> </td> <td> U+025B1 </td> <tr><td> <code title="">fnof;</code> </td> <td> U+00192 </td> <tr><td> <code title="">fopf;</code> </td> <td> U+1D557 </td> <tr><td> <code title="">forall;</code> </td> <td> U+02200 </td> <tr><td> <code title="">fork;</code> </td> <td> U+022D4 </td> <tr><td> <code title="">forkv;</code> </td> <td> U+02AD9 </td> <tr><td> <code title="">fpartint;</code> </td> <td> U+02A0D </td> <tr><td> <code title="">frac12;</code> </td> <td> U+000BD </td> <tr><td> <code title="">frac12</code> </td> <td> U+000BD </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">frac13;</code> </td> <td> U+02153 </td> <tr><td> <code title="">frac14;</code> </td> <td> U+000BC </td> <tr><td> <code title="">frac14</code> </td> <td> U+000BC </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">frac15;</code> </td> <td> U+02155 </td> <tr><td> <code title="">frac16;</code> </td> <td> U+02159 </td> <tr><td> <code title="">frac18;</code> </td> <td> U+0215B </td> <tr><td> <code title="">frac23;</code> </td> <td> U+02154 </td> <tr><td> <code title="">frac25;</code> </td> <td> U+02156 </td> <tr><td> <code title="">frac34;</code> </td> <td> U+000BE </td> <tr><td> <code title="">frac34</code> </td> <td> U+000BE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">frac35;</code> </td> <td> U+02157 </td> <tr><td> <code title="">frac38;</code> </td> <td> U+0215C </td> <tr><td> <code title="">frac45;</code> </td> <td> U+02158 </td> <tr><td> <code title="">frac56;</code> </td> <td> U+0215A </td> <tr><td> <code title="">frac58;</code> </td> <td> U+0215D </td> <tr><td> <code title="">frac78;</code> </td> <td> U+0215E </td> <tr><td> <code title="">frasl;</code> </td> <td> U+02044 </td> <tr><td> <code title="">frown;</code> </td> <td> U+02322 </td> <tr><td> <code title="">fscr;</code> </td> <td> U+1D4BB </td> <tr><td> <code title="">gE;</code> </td> <td> U+02267 </td> <tr><td> <code title="">gEl;</code> </td> <td> U+02A8C </td> <tr><td> <code title="">gacute;</code> </td> <td> U+001F5 </td> <tr><td> <code title="">gamma;</code> </td> <td> U+003B3 </td> <tr><td> <code title="">gammad;</code> </td> <td> U+003DD </td> <tr><td> <code title="">gap;</code> </td> <td> U+02A86 </td> <tr><td> <code title="">gbreve;</code> </td> <td> U+0011F </td> <tr><td> <code title="">gcirc;</code> </td> <td> U+0011D </td> <tr><td> <code title="">gcy;</code> </td> <td> U+00433 </td> <tr><td> <code title="">gdot;</code> </td> <td> U+00121 </td> <tr><td> <code title="">ge;</code> </td> <td> U+02265 </td> <tr><td> <code title="">gel;</code> </td> <td> U+022DB </td> <tr><td> <code title="">geq;</code> </td> <td> U+02265 </td> <tr><td> <code title="">geqq;</code> </td> <td> U+02267 </td> <tr><td> <code title="">geqslant;</code> </td> <td> U+02A7E </td> <tr><td> <code title="">ges;</code> </td> <td> U+02A7E </td> <tr><td> <code title="">gescc;</code> </td> <td> U+02AA9 </td> <tr><td> <code title="">gesdot;</code> </td> <td> U+02A80 </td> <tr><td> <code title="">gesdoto;</code> </td> <td> U+02A82 </td> <tr><td> <code title="">gesdotol;</code> </td> <td> U+02A84 </td> <tr><td> <code title="">gesles;</code> </td> <td> U+02A94 </td> <tr><td> <code title="">gfr;</code> </td> <td> U+1D524 </td> <tr><td> <code title="">gg;</code> </td> <td> U+0226B </td> <tr><td> <code title="">ggg;</code> </td> <td> U+022D9 </td> <tr><td> <code title="">gimel;</code> </td> <td> U+02137 </td> <tr><td> <code title="">gjcy;</code> </td> <td> U+00453 </td> <tr><td> <code title="">gl;</code> </td> <td> U+02277 </td> <tr><td> <code title="">glE;</code> </td> <td> U+02A92 </td> <tr><td> <code title="">gla;</code> </td> <td> U+02AA5 </td> <tr><td> <code title="">glj;</code> </td> <td> U+02AA4 </td> <tr><td> <code title="">gnE;</code> </td> <td> U+02269 </td> <tr><td> <code title="">gnap;</code> </td> <td> U+02A8A </td> <tr><td> <code title="">gnapprox;</code> </td> <td> U+02A8A </td> <tr><td> <code title="">gne;</code> </td> <td> U+02A88 </td> <tr><td> <code title="">gneq;</code> </td> <td> U+02A88 </td> <tr><td> <code title="">gneqq;</code> </td> <td> U+02269 </td> <tr><td> <code title="">gnsim;</code> </td> <td> U+022E7 </td> <tr><td> <code title="">gopf;</code> </td> <td> U+1D558 </td> <tr><td> <code title="">grave;</code> </td> <td> U+00060 </td> <tr><td> <code title="">gscr;</code> </td> <td> U+0210A </td> <tr><td> <code title="">gsim;</code> </td> <td> U+02273 </td> <tr><td> <code title="">gsime;</code> </td> <td> U+02A8E </td> <tr><td> <code title="">gsiml;</code> </td> <td> U+02A90 </td> <tr><td> <code title="">gt;</code> </td> <td> U+0003E </td> <tr><td> <code title="">gt</code> </td> <td> U+0003E </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">gtcc;</code> </td> <td> U+02AA7 </td> <tr><td> <code title="">gtcir;</code> </td> <td> U+02A7A </td> <tr><td> <code title="">gtdot;</code> </td> <td> U+022D7 </td> <tr><td> <code title="">gtlPar;</code> </td> <td> U+02995 </td> <tr><td> <code title="">gtquest;</code> </td> <td> U+02A7C </td> <tr><td> <code title="">gtrapprox;</code> </td> <td> U+02A86 </td> <tr><td> <code title="">gtrarr;</code> </td> <td> U+02978 </td> <tr><td> <code title="">gtrdot;</code> </td> <td> U+022D7 </td> <tr><td> <code title="">gtreqless;</code> </td> <td> U+022DB </td> <tr><td> <code title="">gtreqqless;</code> </td> <td> U+02A8C </td> <tr><td> <code title="">gtrless;</code> </td> <td> U+02277 </td> <tr><td> <code title="">gtrsim;</code> </td> <td> U+02273 </td> <tr><td> <code title="">hArr;</code> </td> <td> U+021D4 </td> <tr><td> <code title="">hairsp;</code> </td> <td> U+0200A </td> <tr><td> <code title="">half;</code> </td> <td> U+000BD </td> <tr><td> <code title="">hamilt;</code> </td> <td> U+0210B </td> <tr><td> <code title="">hardcy;</code> </td> <td> U+0044A </td> <tr><td> <code title="">harr;</code> </td> <td> U+02194 </td> <tr><td> <code title="">harrcir;</code> </td> <td> U+02948 </td> <tr><td> <code title="">harrw;</code> </td> <td> U+021AD </td> <tr><td> <code title="">hbar;</code> </td> <td> U+0210F </td> <tr><td> <code title="">hcirc;</code> </td> <td> U+00125 </td> <tr><td> <code title="">hearts;</code> </td> <td> U+02665 </td> <tr><td> <code title="">heartsuit;</code> </td> <td> U+02665 </td> <tr><td> <code title="">hellip;</code> </td> <td> U+02026 </td> <tr><td> <code title="">hercon;</code> </td> <td> U+022B9 </td> <tr><td> <code title="">hfr;</code> </td> <td> U+1D525 </td> <tr><td> <code title="">hksearow;</code> </td> <td> U+02925 </td> <tr><td> <code title="">hkswarow;</code> </td> <td> U+02926 </td> <tr><td> <code title="">hoarr;</code> </td> <td> U+021FF </td> <tr><td> <code title="">homtht;</code> </td> <td> U+0223B </td> <tr><td> <code title="">hookleftarrow;</code> </td> <td> U+021A9 </td> <tr><td> <code title="">hookrightarrow;</code> </td> <td> U+021AA </td> <tr><td> <code title="">hopf;</code> </td> <td> U+1D559 </td> <tr><td> <code title="">horbar;</code> </td> <td> U+02015 </td> <tr><td> <code title="">hscr;</code> </td> <td> U+1D4BD </td> <tr><td> <code title="">hslash;</code> </td> <td> U+0210F </td> <tr><td> <code title="">hstrok;</code> </td> <td> U+00127 </td> <tr><td> <code title="">hybull;</code> </td> <td> U+02043 </td> <tr><td> <code title="">hyphen;</code> </td> <td> U+02010 </td> <tr><td> <code title="">iacute;</code> </td> <td> U+000ED </td> <tr><td> <code title="">iacute</code> </td> <td> U+000ED </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ic;</code> </td> <td> U+02063 </td> <tr><td> <code title="">icirc;</code> </td> <td> U+000EE </td> <tr><td> <code title="">icirc</code> </td> <td> U+000EE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">icy;</code> </td> <td> U+00438 </td> <tr><td> <code title="">iecy;</code> </td> <td> U+00435 </td> <tr><td> <code title="">iexcl;</code> </td> <td> U+000A1 </td> <tr><td> <code title="">iexcl</code> </td> <td> U+000A1 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">iff;</code> </td> <td> U+021D4 </td> <tr><td> <code title="">ifr;</code> </td> <td> U+1D526 </td> <tr><td> <code title="">igrave;</code> </td> <td> U+000EC </td> <tr><td> <code title="">igrave</code> </td> <td> U+000EC </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ii;</code> </td> <td> U+02148 </td> <tr><td> <code title="">iiiint;</code> </td> <td> U+02A0C </td> <tr><td> <code title="">iiint;</code> </td> <td> U+0222D </td> <tr><td> <code title="">iinfin;</code> </td> <td> U+029DC </td> <tr><td> <code title="">iiota;</code> </td> <td> U+02129 </td> <tr><td> <code title="">ijlig;</code> </td> <td> U+00133 </td> <tr><td> <code title="">imacr;</code> </td> <td> U+0012B </td> <tr><td> <code title="">image;</code> </td> <td> U+02111 </td> <tr><td> <code title="">imagline;</code> </td> <td> U+02110 </td> <tr><td> <code title="">imagpart;</code> </td> <td> U+02111 </td> <tr><td> <code title="">imath;</code> </td> <td> U+00131 </td> <tr><td> <code title="">imof;</code> </td> <td> U+022B7 </td> <tr><td> <code title="">imped;</code> </td> <td> U+001B5 </td> <tr><td> <code title="">in;</code> </td> <td> U+02208 </td> <tr><td> <code title="">incare;</code> </td> <td> U+02105 </td> <tr><td> <code title="">infin;</code> </td> <td> U+0221E </td> <tr><td> <code title="">infintie;</code> </td> <td> U+029DD </td> <tr><td> <code title="">inodot;</code> </td> <td> U+00131 </td> <tr><td> <code title="">int;</code> </td> <td> U+0222B </td> <tr><td> <code title="">intcal;</code> </td> <td> U+022BA </td> <tr><td> <code title="">integers;</code> </td> <td> U+02124 </td> <tr><td> <code title="">intercal;</code> </td> <td> U+022BA </td> <tr><td> <code title="">intlarhk;</code> </td> <td> U+02A17 </td> <tr><td> <code title="">intprod;</code> </td> <td> U+02A3C </td> <tr><td> <code title="">iocy;</code> </td> <td> U+00451 </td> <tr><td> <code title="">iogon;</code> </td> <td> U+0012F </td> <tr><td> <code title="">iopf;</code> </td> <td> U+1D55A </td> <tr><td> <code title="">iota;</code> </td> <td> U+003B9 </td> <tr><td> <code title="">iprod;</code> </td> <td> U+02A3C </td> <tr><td> <code title="">iquest;</code> </td> <td> U+000BF </td> <tr><td> <code title="">iquest</code> </td> <td> U+000BF </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">iscr;</code> </td> <td> U+1D4BE </td> <tr><td> <code title="">isin;</code> </td> <td> U+02208 </td> <tr><td> <code title="">isinE;</code> </td> <td> U+022F9 </td> <tr><td> <code title="">isindot;</code> </td> <td> U+022F5 </td> <tr><td> <code title="">isins;</code> </td> <td> U+022F4 </td> <tr><td> <code title="">isinsv;</code> </td> <td> U+022F3 </td> <tr><td> <code title="">isinv;</code> </td> <td> U+02208 </td> <tr><td> <code title="">it;</code> </td> <td> U+02062 </td> <tr><td> <code title="">itilde;</code> </td> <td> U+00129 </td> <tr><td> <code title="">iukcy;</code> </td> <td> U+00456 </td> <tr><td> <code title="">iuml;</code> </td> <td> U+000EF </td> <tr><td> <code title="">iuml</code> </td> <td> U+000EF </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">jcirc;</code> </td> <td> U+00135 </td> <tr><td> <code title="">jcy;</code> </td> <td> U+00439 </td> <tr><td> <code title="">jfr;</code> </td> <td> U+1D527 </td> <tr><td> <code title="">jmath;</code> </td> <td> U+00237 </td> <tr><td> <code title="">jopf;</code> </td> <td> U+1D55B </td> <tr><td> <code title="">jscr;</code> </td> <td> U+1D4BF </td> <tr><td> <code title="">jsercy;</code> </td> <td> U+00458 </td> <tr><td> <code title="">jukcy;</code> </td> <td> U+00454 </td> <tr><td> <code title="">kappa;</code> </td> <td> U+003BA </td> <tr><td> <code title="">kappav;</code> </td> <td> U+003F0 </td> <tr><td> <code title="">kcedil;</code> </td> <td> U+00137 </td> <tr><td> <code title="">kcy;</code> </td> <td> U+0043A </td> <tr><td> <code title="">kfr;</code> </td> <td> U+1D528 </td> <tr><td> <code title="">kgreen;</code> </td> <td> U+00138 </td> <tr><td> <code title="">khcy;</code> </td> <td> U+00445 </td> <tr><td> <code title="">kjcy;</code> </td> <td> U+0045C </td> <tr><td> <code title="">kopf;</code> </td> <td> U+1D55C </td> <tr><td> <code title="">kscr;</code> </td> <td> U+1D4C0 </td> <tr><td> <code title="">lAarr;</code> </td> <td> U+021DA </td> <tr><td> <code title="">lArr;</code> </td> <td> U+021D0 </td> <tr><td> <code title="">lAtail;</code> </td> <td> U+0291B </td> <tr><td> <code title="">lBarr;</code> </td> <td> U+0290E </td> <tr><td> <code title="">lE;</code> </td> <td> U+02266 </td> <tr><td> <code title="">lEg;</code> </td> <td> U+02A8B </td> <tr><td> <code title="">lHar;</code> </td> <td> U+02962 </td> <tr><td> <code title="">lacute;</code> </td> <td> U+0013A </td> <tr><td> <code title="">laemptyv;</code> </td> <td> U+029B4 </td> <tr><td> <code title="">lagran;</code> </td> <td> U+02112 </td> <tr><td> <code title="">lambda;</code> </td> <td> U+003BB </td> <tr><td> <code title="">lang;</code> </td> <td> U+027E8 </td> <tr><td> <code title="">langd;</code> </td> <td> U+02991 </td> <tr><td> <code title="">langle;</code> </td> <td> U+027E8 </td> <tr><td> <code title="">lap;</code> </td> <td> U+02A85 </td> <tr><td> <code title="">laquo;</code> </td> <td> U+000AB </td> <tr><td> <code title="">laquo</code> </td> <td> U+000AB </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">larr;</code> </td> <td> U+02190 </td> <tr><td> <code title="">larrb;</code> </td> <td> U+021E4 </td> <tr><td> <code title="">larrbfs;</code> </td> <td> U+0291F </td> <tr><td> <code title="">larrfs;</code> </td> <td> U+0291D </td> <tr><td> <code title="">larrhk;</code> </td> <td> U+021A9 </td> <tr><td> <code title="">larrlp;</code> </td> <td> U+021AB </td> <tr><td> <code title="">larrpl;</code> </td> <td> U+02939 </td> <tr><td> <code title="">larrsim;</code> </td> <td> U+02973 </td> <tr><td> <code title="">larrtl;</code> </td> <td> U+021A2 </td> <tr><td> <code title="">lat;</code> </td> <td> U+02AAB </td> <tr><td> <code title="">latail;</code> </td> <td> U+02919 </td> <tr><td> <code title="">late;</code> </td> <td> U+02AAD </td> <tr><td> <code title="">lbarr;</code> </td> <td> U+0290C </td> <tr><td> <code title="">lbbrk;</code> </td> <td> U+02772 </td> <tr><td> <code title="">lbrace;</code> </td> <td> U+0007B </td> <tr><td> <code title="">lbrack;</code> </td> <td> U+0005B </td> <tr><td> <code title="">lbrke;</code> </td> <td> U+0298B </td> <tr><td> <code title="">lbrksld;</code> </td> <td> U+0298F </td> <tr><td> <code title="">lbrkslu;</code> </td> <td> U+0298D </td> <tr><td> <code title="">lcaron;</code> </td> <td> U+0013E </td> <tr><td> <code title="">lcedil;</code> </td> <td> U+0013C </td> <tr><td> <code title="">lceil;</code> </td> <td> U+02308 </td> <tr><td> <code title="">lcub;</code> </td> <td> U+0007B </td> <tr><td> <code title="">lcy;</code> </td> <td> U+0043B </td> <tr><td> <code title="">ldca;</code> </td> <td> U+02936 </td> <tr><td> <code title="">ldquo;</code> </td> <td> U+0201C </td> <tr><td> <code title="">ldquor;</code> </td> <td> U+0201E </td> <tr><td> <code title="">ldrdhar;</code> </td> <td> U+02967 </td> <tr><td> <code title="">ldrushar;</code> </td> <td> U+0294B </td> <tr><td> <code title="">ldsh;</code> </td> <td> U+021B2 </td> <tr><td> <code title="">le;</code> </td> <td> U+02264 </td> <tr><td> <code title="">leftarrow;</code> </td> <td> U+02190 </td> <tr><td> <code title="">leftarrowtail;</code> </td> <td> U+021A2 </td> <tr><td> <code title="">leftharpoondown;</code> </td> <td> U+021BD </td> <tr><td> <code title="">leftharpoonup;</code> </td> <td> U+021BC </td> <tr><td> <code title="">leftleftarrows;</code> </td> <td> U+021C7 </td> <tr><td> <code title="">leftrightarrow;</code> </td> <td> U+02194 </td> <tr><td> <code title="">leftrightarrows;</code> </td> <td> U+021C6 </td> <tr><td> <code title="">leftrightharpoons;</code> </td> <td> U+021CB </td> <tr><td> <code title="">leftrightsquigarrow;</code> </td> <td> U+021AD </td> <tr><td> <code title="">leftthreetimes;</code> </td> <td> U+022CB </td> <tr><td> <code title="">leg;</code> </td> <td> U+022DA </td> <tr><td> <code title="">leq;</code> </td> <td> U+02264 </td> <tr><td> <code title="">leqq;</code> </td> <td> U+02266 </td> <tr><td> <code title="">leqslant;</code> </td> <td> U+02A7D </td> <tr><td> <code title="">les;</code> </td> <td> U+02A7D </td> <tr><td> <code title="">lescc;</code> </td> <td> U+02AA8 </td> <tr><td> <code title="">lesdot;</code> </td> <td> U+02A7F </td> <tr><td> <code title="">lesdoto;</code> </td> <td> U+02A81 </td> <tr><td> <code title="">lesdotor;</code> </td> <td> U+02A83 </td> <tr><td> <code title="">lesges;</code> </td> <td> U+02A93 </td> <tr><td> <code title="">lessapprox;</code> </td> <td> U+02A85 </td> <tr><td> <code title="">lessdot;</code> </td> <td> U+022D6 </td> <tr><td> <code title="">lesseqgtr;</code> </td> <td> U+022DA </td> <tr><td> <code title="">lesseqqgtr;</code> </td> <td> U+02A8B </td> <tr><td> <code title="">lessgtr;</code> </td> <td> U+02276 </td> <tr><td> <code title="">lesssim;</code> </td> <td> U+02272 </td> <tr><td> <code title="">lfisht;</code> </td> <td> U+0297C </td> <tr><td> <code title="">lfloor;</code> </td> <td> U+0230A </td> <tr><td> <code title="">lfr;</code> </td> <td> U+1D529 </td> <tr><td> <code title="">lg;</code> </td> <td> U+02276 </td> <tr><td> <code title="">lgE;</code> </td> <td> U+02A91 </td> <tr><td> <code title="">lhard;</code> </td> <td> U+021BD </td> <tr><td> <code title="">lharu;</code> </td> <td> U+021BC </td> <tr><td> <code title="">lharul;</code> </td> <td> U+0296A </td> <tr><td> <code title="">lhblk;</code> </td> <td> U+02584 </td> <tr><td> <code title="">ljcy;</code> </td> <td> U+00459 </td> <tr><td> <code title="">ll;</code> </td> <td> U+0226A </td> <tr><td> <code title="">llarr;</code> </td> <td> U+021C7 </td> <tr><td> <code title="">llcorner;</code> </td> <td> U+0231E </td> <tr><td> <code title="">llhard;</code> </td> <td> U+0296B </td> <tr><td> <code title="">lltri;</code> </td> <td> U+025FA </td> <tr><td> <code title="">lmidot;</code> </td> <td> U+00140 </td> <tr><td> <code title="">lmoust;</code> </td> <td> U+023B0 </td> <tr><td> <code title="">lmoustache;</code> </td> <td> U+023B0 </td> <tr><td> <code title="">lnE;</code> </td> <td> U+02268 </td> <tr><td> <code title="">lnap;</code> </td> <td> U+02A89 </td> <tr><td> <code title="">lnapprox;</code> </td> <td> U+02A89 </td> <tr><td> <code title="">lne;</code> </td> <td> U+02A87 </td> <tr><td> <code title="">lneq;</code> </td> <td> U+02A87 </td> <tr><td> <code title="">lneqq;</code> </td> <td> U+02268 </td> <tr><td> <code title="">lnsim;</code> </td> <td> U+022E6 </td> <tr><td> <code title="">loang;</code> </td> <td> U+027EC </td> <tr><td> <code title="">loarr;</code> </td> <td> U+021FD </td> <tr><td> <code title="">lobrk;</code> </td> <td> U+027E6 </td> <tr><td> <code title="">longleftarrow;</code> </td> <td> U+027F5 </td> <tr><td> <code title="">longleftrightarrow;</code> </td> <td> U+027F7 </td> <tr><td> <code title="">longmapsto;</code> </td> <td> U+027FC </td> <tr><td> <code title="">longrightarrow;</code> </td> <td> U+027F6 </td> <tr><td> <code title="">looparrowleft;</code> </td> <td> U+021AB </td> <tr><td> <code title="">looparrowright;</code> </td> <td> U+021AC </td> <tr><td> <code title="">lopar;</code> </td> <td> U+02985 </td> <tr><td> <code title="">lopf;</code> </td> <td> U+1D55D </td> <tr><td> <code title="">loplus;</code> </td> <td> U+02A2D </td> <tr><td> <code title="">lotimes;</code> </td> <td> U+02A34 </td> <tr><td> <code title="">lowast;</code> </td> <td> U+02217 </td> <tr><td> <code title="">lowbar;</code> </td> <td> U+0005F </td> <tr><td> <code title="">loz;</code> </td> <td> U+025CA </td> <tr><td> <code title="">lozenge;</code> </td> <td> U+025CA </td> <tr><td> <code title="">lozf;</code> </td> <td> U+029EB </td> <tr><td> <code title="">lpar;</code> </td> <td> U+00028 </td> <tr><td> <code title="">lparlt;</code> </td> <td> U+02993 </td> <tr><td> <code title="">lrarr;</code> </td> <td> U+021C6 </td> <tr><td> <code title="">lrcorner;</code> </td> <td> U+0231F </td> <tr><td> <code title="">lrhar;</code> </td> <td> U+021CB </td> <tr><td> <code title="">lrhard;</code> </td> <td> U+0296D </td> <tr><td> <code title="">lrm;</code> </td> <td> U+0200E </td> <tr><td> <code title="">lrtri;</code> </td> <td> U+022BF </td> <tr><td> <code title="">lsaquo;</code> </td> <td> U+02039 </td> <tr><td> <code title="">lscr;</code> </td> <td> U+1D4C1 </td> <tr><td> <code title="">lsh;</code> </td> <td> U+021B0 </td> <tr><td> <code title="">lsim;</code> </td> <td> U+02272 </td> <tr><td> <code title="">lsime;</code> </td> <td> U+02A8D </td> <tr><td> <code title="">lsimg;</code> </td> <td> U+02A8F </td> <tr><td> <code title="">lsqb;</code> </td> <td> U+0005B </td> <tr><td> <code title="">lsquo;</code> </td> <td> U+02018 </td> <tr><td> <code title="">lsquor;</code> </td> <td> U+0201A </td> <tr><td> <code title="">lstrok;</code> </td> <td> U+00142 </td> <tr><td> <code title="">lt;</code> </td> <td> U+0003C </td> <tr><td> <code title="">lt</code> </td> <td> U+0003C </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ltcc;</code> </td> <td> U+02AA6 </td> <tr><td> <code title="">ltcir;</code> </td> <td> U+02A79 </td> <tr><td> <code title="">ltdot;</code> </td> <td> U+022D6 </td> <tr><td> <code title="">lthree;</code> </td> <td> U+022CB </td> <tr><td> <code title="">ltimes;</code> </td> <td> U+022C9 </td> <tr><td> <code title="">ltlarr;</code> </td> <td> U+02976 </td> <tr><td> <code title="">ltquest;</code> </td> <td> U+02A7B </td> <tr><td> <code title="">ltrPar;</code> </td> <td> U+02996 </td> <tr><td> <code title="">ltri;</code> </td> <td> U+025C3 </td> <tr><td> <code title="">ltrie;</code> </td> <td> U+022B4 </td> <tr><td> <code title="">ltrif;</code> </td> <td> U+025C2 </td> <tr><td> <code title="">lurdshar;</code> </td> <td> U+0294A </td> <tr><td> <code title="">luruhar;</code> </td> <td> U+02966 </td> <tr><td> <code title="">mDDot;</code> </td> <td> U+0223A </td> <tr><td> <code title="">macr;</code> </td> <td> U+000AF </td> <tr><td> <code title="">macr</code> </td> <td> U+000AF </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">male;</code> </td> <td> U+02642 </td> <tr><td> <code title="">malt;</code> </td> <td> U+02720 </td> <tr><td> <code title="">maltese;</code> </td> <td> U+02720 </td> <tr><td> <code title="">map;</code> </td> <td> U+021A6 </td> <tr><td> <code title="">mapsto;</code> </td> <td> U+021A6 </td> <tr><td> <code title="">mapstodown;</code> </td> <td> U+021A7 </td> <tr><td> <code title="">mapstoleft;</code> </td> <td> U+021A4 </td> <tr><td> <code title="">mapstoup;</code> </td> <td> U+021A5 </td> <tr><td> <code title="">marker;</code> </td> <td> U+025AE </td> <tr><td> <code title="">mcomma;</code> </td> <td> U+02A29 </td> <tr><td> <code title="">mcy;</code> </td> <td> U+0043C </td> <tr><td> <code title="">mdash;</code> </td> <td> U+02014 </td> <tr><td> <code title="">measuredangle;</code> </td> <td> U+02221 </td> <tr><td> <code title="">mfr;</code> </td> <td> U+1D52A </td> <tr><td> <code title="">mho;</code> </td> <td> U+02127 </td> <tr><td> <code title="">micro;</code> </td> <td> U+000B5 </td> <tr><td> <code title="">micro</code> </td> <td> U+000B5 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">mid;</code> </td> <td> U+02223 </td> <tr><td> <code title="">midast;</code> </td> <td> U+0002A </td> <tr><td> <code title="">midcir;</code> </td> <td> U+02AF0 </td> <tr><td> <code title="">middot;</code> </td> <td> U+000B7 </td> <tr><td> <code title="">middot</code> </td> <td> U+000B7 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">minus;</code> </td> <td> U+02212 </td> <tr><td> <code title="">minusb;</code> </td> <td> U+0229F </td> <tr><td> <code title="">minusd;</code> </td> <td> U+02238 </td> <tr><td> <code title="">minusdu;</code> </td> <td> U+02A2A </td> <tr><td> <code title="">mlcp;</code> </td> <td> U+02ADB </td> <tr><td> <code title="">mldr;</code> </td> <td> U+02026 </td> <tr><td> <code title="">mnplus;</code> </td> <td> U+02213 </td> <tr><td> <code title="">models;</code> </td> <td> U+022A7 </td> <tr><td> <code title="">mopf;</code> </td> <td> U+1D55E </td> <tr><td> <code title="">mp;</code> </td> <td> U+02213 </td> <tr><td> <code title="">mscr;</code> </td> <td> U+1D4C2 </td> <tr><td> <code title="">mstpos;</code> </td> <td> U+0223E </td> <tr><td> <code title="">mu;</code> </td> <td> U+003BC </td> <tr><td> <code title="">multimap;</code> </td> <td> U+022B8 </td> <tr><td> <code title="">mumap;</code> </td> <td> U+022B8 </td> <tr><td> <code title="">nLeftarrow;</code> </td> <td> U+021CD </td> <tr><td> <code title="">nLeftrightarrow;</code> </td> <td> U+021CE </td> <tr><td> <code title="">nRightarrow;</code> </td> <td> U+021CF </td> <tr><td> <code title="">nVDash;</code> </td> <td> U+022AF </td> <tr><td> <code title="">nVdash;</code> </td> <td> U+022AE </td> <tr><td> <code title="">nabla;</code> </td> <td> U+02207 </td> <tr><td> <code title="">nacute;</code> </td> <td> U+00144 </td> <tr><td> <code title="">nap;</code> </td> <td> U+02249 </td> <tr><td> <code title="">napos;</code> </td> <td> U+00149 </td> <tr><td> <code title="">napprox;</code> </td> <td> U+02249 </td> <tr><td> <code title="">natur;</code> </td> <td> U+0266E </td> <tr><td> <code title="">natural;</code> </td> <td> U+0266E </td> <tr><td> <code title="">naturals;</code> </td> <td> U+02115 </td> <tr><td> <code title="">nbsp;</code> </td> <td> U+000A0 </td> <tr><td> <code title="">nbsp</code> </td> <td> U+000A0 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ncap;</code> </td> <td> U+02A43 </td> <tr><td> <code title="">ncaron;</code> </td> <td> U+00148 </td> <tr><td> <code title="">ncedil;</code> </td> <td> U+00146 </td> <tr><td> <code title="">ncong;</code> </td> <td> U+02247 </td> <tr><td> <code title="">ncup;</code> </td> <td> U+02A42 </td> <tr><td> <code title="">ncy;</code> </td> <td> U+0043D </td> <tr><td> <code title="">ndash;</code> </td> <td> U+02013 </td> <tr><td> <code title="">ne;</code> </td> <td> U+02260 </td> <tr><td> <code title="">neArr;</code> </td> <td> U+021D7 </td> <tr><td> <code title="">nearhk;</code> </td> <td> U+02924 </td> <tr><td> <code title="">nearr;</code> </td> <td> U+02197 </td> <tr><td> <code title="">nearrow;</code> </td> <td> U+02197 </td> <tr><td> <code title="">nequiv;</code> </td> <td> U+02262 </td> <tr><td> <code title="">nesear;</code> </td> <td> U+02928 </td> <tr><td> <code title="">nexist;</code> </td> <td> U+02204 </td> <tr><td> <code title="">nexists;</code> </td> <td> U+02204 </td> <tr><td> <code title="">nfr;</code> </td> <td> U+1D52B </td> <tr><td> <code title="">nge;</code> </td> <td> U+02271 </td> <tr><td> <code title="">ngeq;</code> </td> <td> U+02271 </td> <tr><td> <code title="">ngsim;</code> </td> <td> U+02275 </td> <tr><td> <code title="">ngt;</code> </td> <td> U+0226F </td> <tr><td> <code title="">ngtr;</code> </td> <td> U+0226F </td> <tr><td> <code title="">nhArr;</code> </td> <td> U+021CE </td> <tr><td> <code title="">nharr;</code> </td> <td> U+021AE </td> <tr><td> <code title="">nhpar;</code> </td> <td> U+02AF2 </td> <tr><td> <code title="">ni;</code> </td> <td> U+0220B </td> <tr><td> <code title="">nis;</code> </td> <td> U+022FC </td> <tr><td> <code title="">nisd;</code> </td> <td> U+022FA </td> <tr><td> <code title="">niv;</code> </td> <td> U+0220B </td> <tr><td> <code title="">njcy;</code> </td> <td> U+0045A </td> <tr><td> <code title="">nlArr;</code> </td> <td> U+021CD </td> <tr><td> <code title="">nlarr;</code> </td> <td> U+0219A </td> <tr><td> <code title="">nldr;</code> </td> <td> U+02025 </td> <tr><td> <code title="">nle;</code> </td> <td> U+02270 </td> <tr><td> <code title="">nleftarrow;</code> </td> <td> U+0219A </td> <tr><td> <code title="">nleftrightarrow;</code> </td> <td> U+021AE </td> <tr><td> <code title="">nleq;</code> </td> <td> U+02270 </td> <tr><td> <code title="">nless;</code> </td> <td> U+0226E </td> <tr><td> <code title="">nlsim;</code> </td> <td> U+02274 </td> <tr><td> <code title="">nlt;</code> </td> <td> U+0226E </td> <tr><td> <code title="">nltri;</code> </td> <td> U+022EA </td> <tr><td> <code title="">nltrie;</code> </td> <td> U+022EC </td> <tr><td> <code title="">nmid;</code> </td> <td> U+02224 </td> <tr><td> <code title="">nopf;</code> </td> <td> U+1D55F </td> <tr><td> <code title="">not;</code> </td> <td> U+000AC </td> <tr><td> <code title="">not</code> </td> <td> U+000AC </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">notin;</code> </td> <td> U+02209 </td> <tr><td> <code title="">notinva;</code> </td> <td> U+02209 </td> <tr><td> <code title="">notinvb;</code> </td> <td> U+022F7 </td> <tr><td> <code title="">notinvc;</code> </td> <td> U+022F6 </td> <tr><td> <code title="">notni;</code> </td> <td> U+0220C </td> <tr><td> <code title="">notniva;</code> </td> <td> U+0220C </td> <tr><td> <code title="">notnivb;</code> </td> <td> U+022FE </td> <tr><td> <code title="">notnivc;</code> </td> <td> U+022FD </td> <tr><td> <code title="">npar;</code> </td> <td> U+02226 </td> <tr><td> <code title="">nparallel;</code> </td> <td> U+02226 </td> <tr><td> <code title="">npolint;</code> </td> <td> U+02A14 </td> <tr><td> <code title="">npr;</code> </td> <td> U+02280 </td> <tr><td> <code title="">nprcue;</code> </td> <td> U+022E0 </td> <tr><td> <code title="">nprec;</code> </td> <td> U+02280 </td> <tr><td> <code title="">nrArr;</code> </td> <td> U+021CF </td> <tr><td> <code title="">nrarr;</code> </td> <td> U+0219B </td> <tr><td> <code title="">nrightarrow;</code> </td> <td> U+0219B </td> <tr><td> <code title="">nrtri;</code> </td> <td> U+022EB </td> <tr><td> <code title="">nrtrie;</code> </td> <td> U+022ED </td> <tr><td> <code title="">nsc;</code> </td> <td> U+02281 </td> <tr><td> <code title="">nsccue;</code> </td> <td> U+022E1 </td> <tr><td> <code title="">nscr;</code> </td> <td> U+1D4C3 </td> <tr><td> <code title="">nshortmid;</code> </td> <td> U+02224 </td> <tr><td> <code title="">nshortparallel;</code> </td> <td> U+02226 </td> <tr><td> <code title="">nsim;</code> </td> <td> U+02241 </td> <tr><td> <code title="">nsime;</code> </td> <td> U+02244 </td> <tr><td> <code title="">nsimeq;</code> </td> <td> U+02244 </td> <tr><td> <code title="">nsmid;</code> </td> <td> U+02224 </td> <tr><td> <code title="">nspar;</code> </td> <td> U+02226 </td> <tr><td> <code title="">nsqsube;</code> </td> <td> U+022E2 </td> <tr><td> <code title="">nsqsupe;</code> </td> <td> U+022E3 </td> <tr><td> <code title="">nsub;</code> </td> <td> U+02284 </td> <tr><td> <code title="">nsube;</code> </td> <td> U+02288 </td> <tr><td> <code title="">nsubseteq;</code> </td> <td> U+02288 </td> <tr><td> <code title="">nsucc;</code> </td> <td> U+02281 </td> <tr><td> <code title="">nsup;</code> </td> <td> U+02285 </td> <tr><td> <code title="">nsupe;</code> </td> <td> U+02289 </td> <tr><td> <code title="">nsupseteq;</code> </td> <td> U+02289 </td> <tr><td> <code title="">ntgl;</code> </td> <td> U+02279 </td> <tr><td> <code title="">ntilde;</code> </td> <td> U+000F1 </td> <tr><td> <code title="">ntilde</code> </td> <td> U+000F1 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ntlg;</code> </td> <td> U+02278 </td> <tr><td> <code title="">ntriangleleft;</code> </td> <td> U+022EA </td> <tr><td> <code title="">ntrianglelefteq;</code> </td> <td> U+022EC </td> <tr><td> <code title="">ntriangleright;</code> </td> <td> U+022EB </td> <tr><td> <code title="">ntrianglerighteq;</code> </td> <td> U+022ED </td> <tr><td> <code title="">nu;</code> </td> <td> U+003BD </td> <tr><td> <code title="">num;</code> </td> <td> U+00023 </td> <tr><td> <code title="">numero;</code> </td> <td> U+02116 </td> <tr><td> <code title="">numsp;</code> </td> <td> U+02007 </td> <tr><td> <code title="">nvDash;</code> </td> <td> U+022AD </td> <tr><td> <code title="">nvHarr;</code> </td> <td> U+02904 </td> <tr><td> <code title="">nvdash;</code> </td> <td> U+022AC </td> <tr><td> <code title="">nvinfin;</code> </td> <td> U+029DE </td> <tr><td> <code title="">nvlArr;</code> </td> <td> U+02902 </td> <tr><td> <code title="">nvrArr;</code> </td> <td> U+02903 </td> <tr><td> <code title="">nwArr;</code> </td> <td> U+021D6 </td> <tr><td> <code title="">nwarhk;</code> </td> <td> U+02923 </td> <tr><td> <code title="">nwarr;</code> </td> <td> U+02196 </td> <tr><td> <code title="">nwarrow;</code> </td> <td> U+02196 </td> <tr><td> <code title="">nwnear;</code> </td> <td> U+02927 </td> <tr><td> <code title="">oS;</code> </td> <td> U+024C8 </td> <tr><td> <code title="">oacute;</code> </td> <td> U+000F3 </td> <tr><td> <code title="">oacute</code> </td> <td> U+000F3 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">oast;</code> </td> <td> U+0229B </td> <tr><td> <code title="">ocir;</code> </td> <td> U+0229A </td> <tr><td> <code title="">ocirc;</code> </td> <td> U+000F4 </td> <tr><td> <code title="">ocirc</code> </td> <td> U+000F4 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ocy;</code> </td> <td> U+0043E </td> <tr><td> <code title="">odash;</code> </td> <td> U+0229D </td> <tr><td> <code title="">odblac;</code> </td> <td> U+00151 </td> <tr><td> <code title="">odiv;</code> </td> <td> U+02A38 </td> <tr><td> <code title="">odot;</code> </td> <td> U+02299 </td> <tr><td> <code title="">odsold;</code> </td> <td> U+029BC </td> <tr><td> <code title="">oelig;</code> </td> <td> U+00153 </td> <tr><td> <code title="">ofcir;</code> </td> <td> U+029BF </td> <tr><td> <code title="">ofr;</code> </td> <td> U+1D52C </td> <tr><td> <code title="">ogon;</code> </td> <td> U+002DB </td> <tr><td> <code title="">ograve;</code> </td> <td> U+000F2 </td> <tr><td> <code title="">ograve</code> </td> <td> U+000F2 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ogt;</code> </td> <td> U+029C1 </td> <tr><td> <code title="">ohbar;</code> </td> <td> U+029B5 </td> <tr><td> <code title="">ohm;</code> </td> <td> U+003A9 </td> <tr><td> <code title="">oint;</code> </td> <td> U+0222E </td> <tr><td> <code title="">olarr;</code> </td> <td> U+021BA </td> <tr><td> <code title="">olcir;</code> </td> <td> U+029BE </td> <tr><td> <code title="">olcross;</code> </td> <td> U+029BB </td> <tr><td> <code title="">oline;</code> </td> <td> U+0203E </td> <tr><td> <code title="">olt;</code> </td> <td> U+029C0 </td> <tr><td> <code title="">omacr;</code> </td> <td> U+0014D </td> <tr><td> <code title="">omega;</code> </td> <td> U+003C9 </td> <tr><td> <code title="">omicron;</code> </td> <td> U+003BF </td> <tr><td> <code title="">omid;</code> </td> <td> U+029B6 </td> <tr><td> <code title="">ominus;</code> </td> <td> U+02296 </td> <tr><td> <code title="">oopf;</code> </td> <td> U+1D560 </td> <tr><td> <code title="">opar;</code> </td> <td> U+029B7 </td> <tr><td> <code title="">operp;</code> </td> <td> U+029B9 </td> <tr><td> <code title="">oplus;</code> </td> <td> U+02295 </td> <tr><td> <code title="">or;</code> </td> <td> U+02228 </td> <tr><td> <code title="">orarr;</code> </td> <td> U+021BB </td> <tr><td> <code title="">ord;</code> </td> <td> U+02A5D </td> <tr><td> <code title="">order;</code> </td> <td> U+02134 </td> <tr><td> <code title="">orderof;</code> </td> <td> U+02134 </td> <tr><td> <code title="">ordf;</code> </td> <td> U+000AA </td> <tr><td> <code title="">ordf</code> </td> <td> U+000AA </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ordm;</code> </td> <td> U+000BA </td> <tr><td> <code title="">ordm</code> </td> <td> U+000BA </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">origof;</code> </td> <td> U+022B6 </td> <tr><td> <code title="">oror;</code> </td> <td> U+02A56 </td> <tr><td> <code title="">orslope;</code> </td> <td> U+02A57 </td> <tr><td> <code title="">orv;</code> </td> <td> U+02A5B </td> <tr><td> <code title="">oscr;</code> </td> <td> U+02134 </td> <tr><td> <code title="">oslash;</code> </td> <td> U+000F8 </td> <tr><td> <code title="">oslash</code> </td> <td> U+000F8 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">osol;</code> </td> <td> U+02298 </td> <tr><td> <code title="">otilde;</code> </td> <td> U+000F5 </td> <tr><td> <code title="">otilde</code> </td> <td> U+000F5 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">otimes;</code> </td> <td> U+02297 </td> <tr><td> <code title="">otimesas;</code> </td> <td> U+02A36 </td> <tr><td> <code title="">ouml;</code> </td> <td> U+000F6 </td> <tr><td> <code title="">ouml</code> </td> <td> U+000F6 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ovbar;</code> </td> <td> U+0233D </td> <tr><td> <code title="">par;</code> </td> <td> U+02225 </td> <tr><td> <code title="">para;</code> </td> <td> U+000B6 </td> <tr><td> <code title="">para</code> </td> <td> U+000B6 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">parallel;</code> </td> <td> U+02225 </td> <tr><td> <code title="">parsim;</code> </td> <td> U+02AF3 </td> <tr><td> <code title="">parsl;</code> </td> <td> U+02AFD </td> <tr><td> <code title="">part;</code> </td> <td> U+02202 </td> <tr><td> <code title="">pcy;</code> </td> <td> U+0043F </td> <tr><td> <code title="">percnt;</code> </td> <td> U+00025 </td> <tr><td> <code title="">period;</code> </td> <td> U+0002E </td> <tr><td> <code title="">permil;</code> </td> <td> U+02030 </td> <tr><td> <code title="">perp;</code> </td> <td> U+022A5 </td> <tr><td> <code title="">pertenk;</code> </td> <td> U+02031 </td> <tr><td> <code title="">pfr;</code> </td> <td> U+1D52D </td> <tr><td> <code title="">phi;</code> </td> <td> U+003C6 </td> <tr><td> <code title="">phiv;</code> </td> <td> U+003D5 </td> <tr><td> <code title="">phmmat;</code> </td> <td> U+02133 </td> <tr><td> <code title="">phone;</code> </td> <td> U+0260E </td> <tr><td> <code title="">pi;</code> </td> <td> U+003C0 </td> <tr><td> <code title="">pitchfork;</code> </td> <td> U+022D4 </td> <tr><td> <code title="">piv;</code> </td> <td> U+003D6 </td> <tr><td> <code title="">planck;</code> </td> <td> U+0210F </td> <tr><td> <code title="">planckh;</code> </td> <td> U+0210E </td> <tr><td> <code title="">plankv;</code> </td> <td> U+0210F </td> <tr><td> <code title="">plus;</code> </td> <td> U+0002B </td> <tr><td> <code title="">plusacir;</code> </td> <td> U+02A23 </td> <tr><td> <code title="">plusb;</code> </td> <td> U+0229E </td> <tr><td> <code title="">pluscir;</code> </td> <td> U+02A22 </td> <tr><td> <code title="">plusdo;</code> </td> <td> U+02214 </td> <tr><td> <code title="">plusdu;</code> </td> <td> U+02A25 </td> <tr><td> <code title="">pluse;</code> </td> <td> U+02A72 </td> <tr><td> <code title="">plusmn;</code> </td> <td> U+000B1 </td> <tr><td> <code title="">plusmn</code> </td> <td> U+000B1 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">plussim;</code> </td> <td> U+02A26 </td> <tr><td> <code title="">plustwo;</code> </td> <td> U+02A27 </td> <tr><td> <code title="">pm;</code> </td> <td> U+000B1 </td> <tr><td> <code title="">pointint;</code> </td> <td> U+02A15 </td> <tr><td> <code title="">popf;</code> </td> <td> U+1D561 </td> <tr><td> <code title="">pound;</code> </td> <td> U+000A3 </td> <tr><td> <code title="">pound</code> </td> <td> U+000A3 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">pr;</code> </td> <td> U+0227A </td> <tr><td> <code title="">prE;</code> </td> <td> U+02AB3 </td> <tr><td> <code title="">prap;</code> </td> <td> U+02AB7 </td> <tr><td> <code title="">prcue;</code> </td> <td> U+0227C </td> <tr><td> <code title="">pre;</code> </td> <td> U+02AAF </td> <tr><td> <code title="">prec;</code> </td> <td> U+0227A </td> <tr><td> <code title="">precapprox;</code> </td> <td> U+02AB7 </td> <tr><td> <code title="">preccurlyeq;</code> </td> <td> U+0227C </td> <tr><td> <code title="">preceq;</code> </td> <td> U+02AAF </td> <tr><td> <code title="">precnapprox;</code> </td> <td> U+02AB9 </td> <tr><td> <code title="">precneqq;</code> </td> <td> U+02AB5 </td> <tr><td> <code title="">precnsim;</code> </td> <td> U+022E8 </td> <tr><td> <code title="">precsim;</code> </td> <td> U+0227E </td> <tr><td> <code title="">prime;</code> </td> <td> U+02032 </td> <tr><td> <code title="">primes;</code> </td> <td> U+02119 </td> <tr><td> <code title="">prnE;</code> </td> <td> U+02AB5 </td> <tr><td> <code title="">prnap;</code> </td> <td> U+02AB9 </td> <tr><td> <code title="">prnsim;</code> </td> <td> U+022E8 </td> <tr><td> <code title="">prod;</code> </td> <td> U+0220F </td> <tr><td> <code title="">profalar;</code> </td> <td> U+0232E </td> <tr><td> <code title="">profline;</code> </td> <td> U+02312 </td> <tr><td> <code title="">profsurf;</code> </td> <td> U+02313 </td> <tr><td> <code title="">prop;</code> </td> <td> U+0221D </td> <tr><td> <code title="">propto;</code> </td> <td> U+0221D </td> <tr><td> <code title="">prsim;</code> </td> <td> U+0227E </td> <tr><td> <code title="">prurel;</code> </td> <td> U+022B0 </td> <tr><td> <code title="">pscr;</code> </td> <td> U+1D4C5 </td> <tr><td> <code title="">psi;</code> </td> <td> U+003C8 </td> <tr><td> <code title="">puncsp;</code> </td> <td> U+02008 </td> <tr><td> <code title="">qfr;</code> </td> <td> U+1D52E </td> <tr><td> <code title="">qint;</code> </td> <td> U+02A0C </td> <tr><td> <code title="">qopf;</code> </td> <td> U+1D562 </td> <tr><td> <code title="">qprime;</code> </td> <td> U+02057 </td> <tr><td> <code title="">qscr;</code> </td> <td> U+1D4C6 </td> <tr><td> <code title="">quaternions;</code> </td> <td> U+0210D </td> <tr><td> <code title="">quatint;</code> </td> <td> U+02A16 </td> <tr><td> <code title="">quest;</code> </td> <td> U+0003F </td> <tr><td> <code title="">questeq;</code> </td> <td> U+0225F </td> <tr><td> <code title="">quot;</code> </td> <td> U+00022 </td> <tr><td> <code title="">quot</code> </td> <td> U+00022 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">rAarr;</code> </td> <td> U+021DB </td> <tr><td> <code title="">rArr;</code> </td> <td> U+021D2 </td> <tr><td> <code title="">rAtail;</code> </td> <td> U+0291C </td> <tr><td> <code title="">rBarr;</code> </td> <td> U+0290F </td> <tr><td> <code title="">rHar;</code> </td> <td> U+02964 </td> <tr><td> <code title="">racute;</code> </td> <td> U+00155 </td> <tr><td> <code title="">radic;</code> </td> <td> U+0221A </td> <tr><td> <code title="">raemptyv;</code> </td> <td> U+029B3 </td> <tr><td> <code title="">rang;</code> </td> <td> U+027E9 </td> <tr><td> <code title="">rangd;</code> </td> <td> U+02992 </td> <tr><td> <code title="">range;</code> </td> <td> U+029A5 </td> <tr><td> <code title="">rangle;</code> </td> <td> U+027E9 </td> <tr><td> <code title="">raquo;</code> </td> <td> U+000BB </td> <tr><td> <code title="">raquo</code> </td> <td> U+000BB </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">rarr;</code> </td> <td> U+02192 </td> <tr><td> <code title="">rarrap;</code> </td> <td> U+02975 </td> <tr><td> <code title="">rarrb;</code> </td> <td> U+021E5 </td> <tr><td> <code title="">rarrbfs;</code> </td> <td> U+02920 </td> <tr><td> <code title="">rarrc;</code> </td> <td> U+02933 </td> <tr><td> <code title="">rarrfs;</code> </td> <td> U+0291E </td> <tr><td> <code title="">rarrhk;</code> </td> <td> U+021AA </td> <tr><td> <code title="">rarrlp;</code> </td> <td> U+021AC </td> <tr><td> <code title="">rarrpl;</code> </td> <td> U+02945 </td> <tr><td> <code title="">rarrsim;</code> </td> <td> U+02974 </td> <tr><td> <code title="">rarrtl;</code> </td> <td> U+021A3 </td> <tr><td> <code title="">rarrw;</code> </td> <td> U+0219D </td> <tr><td> <code title="">ratail;</code> </td> <td> U+0291A </td> <tr><td> <code title="">ratio;</code> </td> <td> U+02236 </td> <tr><td> <code title="">rationals;</code> </td> <td> U+0211A </td> <tr><td> <code title="">rbarr;</code> </td> <td> U+0290D </td> <tr><td> <code title="">rbbrk;</code> </td> <td> U+02773 </td> <tr><td> <code title="">rbrace;</code> </td> <td> U+0007D </td> <tr><td> <code title="">rbrack;</code> </td> <td> U+0005D </td> <tr><td> <code title="">rbrke;</code> </td> <td> U+0298C </td> <tr><td> <code title="">rbrksld;</code> </td> <td> U+0298E </td> <tr><td> <code title="">rbrkslu;</code> </td> <td> U+02990 </td> <tr><td> <code title="">rcaron;</code> </td> <td> U+00159 </td> <tr><td> <code title="">rcedil;</code> </td> <td> U+00157 </td> <tr><td> <code title="">rceil;</code> </td> <td> U+02309 </td> <tr><td> <code title="">rcub;</code> </td> <td> U+0007D </td> <tr><td> <code title="">rcy;</code> </td> <td> U+00440 </td> <tr><td> <code title="">rdca;</code> </td> <td> U+02937 </td> <tr><td> <code title="">rdldhar;</code> </td> <td> U+02969 </td> <tr><td> <code title="">rdquo;</code> </td> <td> U+0201D </td> <tr><td> <code title="">rdquor;</code> </td> <td> U+0201D </td> <tr><td> <code title="">rdsh;</code> </td> <td> U+021B3 </td> <tr><td> <code title="">real;</code> </td> <td> U+0211C </td> <tr><td> <code title="">realine;</code> </td> <td> U+0211B </td> <tr><td> <code title="">realpart;</code> </td> <td> U+0211C </td> <tr><td> <code title="">reals;</code> </td> <td> U+0211D </td> <tr><td> <code title="">rect;</code> </td> <td> U+025AD </td> <tr><td> <code title="">reg;</code> </td> <td> U+000AE </td> <tr><td> <code title="">reg</code> </td> <td> U+000AE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">rfisht;</code> </td> <td> U+0297D </td> <tr><td> <code title="">rfloor;</code> </td> <td> U+0230B </td> <tr><td> <code title="">rfr;</code> </td> <td> U+1D52F </td> <tr><td> <code title="">rhard;</code> </td> <td> U+021C1 </td> <tr><td> <code title="">rharu;</code> </td> <td> U+021C0 </td> <tr><td> <code title="">rharul;</code> </td> <td> U+0296C </td> <tr><td> <code title="">rho;</code> </td> <td> U+003C1 </td> <tr><td> <code title="">rhov;</code> </td> <td> U+003F1 </td> <tr><td> <code title="">rightarrow;</code> </td> <td> U+02192 </td> <tr><td> <code title="">rightarrowtail;</code> </td> <td> U+021A3 </td> <tr><td> <code title="">rightharpoondown;</code> </td> <td> U+021C1 </td> <tr><td> <code title="">rightharpoonup;</code> </td> <td> U+021C0 </td> <tr><td> <code title="">rightleftarrows;</code> </td> <td> U+021C4 </td> <tr><td> <code title="">rightleftharpoons;</code> </td> <td> U+021CC </td> <tr><td> <code title="">rightrightarrows;</code> </td> <td> U+021C9 </td> <tr><td> <code title="">rightsquigarrow;</code> </td> <td> U+0219D </td> <tr><td> <code title="">rightthreetimes;</code> </td> <td> U+022CC </td> <tr><td> <code title="">ring;</code> </td> <td> U+002DA </td> <tr><td> <code title="">risingdotseq;</code> </td> <td> U+02253 </td> <tr><td> <code title="">rlarr;</code> </td> <td> U+021C4 </td> <tr><td> <code title="">rlhar;</code> </td> <td> U+021CC </td> <tr><td> <code title="">rlm;</code> </td> <td> U+0200F </td> <tr><td> <code title="">rmoust;</code> </td> <td> U+023B1 </td> <tr><td> <code title="">rmoustache;</code> </td> <td> U+023B1 </td> <tr><td> <code title="">rnmid;</code> </td> <td> U+02AEE </td> <tr><td> <code title="">roang;</code> </td> <td> U+027ED </td> <tr><td> <code title="">roarr;</code> </td> <td> U+021FE </td> <tr><td> <code title="">robrk;</code> </td> <td> U+027E7 </td> <tr><td> <code title="">ropar;</code> </td> <td> U+02986 </td> <tr><td> <code title="">ropf;</code> </td> <td> U+1D563 </td> <tr><td> <code title="">roplus;</code> </td> <td> U+02A2E </td> <tr><td> <code title="">rotimes;</code> </td> <td> U+02A35 </td> <tr><td> <code title="">rpar;</code> </td> <td> U+00029 </td> <tr><td> <code title="">rpargt;</code> </td> <td> U+02994 </td> <tr><td> <code title="">rppolint;</code> </td> <td> U+02A12 </td> <tr><td> <code title="">rrarr;</code> </td> <td> U+021C9 </td> <tr><td> <code title="">rsaquo;</code> </td> <td> U+0203A </td> <tr><td> <code title="">rscr;</code> </td> <td> U+1D4C7 </td> <tr><td> <code title="">rsh;</code> </td> <td> U+021B1 </td> <tr><td> <code title="">rsqb;</code> </td> <td> U+0005D </td> <tr><td> <code title="">rsquo;</code> </td> <td> U+02019 </td> <tr><td> <code title="">rsquor;</code> </td> <td> U+02019 </td> <tr><td> <code title="">rthree;</code> </td> <td> U+022CC </td> <tr><td> <code title="">rtimes;</code> </td> <td> U+022CA </td> <tr><td> <code title="">rtri;</code> </td> <td> U+025B9 </td> <tr><td> <code title="">rtrie;</code> </td> <td> U+022B5 </td> <tr><td> <code title="">rtrif;</code> </td> <td> U+025B8 </td> <tr><td> <code title="">rtriltri;</code> </td> <td> U+029CE </td> <tr><td> <code title="">ruluhar;</code> </td> <td> U+02968 </td> <tr><td> <code title="">rx;</code> </td> <td> U+0211E </td> <tr><td> <code title="">sacute;</code> </td> <td> U+0015B </td> <tr><td> <code title="">sbquo;</code> </td> <td> U+0201A </td> <tr><td> <code title="">sc;</code> </td> <td> U+0227B </td> <tr><td> <code title="">scE;</code> </td> <td> U+02AB4 </td> <tr><td> <code title="">scap;</code> </td> <td> U+02AB8 </td> <tr><td> <code title="">scaron;</code> </td> <td> U+00161 </td> <tr><td> <code title="">sccue;</code> </td> <td> U+0227D </td> <tr><td> <code title="">sce;</code> </td> <td> U+02AB0 </td> <tr><td> <code title="">scedil;</code> </td> <td> U+0015F </td> <tr><td> <code title="">scirc;</code> </td> <td> U+0015D </td> <tr><td> <code title="">scnE;</code> </td> <td> U+02AB6 </td> <tr><td> <code title="">scnap;</code> </td> <td> U+02ABA </td> <tr><td> <code title="">scnsim;</code> </td> <td> U+022E9 </td> <tr><td> <code title="">scpolint;</code> </td> <td> U+02A13 </td> <tr><td> <code title="">scsim;</code> </td> <td> U+0227F </td> <tr><td> <code title="">scy;</code> </td> <td> U+00441 </td> <tr><td> <code title="">sdot;</code> </td> <td> U+022C5 </td> <tr><td> <code title="">sdotb;</code> </td> <td> U+022A1 </td> <tr><td> <code title="">sdote;</code> </td> <td> U+02A66 </td> <tr><td> <code title="">seArr;</code> </td> <td> U+021D8 </td> <tr><td> <code title="">searhk;</code> </td> <td> U+02925 </td> <tr><td> <code title="">searr;</code> </td> <td> U+02198 </td> <tr><td> <code title="">searrow;</code> </td> <td> U+02198 </td> <tr><td> <code title="">sect;</code> </td> <td> U+000A7 </td> <tr><td> <code title="">sect</code> </td> <td> U+000A7 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">semi;</code> </td> <td> U+0003B </td> <tr><td> <code title="">seswar;</code> </td> <td> U+02929 </td> <tr><td> <code title="">setminus;</code> </td> <td> U+02216 </td> <tr><td> <code title="">setmn;</code> </td> <td> U+02216 </td> <tr><td> <code title="">sext;</code> </td> <td> U+02736 </td> <tr><td> <code title="">sfr;</code> </td> <td> U+1D530 </td> <tr><td> <code title="">sfrown;</code> </td> <td> U+02322 </td> <tr><td> <code title="">sharp;</code> </td> <td> U+0266F </td> <tr><td> <code title="">shchcy;</code> </td> <td> U+00449 </td> <tr><td> <code title="">shcy;</code> </td> <td> U+00448 </td> <tr><td> <code title="">shortmid;</code> </td> <td> U+02223 </td> <tr><td> <code title="">shortparallel;</code> </td> <td> U+02225 </td> <tr><td> <code title="">shy;</code> </td> <td> U+000AD </td> <tr><td> <code title="">shy</code> </td> <td> U+000AD </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">sigma;</code> </td> <td> U+003C3 </td> <tr><td> <code title="">sigmaf;</code> </td> <td> U+003C2 </td> <tr><td> <code title="">sigmav;</code> </td> <td> U+003C2 </td> <tr><td> <code title="">sim;</code> </td> <td> U+0223C </td> <tr><td> <code title="">simdot;</code> </td> <td> U+02A6A </td> <tr><td> <code title="">sime;</code> </td> <td> U+02243 </td> <tr><td> <code title="">simeq;</code> </td> <td> U+02243 </td> <tr><td> <code title="">simg;</code> </td> <td> U+02A9E </td> <tr><td> <code title="">simgE;</code> </td> <td> U+02AA0 </td> <tr><td> <code title="">siml;</code> </td> <td> U+02A9D </td> <tr><td> <code title="">simlE;</code> </td> <td> U+02A9F </td> <tr><td> <code title="">simne;</code> </td> <td> U+02246 </td> <tr><td> <code title="">simplus;</code> </td> <td> U+02A24 </td> <tr><td> <code title="">simrarr;</code> </td> <td> U+02972 </td> <tr><td> <code title="">slarr;</code> </td> <td> U+02190 </td> <tr><td> <code title="">smallsetminus;</code> </td> <td> U+02216 </td> <tr><td> <code title="">smashp;</code> </td> <td> U+02A33 </td> <tr><td> <code title="">smeparsl;</code> </td> <td> U+029E4 </td> <tr><td> <code title="">smid;</code> </td> <td> U+02223 </td> <tr><td> <code title="">smile;</code> </td> <td> U+02323 </td> <tr><td> <code title="">smt;</code> </td> <td> U+02AAA </td> <tr><td> <code title="">smte;</code> </td> <td> U+02AAC </td> <tr><td> <code title="">softcy;</code> </td> <td> U+0044C </td> <tr><td> <code title="">sol;</code> </td> <td> U+0002F </td> <tr><td> <code title="">solb;</code> </td> <td> U+029C4 </td> <tr><td> <code title="">solbar;</code> </td> <td> U+0233F </td> <tr><td> <code title="">sopf;</code> </td> <td> U+1D564 </td> <tr><td> <code title="">spades;</code> </td> <td> U+02660 </td> <tr><td> <code title="">spadesuit;</code> </td> <td> U+02660 </td> <tr><td> <code title="">spar;</code> </td> <td> U+02225 </td> <tr><td> <code title="">sqcap;</code> </td> <td> U+02293 </td> <tr><td> <code title="">sqcup;</code> </td> <td> U+02294 </td> <tr><td> <code title="">sqsub;</code> </td> <td> U+0228F </td> <tr><td> <code title="">sqsube;</code> </td> <td> U+02291 </td> <tr><td> <code title="">sqsubset;</code> </td> <td> U+0228F </td> <tr><td> <code title="">sqsubseteq;</code> </td> <td> U+02291 </td> <tr><td> <code title="">sqsup;</code> </td> <td> U+02290 </td> <tr><td> <code title="">sqsupe;</code> </td> <td> U+02292 </td> <tr><td> <code title="">sqsupset;</code> </td> <td> U+02290 </td> <tr><td> <code title="">sqsupseteq;</code> </td> <td> U+02292 </td> <tr><td> <code title="">squ;</code> </td> <td> U+025A1 </td> <tr><td> <code title="">square;</code> </td> <td> U+025A1 </td> <tr><td> <code title="">squarf;</code> </td> <td> U+025AA </td> <tr><td> <code title="">squf;</code> </td> <td> U+025AA </td> <tr><td> <code title="">srarr;</code> </td> <td> U+02192 </td> <tr><td> <code title="">sscr;</code> </td> <td> U+1D4C8 </td> <tr><td> <code title="">ssetmn;</code> </td> <td> U+02216 </td> <tr><td> <code title="">ssmile;</code> </td> <td> U+02323 </td> <tr><td> <code title="">sstarf;</code> </td> <td> U+022C6 </td> <tr><td> <code title="">star;</code> </td> <td> U+02606 </td> <tr><td> <code title="">starf;</code> </td> <td> U+02605 </td> <tr><td> <code title="">straightepsilon;</code> </td> <td> U+003F5 </td> <tr><td> <code title="">straightphi;</code> </td> <td> U+003D5 </td> <tr><td> <code title="">strns;</code> </td> <td> U+000AF </td> <tr><td> <code title="">sub;</code> </td> <td> U+02282 </td> <tr><td> <code title="">subE;</code> </td> <td> U+02AC5 </td> <tr><td> <code title="">subdot;</code> </td> <td> U+02ABD </td> <tr><td> <code title="">sube;</code> </td> <td> U+02286 </td> <tr><td> <code title="">subedot;</code> </td> <td> U+02AC3 </td> <tr><td> <code title="">submult;</code> </td> <td> U+02AC1 </td> <tr><td> <code title="">subnE;</code> </td> <td> U+02ACB </td> <tr><td> <code title="">subne;</code> </td> <td> U+0228A </td> <tr><td> <code title="">subplus;</code> </td> <td> U+02ABF </td> <tr><td> <code title="">subrarr;</code> </td> <td> U+02979 </td> <tr><td> <code title="">subset;</code> </td> <td> U+02282 </td> <tr><td> <code title="">subseteq;</code> </td> <td> U+02286 </td> <tr><td> <code title="">subseteqq;</code> </td> <td> U+02AC5 </td> <tr><td> <code title="">subsetneq;</code> </td> <td> U+0228A </td> <tr><td> <code title="">subsetneqq;</code> </td> <td> U+02ACB </td> <tr><td> <code title="">subsim;</code> </td> <td> U+02AC7 </td> <tr><td> <code title="">subsub;</code> </td> <td> U+02AD5 </td> <tr><td> <code title="">subsup;</code> </td> <td> U+02AD3 </td> <tr><td> <code title="">succ;</code> </td> <td> U+0227B </td> <tr><td> <code title="">succapprox;</code> </td> <td> U+02AB8 </td> <tr><td> <code title="">succcurlyeq;</code> </td> <td> U+0227D </td> <tr><td> <code title="">succeq;</code> </td> <td> U+02AB0 </td> <tr><td> <code title="">succnapprox;</code> </td> <td> U+02ABA </td> <tr><td> <code title="">succneqq;</code> </td> <td> U+02AB6 </td> <tr><td> <code title="">succnsim;</code> </td> <td> U+022E9 </td> <tr><td> <code title="">succsim;</code> </td> <td> U+0227F </td> <tr><td> <code title="">sum;</code> </td> <td> U+02211 </td> <tr><td> <code title="">sung;</code> </td> <td> U+0266A </td> <tr><td> <code title="">sup1;</code> </td> <td> U+000B9 </td> <tr><td> <code title="">sup1</code> </td> <td> U+000B9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">sup2;</code> </td> <td> U+000B2 </td> <tr><td> <code title="">sup2</code> </td> <td> U+000B2 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">sup3;</code> </td> <td> U+000B3 </td> <tr><td> <code title="">sup3</code> </td> <td> U+000B3 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">sup;</code> </td> <td> U+02283 </td> <tr><td> <code title="">supE;</code> </td> <td> U+02AC6 </td> <tr><td> <code title="">supdot;</code> </td> <td> U+02ABE </td> <tr><td> <code title="">supdsub;</code> </td> <td> U+02AD8 </td> <tr><td> <code title="">supe;</code> </td> <td> U+02287 </td> <tr><td> <code title="">supedot;</code> </td> <td> U+02AC4 </td> <tr><td> <code title="">suphsol;</code> </td> <td> U+027C9 </td> <tr><td> <code title="">suphsub;</code> </td> <td> U+02AD7 </td> <tr><td> <code title="">suplarr;</code> </td> <td> U+0297B </td> <tr><td> <code title="">supmult;</code> </td> <td> U+02AC2 </td> <tr><td> <code title="">supnE;</code> </td> <td> U+02ACC </td> <tr><td> <code title="">supne;</code> </td> <td> U+0228B </td> <tr><td> <code title="">supplus;</code> </td> <td> U+02AC0 </td> <tr><td> <code title="">supset;</code> </td> <td> U+02283 </td> <tr><td> <code title="">supseteq;</code> </td> <td> U+02287 </td> <tr><td> <code title="">supseteqq;</code> </td> <td> U+02AC6 </td> <tr><td> <code title="">supsetneq;</code> </td> <td> U+0228B </td> <tr><td> <code title="">supsetneqq;</code> </td> <td> U+02ACC </td> <tr><td> <code title="">supsim;</code> </td> <td> U+02AC8 </td> <tr><td> <code title="">supsub;</code> </td> <td> U+02AD4 </td> <tr><td> <code title="">supsup;</code> </td> <td> U+02AD6 </td> <tr><td> <code title="">swArr;</code> </td> <td> U+021D9 </td> <tr><td> <code title="">swarhk;</code> </td> <td> U+02926 </td> <tr><td> <code title="">swarr;</code> </td> <td> U+02199 </td> <tr><td> <code title="">swarrow;</code> </td> <td> U+02199 </td> <tr><td> <code title="">swnwar;</code> </td> <td> U+0292A </td> <tr><td> <code title="">szlig;</code> </td> <td> U+000DF </td> <tr><td> <code title="">szlig</code> </td> <td> U+000DF </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">target;</code> </td> <td> U+02316 </td> <tr><td> <code title="">tau;</code> </td> <td> U+003C4 </td> <tr><td> <code title="">tbrk;</code> </td> <td> U+023B4 </td> <tr><td> <code title="">tcaron;</code> </td> <td> U+00165 </td> <tr><td> <code title="">tcedil;</code> </td> <td> U+00163 </td> <tr><td> <code title="">tcy;</code> </td> <td> U+00442 </td> <tr><td> <code title="">tdot;</code> </td> <td> U+020DB </td> <tr><td> <code title="">telrec;</code> </td> <td> U+02315 </td> <tr><td> <code title="">tfr;</code> </td> <td> U+1D531 </td> <tr><td> <code title="">there4;</code> </td> <td> U+02234 </td> <tr><td> <code title="">therefore;</code> </td> <td> U+02234 </td> <tr><td> <code title="">theta;</code> </td> <td> U+003B8 </td> <tr><td> <code title="">thetasym;</code> </td> <td> U+003D1 </td> <tr><td> <code title="">thetav;</code> </td> <td> U+003D1 </td> <tr><td> <code title="">thickapprox;</code> </td> <td> U+02248 </td> <tr><td> <code title="">thicksim;</code> </td> <td> U+0223C </td> <tr><td> <code title="">thinsp;</code> </td> <td> U+02009 </td> <tr><td> <code title="">thkap;</code> </td> <td> U+02248 </td> <tr><td> <code title="">thksim;</code> </td> <td> U+0223C </td> <tr><td> <code title="">thorn;</code> </td> <td> U+000FE </td> <tr><td> <code title="">thorn</code> </td> <td> U+000FE </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">tilde;</code> </td> <td> U+002DC </td> <tr><td> <code title="">times;</code> </td> <td> U+000D7 </td> <tr><td> <code title="">times</code> </td> <td> U+000D7 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">timesb;</code> </td> <td> U+022A0 </td> <tr><td> <code title="">timesbar;</code> </td> <td> U+02A31 </td> <tr><td> <code title="">timesd;</code> </td> <td> U+02A30 </td> <tr><td> <code title="">tint;</code> </td> <td> U+0222D </td> <tr><td> <code title="">toea;</code> </td> <td> U+02928 </td> <tr><td> <code title="">top;</code> </td> <td> U+022A4 </td> <tr><td> <code title="">topbot;</code> </td> <td> U+02336 </td> <tr><td> <code title="">topcir;</code> </td> <td> U+02AF1 </td> <tr><td> <code title="">topf;</code> </td> <td> U+1D565 </td> <tr><td> <code title="">topfork;</code> </td> <td> U+02ADA </td> <tr><td> <code title="">tosa;</code> </td> <td> U+02929 </td> <tr><td> <code title="">tprime;</code> </td> <td> U+02034 </td> <tr><td> <code title="">trade;</code> </td> <td> U+02122 </td> <tr><td> <code title="">triangle;</code> </td> <td> U+025B5 </td> <tr><td> <code title="">triangledown;</code> </td> <td> U+025BF </td> <tr><td> <code title="">triangleleft;</code> </td> <td> U+025C3 </td> <tr><td> <code title="">trianglelefteq;</code> </td> <td> U+022B4 </td> <tr><td> <code title="">triangleq;</code> </td> <td> U+0225C </td> <tr><td> <code title="">triangleright;</code> </td> <td> U+025B9 </td> <tr><td> <code title="">trianglerighteq;</code> </td> <td> U+022B5 </td> <tr><td> <code title="">tridot;</code> </td> <td> U+025EC </td> <tr><td> <code title="">trie;</code> </td> <td> U+0225C </td> <tr><td> <code title="">triminus;</code> </td> <td> U+02A3A </td> <tr><td> <code title="">triplus;</code> </td> <td> U+02A39 </td> <tr><td> <code title="">trisb;</code> </td> <td> U+029CD </td> <tr><td> <code title="">tritime;</code> </td> <td> U+02A3B </td> <tr><td> <code title="">trpezium;</code> </td> <td> U+023E2 </td> <tr><td> <code title="">tscr;</code> </td> <td> U+1D4C9 </td> <tr><td> <code title="">tscy;</code> </td> <td> U+00446 </td> <tr><td> <code title="">tshcy;</code> </td> <td> U+0045B </td> <tr><td> <code title="">tstrok;</code> </td> <td> U+00167 </td> <tr><td> <code title="">twixt;</code> </td> <td> U+0226C </td> <tr><td> <code title="">twoheadleftarrow;</code> </td> <td> U+0219E </td> <tr><td> <code title="">twoheadrightarrow;</code> </td> <td> U+021A0 </td> <tr><td> <code title="">uArr;</code> </td> <td> U+021D1 </td> <tr><td> <code title="">uHar;</code> </td> <td> U+02963 </td> <tr><td> <code title="">uacute;</code> </td> <td> U+000FA </td> <tr><td> <code title="">uacute</code> </td> <td> U+000FA </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">uarr;</code> </td> <td> U+02191 </td> <tr><td> <code title="">ubrcy;</code> </td> <td> U+0045E </td> <tr><td> <code title="">ubreve;</code> </td> <td> U+0016D </td> <tr><td> <code title="">ucirc;</code> </td> <td> U+000FB </td> <tr><td> <code title="">ucirc</code> </td> <td> U+000FB </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">ucy;</code> </td> <td> U+00443 </td> <tr><td> <code title="">udarr;</code> </td> <td> U+021C5 </td> <tr><td> <code title="">udblac;</code> </td> <td> U+00171 </td> <tr><td> <code title="">udhar;</code> </td> <td> U+0296E </td> <tr><td> <code title="">ufisht;</code> </td> <td> U+0297E </td> <tr><td> <code title="">ufr;</code> </td> <td> U+1D532 </td> <tr><td> <code title="">ugrave;</code> </td> <td> U+000F9 </td> <tr><td> <code title="">ugrave</code> </td> <td> U+000F9 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">uharl;</code> </td> <td> U+021BF </td> <tr><td> <code title="">uharr;</code> </td> <td> U+021BE </td> <tr><td> <code title="">uhblk;</code> </td> <td> U+02580 </td> <tr><td> <code title="">ulcorn;</code> </td> <td> U+0231C </td> <tr><td> <code title="">ulcorner;</code> </td> <td> U+0231C </td> <tr><td> <code title="">ulcrop;</code> </td> <td> U+0230F </td> <tr><td> <code title="">ultri;</code> </td> <td> U+025F8 </td> <tr><td> <code title="">umacr;</code> </td> <td> U+0016B </td> <tr><td> <code title="">uml;</code> </td> <td> U+000A8 </td> <tr><td> <code title="">uml</code> </td> <td> U+000A8 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">uogon;</code> </td> <td> U+00173 </td> <tr><td> <code title="">uopf;</code> </td> <td> U+1D566 </td> <tr><td> <code title="">uparrow;</code> </td> <td> U+02191 </td> <tr><td> <code title="">updownarrow;</code> </td> <td> U+02195 </td> <tr><td> <code title="">upharpoonleft;</code> </td> <td> U+021BF </td> <tr><td> <code title="">upharpoonright;</code> </td> <td> U+021BE </td> <tr><td> <code title="">uplus;</code> </td> <td> U+0228E </td> <tr><td> <code title="">upsi;</code> </td> <td> U+003C5 </td> <tr><td> <code title="">upsih;</code> </td> <td> U+003D2 </td> <tr><td> <code title="">upsilon;</code> </td> <td> U+003C5 </td> <tr><td> <code title="">upuparrows;</code> </td> <td> U+021C8 </td> <tr><td> <code title="">urcorn;</code> </td> <td> U+0231D </td> <tr><td> <code title="">urcorner;</code> </td> <td> U+0231D </td> <tr><td> <code title="">urcrop;</code> </td> <td> U+0230E </td> <tr><td> <code title="">uring;</code> </td> <td> U+0016F </td> <tr><td> <code title="">urtri;</code> </td> <td> U+025F9 </td> <tr><td> <code title="">uscr;</code> </td> <td> U+1D4CA </td> <tr><td> <code title="">utdot;</code> </td> <td> U+022F0 </td> <tr><td> <code title="">utilde;</code> </td> <td> U+00169 </td> <tr><td> <code title="">utri;</code> </td> <td> U+025B5 </td> <tr><td> <code title="">utrif;</code> </td> <td> U+025B4 </td> <tr><td> <code title="">uuarr;</code> </td> <td> U+021C8 </td> <tr><td> <code title="">uuml;</code> </td> <td> U+000FC </td> <tr><td> <code title="">uuml</code> </td> <td> U+000FC </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">uwangle;</code> </td> <td> U+029A7 </td> <tr><td> <code title="">vArr;</code> </td> <td> U+021D5 </td> <tr><td> <code title="">vBar;</code> </td> <td> U+02AE8 </td> <tr><td> <code title="">vBarv;</code> </td> <td> U+02AE9 </td> <tr><td> <code title="">vDash;</code> </td> <td> U+022A8 </td> <tr><td> <code title="">vangrt;</code> </td> <td> U+0299C </td> <tr><td> <code title="">varepsilon;</code> </td> <td> U+003F5 </td> <tr><td> <code title="">varkappa;</code> </td> <td> U+003F0 </td> <tr><td> <code title="">varnothing;</code> </td> <td> U+02205 </td> <tr><td> <code title="">varphi;</code> </td> <td> U+003D5 </td> <tr><td> <code title="">varpi;</code> </td> <td> U+003D6 </td> <tr><td> <code title="">varpropto;</code> </td> <td> U+0221D </td> <tr><td> <code title="">varr;</code> </td> <td> U+02195 </td> <tr><td> <code title="">varrho;</code> </td> <td> U+003F1 </td> <tr><td> <code title="">varsigma;</code> </td> <td> U+003C2 </td> <tr><td> <code title="">vartheta;</code> </td> <td> U+003D1 </td> <tr><td> <code title="">vartriangleleft;</code> </td> <td> U+022B2 </td> <tr><td> <code title="">vartriangleright;</code> </td> <td> U+022B3 </td> <tr><td> <code title="">vcy;</code> </td> <td> U+00432 </td> <tr><td> <code title="">vdash;</code> </td> <td> U+022A2 </td> <tr><td> <code title="">vee;</code> </td> <td> U+02228 </td> <tr><td> <code title="">veebar;</code> </td> <td> U+022BB </td> <tr><td> <code title="">veeeq;</code> </td> <td> U+0225A </td> <tr><td> <code title="">vellip;</code> </td> <td> U+022EE </td> <tr><td> <code title="">verbar;</code> </td> <td> U+0007C </td> <tr><td> <code title="">vert;</code> </td> <td> U+0007C </td> <tr><td> <code title="">vfr;</code> </td> <td> U+1D533 </td> <tr><td> <code title="">vltri;</code> </td> <td> U+022B2 </td> <tr><td> <code title="">vopf;</code> </td> <td> U+1D567 </td> <tr><td> <code title="">vprop;</code> </td> <td> U+0221D </td> <tr><td> <code title="">vrtri;</code> </td> <td> U+022B3 </td> <tr><td> <code title="">vscr;</code> </td> <td> U+1D4CB </td> <tr><td> <code title="">vzigzag;</code> </td> <td> U+0299A </td> <tr><td> <code title="">wcirc;</code> </td> <td> U+00175 </td> <tr><td> <code title="">wedbar;</code> </td> <td> U+02A5F </td> <tr><td> <code title="">wedge;</code> </td> <td> U+02227 </td> <tr><td> <code title="">wedgeq;</code> </td> <td> U+02259 </td> <tr><td> <code title="">weierp;</code> </td> <td> U+02118 </td> <tr><td> <code title="">wfr;</code> </td> <td> U+1D534 </td> <tr><td> <code title="">wopf;</code> </td> <td> U+1D568 </td> <tr><td> <code title="">wp;</code> </td> <td> U+02118 </td> <tr><td> <code title="">wr;</code> </td> <td> U+02240 </td> <tr><td> <code title="">wreath;</code> </td> <td> U+02240 </td> <tr><td> <code title="">wscr;</code> </td> <td> U+1D4CC </td> <tr><td> <code title="">xcap;</code> </td> <td> U+022C2 </td> <tr><td> <code title="">xcirc;</code> </td> <td> U+025EF </td> <tr><td> <code title="">xcup;</code> </td> <td> U+022C3 </td> <tr><td> <code title="">xdtri;</code> </td> <td> U+025BD </td> <tr><td> <code title="">xfr;</code> </td> <td> U+1D535 </td> <tr><td> <code title="">xhArr;</code> </td> <td> U+027FA </td> <tr><td> <code title="">xharr;</code> </td> <td> U+027F7 </td> <tr><td> <code title="">xi;</code> </td> <td> U+003BE </td> <tr><td> <code title="">xlArr;</code> </td> <td> U+027F8 </td> <tr><td> <code title="">xlarr;</code> </td> <td> U+027F5 </td> <tr><td> <code title="">xmap;</code> </td> <td> U+027FC </td> <tr><td> <code title="">xnis;</code> </td> <td> U+022FB </td> <tr><td> <code title="">xodot;</code> </td> <td> U+02A00 </td> <tr><td> <code title="">xopf;</code> </td> <td> U+1D569 </td> <tr><td> <code title="">xoplus;</code> </td> <td> U+02A01 </td> <tr><td> <code title="">xotime;</code> </td> <td> U+02A02 </td> <tr><td> <code title="">xrArr;</code> </td> <td> U+027F9 </td> <tr><td> <code title="">xrarr;</code> </td> <td> U+027F6 </td> <tr><td> <code title="">xscr;</code> </td> <td> U+1D4CD </td> <tr><td> <code title="">xsqcup;</code> </td> <td> U+02A06 </td> <tr><td> <code title="">xuplus;</code> </td> <td> U+02A04 </td> <tr><td> <code title="">xutri;</code> </td> <td> U+025B3 </td> <tr><td> <code title="">xvee;</code> </td> <td> U+022C1 </td> <tr><td> <code title="">xwedge;</code> </td> <td> U+022C0 </td> <tr><td> <code title="">yacute;</code> </td> <td> U+000FD </td> <tr><td> <code title="">yacute</code> </td> <td> U+000FD </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">yacy;</code> </td> <td> U+0044F </td> <tr><td> <code title="">ycirc;</code> </td> <td> U+00177 </td> <tr><td> <code title="">ycy;</code> </td> <td> U+0044B </td> <tr><td> <code title="">yen;</code> </td> <td> U+000A5 </td> <tr><td> <code title="">yen</code> </td> <td> U+000A5 </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">yfr;</code> </td> <td> U+1D536 </td> <tr><td> <code title="">yicy;</code> </td> <td> U+00457 </td> <tr><td> <code title="">yopf;</code> </td> <td> U+1D56A </td> <tr><td> <code title="">yscr;</code> </td> <td> U+1D4CE </td> <tr><td> <code title="">yucy;</code> </td> <td> U+0044E </td> <tr><td> <code title="">yuml;</code> </td> <td> U+000FF </td> <tr><td> <code title="">yuml</code> </td> <td> U+000FF </td> </tr><!-- (invalid entity with missing semicolon for legacy support only) --><tr><td> <code title="">zacute;</code> </td> <td> U+0017A </td> <tr><td> <code title="">zcaron;</code> </td> <td> U+0017E </td> <tr><td> <code title="">zcy;</code> </td> <td> U+00437 </td> <tr><td> <code title="">zdot;</code> </td> <td> U+0017C </td> <tr><td> <code title="">zeetrf;</code> </td> <td> U+02128 </td> <tr><td> <code title="">zeta;</code> </td> <td> U+003B6 </td> <tr><td> <code title="">zfr;</code> </td> <td> U+1D537 </td> <tr><td> <code title="">zhcy;</code> </td> <td> U+00436 </td> <tr><td> <code title="">zigrarr;</code> </td> <td> U+021DD </td> <tr><td> <code title="">zopf;</code> </td> <td> U+1D56B </td> <tr><td> <code title="">zscr;</code> </td> <td> U+1D4CF </td> <tr><td> <code title="">zwj;</code> </td> <td> U+0200D </td> <tr><td> <code title="">zwnj;</code> </td> <td> U+0200C </td> </table> - -
\ No newline at end of file diff --git a/parser/html/javasrc/AttributeName.java b/parser/html/javasrc/AttributeName.java deleted file mode 100644 index 7b889e71e..000000000 --- a/parser/html/javasrc/AttributeName.java +++ /dev/null @@ -1,2473 +0,0 @@ -/* - * Copyright (c) 2008-2011 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import java.util.Arrays; - -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NoLength; -import nu.validator.htmlparser.annotation.NsUri; -import nu.validator.htmlparser.annotation.Prefix; -import nu.validator.htmlparser.annotation.QName; -import nu.validator.htmlparser.annotation.Virtual; -import nu.validator.htmlparser.common.Interner; - -public final class AttributeName -// Uncomment to regenerate -// implements Comparable<AttributeName> -{ - // [NOCPP[ - - public static final int NCNAME_HTML = 1; - - public static final int NCNAME_FOREIGN = (1 << 1) | (1 << 2); - - public static final int NCNAME_LANG = (1 << 3); - - public static final int IS_XMLNS = (1 << 4); - - public static final int CASE_FOLDED = (1 << 5); - - public static final int BOOLEAN = (1 << 6); - - // ]NOCPP] - - /** - * An array representing no namespace regardless of namespace mode (HTML, - * SVG, MathML, lang-mapping HTML) used. - */ - static final @NoLength @NsUri String[] ALL_NO_NS = { "", "", "", - // [NOCPP[ - "" - // ]NOCPP] - }; - - /** - * An array that has no namespace for the HTML mode but the XMLNS namespace - * for the SVG and MathML modes. - */ - private static final @NoLength @NsUri String[] XMLNS_NS = { "", - "http://www.w3.org/2000/xmlns/", "http://www.w3.org/2000/xmlns/", - // [NOCPP[ - "" - // ]NOCPP] - }; - - /** - * An array that has no namespace for the HTML mode but the XML namespace - * for the SVG and MathML modes. - */ - private static final @NoLength @NsUri String[] XML_NS = { "", - "http://www.w3.org/XML/1998/namespace", - "http://www.w3.org/XML/1998/namespace", - // [NOCPP[ - "" - // ]NOCPP] - }; - - /** - * An array that has no namespace for the HTML mode but the XLink namespace - * for the SVG and MathML modes. - */ - private static final @NoLength @NsUri String[] XLINK_NS = { "", - "http://www.w3.org/1999/xlink", "http://www.w3.org/1999/xlink", - // [NOCPP[ - "" - // ]NOCPP] - }; - - // [NOCPP[ - /** - * An array that has no namespace for the HTML, SVG and MathML modes but has - * the XML namespace for the lang-mapping HTML mode. - */ - private static final @NoLength @NsUri String[] LANG_NS = { "", "", "", - "http://www.w3.org/XML/1998/namespace" }; - - // ]NOCPP] - - /** - * An array for no prefixes in any mode. - */ - static final @NoLength @Prefix String[] ALL_NO_PREFIX = { null, null, null, - // [NOCPP[ - null - // ]NOCPP] - }; - - /** - * An array for no prefixe in the HTML mode and the <code>xmlns</code> - * prefix in the SVG and MathML modes. - */ - private static final @NoLength @Prefix String[] XMLNS_PREFIX = { null, - "xmlns", "xmlns", - // [NOCPP[ - null - // ]NOCPP] - }; - - /** - * An array for no prefixe in the HTML mode and the <code>xlink</code> - * prefix in the SVG and MathML modes. - */ - private static final @NoLength @Prefix String[] XLINK_PREFIX = { null, - "xlink", "xlink", - // [NOCPP[ - null - // ]NOCPP] - }; - - /** - * An array for no prefixe in the HTML mode and the <code>xml</code> prefix - * in the SVG and MathML modes. - */ - private static final @NoLength @Prefix String[] XML_PREFIX = { null, "xml", - "xml", - // [NOCPP[ - null - // ]NOCPP] - }; - - // [NOCPP[ - - private static final @NoLength @Prefix String[] LANG_PREFIX = { null, null, - null, "xml" }; - - private static @QName String[] COMPUTE_QNAME(String[] local, String[] prefix) { - @QName String[] arr = new String[4]; - for (int i = 0; i < arr.length; i++) { - if (prefix[i] == null) { - arr[i] = local[i]; - } else { - arr[i] = (prefix[i] + ':' + local[i]).intern(); - } - } - return arr; - } - - // ]NOCPP] - - /** - * An initialization helper for having a one name in the SVG mode and - * another name in the other modes. - * - * @param name - * the name for the non-SVG modes - * @param camel - * the name for the SVG mode - * @return the initialized name array - */ - private static @NoLength @Local String[] SVG_DIFFERENT(@Local String name, - @Local String camel) { - @NoLength @Local String[] arr = new String[4]; - arr[0] = name; - arr[1] = name; - arr[2] = camel; - // [NOCPP[ - arr[3] = name; - // ]NOCPP] - return arr; - } - - /** - * An initialization helper for having a one name in the MathML mode and - * another name in the other modes. - * - * @param name - * the name for the non-MathML modes - * @param camel - * the name for the MathML mode - * @return the initialized name array - */ - private static @NoLength @Local String[] MATH_DIFFERENT(@Local String name, - @Local String camel) { - @NoLength @Local String[] arr = new String[4]; - arr[0] = name; - arr[1] = camel; - arr[2] = name; - // [NOCPP[ - arr[3] = name; - // ]NOCPP] - return arr; - } - - /** - * An initialization helper for having a different local name in the HTML - * mode and the SVG and MathML modes. - * - * @param name - * the name for the HTML mode - * @param suffix - * the name for the SVG and MathML modes - * @return the initialized name array - */ - private static @NoLength @Local String[] COLONIFIED_LOCAL( - @Local String name, @Local String suffix) { - @NoLength @Local String[] arr = new String[4]; - arr[0] = name; - arr[1] = suffix; - arr[2] = suffix; - // [NOCPP[ - arr[3] = name; - // ]NOCPP] - return arr; - } - - /** - * An initialization helper for having the same local name in all modes. - * - * @param name - * the name - * @return the initialized name array - */ - static @NoLength @Local String[] SAME_LOCAL(@Local String name) { - @NoLength @Local String[] arr = new String[4]; - arr[0] = name; - arr[1] = name; - arr[2] = name; - // [NOCPP[ - arr[3] = name; - // ]NOCPP] - return arr; - } - - /** - * Returns an attribute name by buffer. - * - * <p> - * C++ ownership: The return value is either released by the caller if the - * attribute is a duplicate or the ownership is transferred to - * HtmlAttributes and released upon clearing or destroying that object. - * - * @param buf - * the buffer - * @param offset - * ignored - * @param length - * length of data - * @param checkNcName - * whether to check ncnameness - * @return an <code>AttributeName</code> corresponding to the argument data - */ - static AttributeName nameByBuffer(@NoLength char[] buf, int offset, - int length - // [NOCPP[ - , boolean checkNcName - // ]NOCPP] - , Interner interner) { - // XXX deal with offset - int hash = AttributeName.bufToHash(buf, length); - int index = Arrays.binarySearch(AttributeName.ATTRIBUTE_HASHES, hash); - if (index < 0) { - return AttributeName.createAttributeName( - Portability.newLocalNameFromBuffer(buf, offset, length, - interner) - // [NOCPP[ - , checkNcName - // ]NOCPP] - ); - } else { - AttributeName attributeName = AttributeName.ATTRIBUTE_NAMES[index]; - @Local String name = attributeName.getLocal(AttributeName.HTML); - if (!Portability.localEqualsBuffer(name, buf, offset, length)) { - return AttributeName.createAttributeName( - Portability.newLocalNameFromBuffer(buf, offset, length, - interner) - // [NOCPP[ - , checkNcName - // ]NOCPP] - ); - } - return attributeName; - } - } - - /** - * This method has to return a unique integer for each well-known - * lower-cased attribute name. - * - * @param buf - * @param len - * @return - */ - private static int bufToHash(@NoLength char[] buf, int len) { - int hash2 = 0; - int hash = len; - hash <<= 5; - hash += buf[0] - 0x60; - int j = len; - for (int i = 0; i < 4 && j > 0; i++) { - j--; - hash <<= 5; - hash += buf[j] - 0x60; - hash2 <<= 6; - hash2 += buf[i] - 0x5F; - } - return hash ^ hash2; - } - - /** - * The mode value for HTML. - */ - public static final int HTML = 0; - - /** - * The mode value for MathML. - */ - public static final int MATHML = 1; - - /** - * The mode value for SVG. - */ - public static final int SVG = 2; - - // [NOCPP[ - - /** - * The mode value for lang-mapping HTML. - */ - public static final int HTML_LANG = 3; - - // ]NOCPP] - - /** - * The namespaces indexable by mode. - */ - private final @NsUri @NoLength String[] uri; - - /** - * The local names indexable by mode. - */ - private final @Local @NoLength String[] local; - - /** - * The prefixes indexably by mode. - */ - private final @Prefix @NoLength String[] prefix; - - // [NOCPP[ - - private final int flags; - - /** - * The qnames indexable by mode. - */ - private final @QName @NoLength String[] qName; - - // ]NOCPP] - - /** - * The startup-time constructor. - * - * @param uri - * the namespace - * @param local - * the local name - * @param prefix - * the prefix - * @param ncname - * the ncnameness - * @param xmlns - * whether this is an xmlns attribute - */ - protected AttributeName(@NsUri @NoLength String[] uri, - @Local @NoLength String[] local, @Prefix @NoLength String[] prefix - // [NOCPP[ - , int flags - // ]NOCPP] - ) { - this.uri = uri; - this.local = local; - this.prefix = prefix; - // [NOCPP[ - this.qName = COMPUTE_QNAME(local, prefix); - this.flags = flags; - // ]NOCPP] - } - - /** - * Creates an <code>AttributeName</code> for a local name. - * - * @param name - * the name - * @param checkNcName - * whether to check ncnameness - * @return an <code>AttributeName</code> - */ - private static AttributeName createAttributeName(@Local String name - // [NOCPP[ - , boolean checkNcName - // ]NOCPP] - ) { - // [NOCPP[ - int flags = NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG; - if (name.startsWith("xmlns:")) { - flags = IS_XMLNS; - } else if (checkNcName && !NCName.isNCName(name)) { - flags = 0; - } - // ]NOCPP] - return new AttributeName(AttributeName.ALL_NO_NS, - AttributeName.SAME_LOCAL(name), ALL_NO_PREFIX, flags); - } - - /** - * Deletes runtime-allocated instances in C++. - */ - @Virtual void release() { - // No-op in Java. - // Implement as |delete this;| in subclass. - } - - /** - * The C++ destructor. - */ - @SuppressWarnings("unused") @Virtual private void destructor() { - Portability.deleteArray(local); - } - - /** - * Clones the attribute using an interner. Returns <code>this</code> in Java - * and for non-dynamic instances in C++. - * - * @param interner - * an interner - * @return a clone - */ - @Virtual public AttributeName cloneAttributeName(Interner interner) { - return this; - } - - // [NOCPP[ - /** - * Creator for use when the XML violation policy requires an attribute name - * to be changed. - * - * @param name - * the name of the attribute to create - */ - static AttributeName create(@Local String name) { - return new AttributeName(AttributeName.ALL_NO_NS, - AttributeName.SAME_LOCAL(name), ALL_NO_PREFIX, - NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - } - - /** - * Queries whether this name is an XML 1.0 4th ed. NCName. - * - * @param mode - * the SVG/MathML/HTML mode - * @return <code>true</code> if this is an NCName in the given mode - */ - public boolean isNcName(int mode) { - return (flags & (1 << mode)) != 0; - } - - /** - * Queries whether this is an <code>xmlns</code> attribute. - * - * @return <code>true</code> if this is an <code>xmlns</code> attribute - */ - public boolean isXmlns() { - return (flags & IS_XMLNS) != 0; - } - - /** - * Queries whether this attribute has a case-folded value in the HTML4 mode - * of the parser. - * - * @return <code>true</code> if the value is case-folded - */ - boolean isCaseFolded() { - return (flags & CASE_FOLDED) != 0; - } - - boolean isBoolean() { - return (flags & BOOLEAN) != 0; - } - - public @QName String getQName(int mode) { - return qName[mode]; - } - - // ]NOCPP] - - public @NsUri String getUri(int mode) { - return uri[mode]; - } - - public @Local String getLocal(int mode) { - return local[mode]; - } - - public @Prefix String getPrefix(int mode) { - return prefix[mode]; - } - - boolean equalsAnother(AttributeName another) { - return this.getLocal(AttributeName.HTML) == another.getLocal(AttributeName.HTML); - } - - // START CODE ONLY USED FOR GENERATING CODE uncomment to regenerate - -// /** -// * @see java.lang.Object#toString() -// */ -// @Override public String toString() { -// return "(" + formatNs() + ", " + formatLocal() + ", " + formatPrefix() -// + ", " + formatFlags() + ")"; -// } -// -// private String formatFlags() { -// StringBuilder builder = new StringBuilder(); -// if ((flags & NCNAME_HTML) != 0) { -// if (builder.length() != 0) { -// builder.append(" | "); -// } -// builder.append("NCNAME_HTML"); -// } -// if ((flags & NCNAME_FOREIGN) != 0) { -// if (builder.length() != 0) { -// builder.append(" | "); -// } -// builder.append("NCNAME_FOREIGN"); -// } -// if ((flags & NCNAME_LANG) != 0) { -// if (builder.length() != 0) { -// builder.append(" | "); -// } -// builder.append("NCNAME_LANG"); -// } -// if (isXmlns()) { -// if (builder.length() != 0) { -// builder.append(" | "); -// } -// builder.append("IS_XMLNS"); -// } -// if (isCaseFolded()) { -// if (builder.length() != 0) { -// builder.append(" | "); -// } -// builder.append("CASE_FOLDED"); -// } -// if (isBoolean()) { -// if (builder.length() != 0) { -// builder.append(" | "); -// } -// builder.append("BOOLEAN"); -// } -// if (builder.length() == 0) { -// return "0"; -// } -// return builder.toString(); -// } -// -// public int compareTo(AttributeName other) { -// int thisHash = this.hash(); -// int otherHash = other.hash(); -// if (thisHash < otherHash) { -// return -1; -// } else if (thisHash == otherHash) { -// return 0; -// } else { -// return 1; -// } -// } -// -// private String formatPrefix() { -// if (prefix[0] == null && prefix[1] == null && prefix[2] == null -// && prefix[3] == null) { -// return "ALL_NO_PREFIX"; -// } else if (prefix[0] == null && prefix[1] == prefix[2] -// && prefix[3] == null) { -// if ("xmlns".equals(prefix[1])) { -// return "XMLNS_PREFIX"; -// } else if ("xml".equals(prefix[1])) { -// return "XML_PREFIX"; -// } else if ("xlink".equals(prefix[1])) { -// return "XLINK_PREFIX"; -// } else { -// throw new IllegalStateException(); -// } -// } else if (prefix[0] == null && prefix[1] == null && prefix[2] == null -// && prefix[3] == "xml") { -// return "LANG_PREFIX"; -// } else { -// throw new IllegalStateException(); -// } -// } -// -// private String formatLocal() { -// if (local[0] == local[1] && local[0] == local[3] -// && local[0] != local[2]) { -// return "SVG_DIFFERENT(\"" + local[0] + "\", \"" + local[2] + "\")"; -// } -// if (local[0] == local[2] && local[0] == local[3] -// && local[0] != local[1]) { -// return "MATH_DIFFERENT(\"" + local[0] + "\", \"" + local[1] + "\")"; -// } -// if (local[0] == local[3] && local[1] == local[2] -// && local[0] != local[1]) { -// return "COLONIFIED_LOCAL(\"" + local[0] + "\", \"" + local[1] -// + "\")"; -// } -// for (int i = 1; i < local.length; i++) { -// if (local[0] != local[i]) { -// throw new IllegalStateException(); -// } -// } -// return "SAME_LOCAL(\"" + local[0] + "\")"; -// } -// -// private String formatNs() { -// if (uri[0] == "" && uri[1] == "" && uri[2] == "" && uri[3] == "") { -// return "ALL_NO_NS"; -// } else if (uri[0] == "" && uri[1] == uri[2] && uri[3] == "") { -// if ("http://www.w3.org/2000/xmlns/".equals(uri[1])) { -// return "XMLNS_NS"; -// } else if ("http://www.w3.org/XML/1998/namespace".equals(uri[1])) { -// return "XML_NS"; -// } else if ("http://www.w3.org/1999/xlink".equals(uri[1])) { -// return "XLINK_NS"; -// } else { -// throw new IllegalStateException(); -// } -// } else if (uri[0] == "" && uri[1] == "" && uri[2] == "" -// && uri[3] == "http://www.w3.org/XML/1998/namespace") { -// return "LANG_NS"; -// } else { -// throw new IllegalStateException(); -// } -// } -// -// private String constName() { -// String name = getLocal(HTML); -// char[] buf = new char[name.length()]; -// for (int i = 0; i < name.length(); i++) { -// char c = name.charAt(i); -// if (c == '-' || c == ':') { -// buf[i] = '_'; -// } else if (c >= 'a' && c <= 'z') { -// buf[i] = (char) (c - 0x20); -// } else { -// buf[i] = c; -// } -// } -// return new String(buf); -// } -// -// private int hash() { -// String name = getLocal(HTML); -// return bufToHash(name.toCharArray(), name.length()); -// } -// -// /** -// * Regenerate self -// * -// * @param args -// */ -// public static void main(String[] args) { -// Arrays.sort(ATTRIBUTE_NAMES); -// for (int i = 1; i < ATTRIBUTE_NAMES.length; i++) { -// if (ATTRIBUTE_NAMES[i].hash() == ATTRIBUTE_NAMES[i - 1].hash()) { -// System.err.println("Hash collision: " -// + ATTRIBUTE_NAMES[i].getLocal(HTML) + ", " -// + ATTRIBUTE_NAMES[i - 1].getLocal(HTML)); -// return; -// } -// } -// for (int i = 0; i < ATTRIBUTE_NAMES.length; i++) { -// AttributeName att = ATTRIBUTE_NAMES[i]; -// System.out.println("public static final AttributeName " -// + att.constName() + " = new AttributeName" + att.toString() -// + ";"); -// } -// System.out.println("private final static @NoLength AttributeName[] ATTRIBUTE_NAMES = {"); -// for (int i = 0; i < ATTRIBUTE_NAMES.length; i++) { -// AttributeName att = ATTRIBUTE_NAMES[i]; -// System.out.println(att.constName() + ","); -// } -// System.out.println("};"); -// System.out.println("private final static int[] ATTRIBUTE_HASHES = {"); -// for (int i = 0; i < ATTRIBUTE_NAMES.length; i++) { -// AttributeName att = ATTRIBUTE_NAMES[i]; -// System.out.println(Integer.toString(att.hash()) + ","); -// } -// System.out.println("};"); -// } - - // START GENERATED CODE - public static final AttributeName D = new AttributeName(ALL_NO_NS, SAME_LOCAL("d"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName K = new AttributeName(ALL_NO_NS, SAME_LOCAL("k"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName R = new AttributeName(ALL_NO_NS, SAME_LOCAL("r"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName X = new AttributeName(ALL_NO_NS, SAME_LOCAL("x"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName Y = new AttributeName(ALL_NO_NS, SAME_LOCAL("y"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName Z = new AttributeName(ALL_NO_NS, SAME_LOCAL("z"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BY = new AttributeName(ALL_NO_NS, SAME_LOCAL("by"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CX = new AttributeName(ALL_NO_NS, SAME_LOCAL("cx"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CY = new AttributeName(ALL_NO_NS, SAME_LOCAL("cy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DX = new AttributeName(ALL_NO_NS, SAME_LOCAL("dx"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DY = new AttributeName(ALL_NO_NS, SAME_LOCAL("dy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName G2 = new AttributeName(ALL_NO_NS, SAME_LOCAL("g2"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName G1 = new AttributeName(ALL_NO_NS, SAME_LOCAL("g1"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FX = new AttributeName(ALL_NO_NS, SAME_LOCAL("fx"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FY = new AttributeName(ALL_NO_NS, SAME_LOCAL("fy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName K4 = new AttributeName(ALL_NO_NS, SAME_LOCAL("k4"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName K2 = new AttributeName(ALL_NO_NS, SAME_LOCAL("k2"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName K3 = new AttributeName(ALL_NO_NS, SAME_LOCAL("k3"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName K1 = new AttributeName(ALL_NO_NS, SAME_LOCAL("k1"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ID = new AttributeName(ALL_NO_NS, SAME_LOCAL("id"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName IN = new AttributeName(ALL_NO_NS, SAME_LOCAL("in"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName U2 = new AttributeName(ALL_NO_NS, SAME_LOCAL("u2"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName U1 = new AttributeName(ALL_NO_NS, SAME_LOCAL("u1"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RT = new AttributeName(ALL_NO_NS, SAME_LOCAL("rt"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RX = new AttributeName(ALL_NO_NS, SAME_LOCAL("rx"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RY = new AttributeName(ALL_NO_NS, SAME_LOCAL("ry"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TO = new AttributeName(ALL_NO_NS, SAME_LOCAL("to"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName Y2 = new AttributeName(ALL_NO_NS, SAME_LOCAL("y2"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName Y1 = new AttributeName(ALL_NO_NS, SAME_LOCAL("y1"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName X1 = new AttributeName(ALL_NO_NS, SAME_LOCAL("x1"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName X2 = new AttributeName(ALL_NO_NS, SAME_LOCAL("x2"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ALT = new AttributeName(ALL_NO_NS, SAME_LOCAL("alt"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DIR = new AttributeName(ALL_NO_NS, SAME_LOCAL("dir"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName DUR = new AttributeName(ALL_NO_NS, SAME_LOCAL("dur"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName END = new AttributeName(ALL_NO_NS, SAME_LOCAL("end"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("for"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName IN2 = new AttributeName(ALL_NO_NS, SAME_LOCAL("in2"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MAX = new AttributeName(ALL_NO_NS, SAME_LOCAL("max"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("min"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LOW = new AttributeName(ALL_NO_NS, SAME_LOCAL("low"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REL = new AttributeName(ALL_NO_NS, SAME_LOCAL("rel"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REV = new AttributeName(ALL_NO_NS, SAME_LOCAL("rev"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SRC = new AttributeName(ALL_NO_NS, SAME_LOCAL("src"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName AXIS = new AttributeName(ALL_NO_NS, SAME_LOCAL("axis"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ABBR = new AttributeName(ALL_NO_NS, SAME_LOCAL("abbr"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BBOX = new AttributeName(ALL_NO_NS, SAME_LOCAL("bbox"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CITE = new AttributeName(ALL_NO_NS, SAME_LOCAL("cite"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CODE = new AttributeName(ALL_NO_NS, SAME_LOCAL("code"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BIAS = new AttributeName(ALL_NO_NS, SAME_LOCAL("bias"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLS = new AttributeName(ALL_NO_NS, SAME_LOCAL("cols"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLIP = new AttributeName(ALL_NO_NS, SAME_LOCAL("clip"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CHAR = new AttributeName(ALL_NO_NS, SAME_LOCAL("char"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BASE = new AttributeName(ALL_NO_NS, SAME_LOCAL("base"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName EDGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("edge"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DATA = new AttributeName(ALL_NO_NS, SAME_LOCAL("data"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FILL = new AttributeName(ALL_NO_NS, SAME_LOCAL("fill"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FROM = new AttributeName(ALL_NO_NS, SAME_LOCAL("from"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FORM = new AttributeName(ALL_NO_NS, SAME_LOCAL("form"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("face"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HIGH = new AttributeName(ALL_NO_NS, SAME_LOCAL("high"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HREF = new AttributeName(ALL_NO_NS, SAME_LOCAL("href"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OPEN = new AttributeName(ALL_NO_NS, SAME_LOCAL("open"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ICON = new AttributeName(ALL_NO_NS, SAME_LOCAL("icon"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NAME = new AttributeName(ALL_NO_NS, SAME_LOCAL("name"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MODE = new AttributeName(ALL_NO_NS, SAME_LOCAL("mode"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MASK = new AttributeName(ALL_NO_NS, SAME_LOCAL("mask"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LINK = new AttributeName(ALL_NO_NS, SAME_LOCAL("link"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LANG = new AttributeName(LANG_NS, SAME_LOCAL("lang"), LANG_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LOOP = new AttributeName(ALL_NO_NS, SAME_LOCAL("loop"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LIST = new AttributeName(ALL_NO_NS, SAME_LOCAL("list"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TYPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("type"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName WHEN = new AttributeName(ALL_NO_NS, SAME_LOCAL("when"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName WRAP = new AttributeName(ALL_NO_NS, SAME_LOCAL("wrap"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TEXT = new AttributeName(ALL_NO_NS, SAME_LOCAL("text"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PATH = new AttributeName(ALL_NO_NS, SAME_LOCAL("path"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PING = new AttributeName(ALL_NO_NS, SAME_LOCAL("ping"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REFX = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("refx", "refX"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REFY = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("refy", "refY"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("size"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SEED = new AttributeName(ALL_NO_NS, SAME_LOCAL("seed"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ROWS = new AttributeName(ALL_NO_NS, SAME_LOCAL("rows"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPAN = new AttributeName(ALL_NO_NS, SAME_LOCAL("span"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STEP = new AttributeName(ALL_NO_NS, SAME_LOCAL("step"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName ROLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("role"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XREF = new AttributeName(ALL_NO_NS, SAME_LOCAL("xref"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ASYNC = new AttributeName(ALL_NO_NS, SAME_LOCAL("async"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName ALINK = new AttributeName(ALL_NO_NS, SAME_LOCAL("alink"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ALIGN = new AttributeName(ALL_NO_NS, SAME_LOCAL("align"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName CLOSE = new AttributeName(ALL_NO_NS, SAME_LOCAL("close"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("color"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLASS = new AttributeName(ALL_NO_NS, SAME_LOCAL("class"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLEAR = new AttributeName(ALL_NO_NS, SAME_LOCAL("clear"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName BEGIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("begin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DEPTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("depth"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DEFER = new AttributeName(ALL_NO_NS, SAME_LOCAL("defer"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName FENCE = new AttributeName(ALL_NO_NS, SAME_LOCAL("fence"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FRAME = new AttributeName(ALL_NO_NS, SAME_LOCAL("frame"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName ISMAP = new AttributeName(ALL_NO_NS, SAME_LOCAL("ismap"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName ONEND = new AttributeName(ALL_NO_NS, SAME_LOCAL("onend"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName INDEX = new AttributeName(ALL_NO_NS, SAME_LOCAL("index"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ORDER = new AttributeName(ALL_NO_NS, SAME_LOCAL("order"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OTHER = new AttributeName(ALL_NO_NS, SAME_LOCAL("other"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCUT = new AttributeName(ALL_NO_NS, SAME_LOCAL("oncut"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NARGS = new AttributeName(ALL_NO_NS, SAME_LOCAL("nargs"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MEDIA = new AttributeName(ALL_NO_NS, SAME_LOCAL("media"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LABEL = new AttributeName(ALL_NO_NS, SAME_LOCAL("label"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LOCAL = new AttributeName(ALL_NO_NS, SAME_LOCAL("local"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName WIDTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("width"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TITLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("title"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VLINK = new AttributeName(ALL_NO_NS, SAME_LOCAL("vlink"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VALUE = new AttributeName(ALL_NO_NS, SAME_LOCAL("value"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SLOPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("slope"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SHAPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("shape"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName SCOPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("scope"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName SCALE = new AttributeName(ALL_NO_NS, SAME_LOCAL("scale"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPEED = new AttributeName(ALL_NO_NS, SAME_LOCAL("speed"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STYLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("style"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RULES = new AttributeName(ALL_NO_NS, SAME_LOCAL("rules"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName STEMH = new AttributeName(ALL_NO_NS, SAME_LOCAL("stemh"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SIZES = new AttributeName(ALL_NO_NS, SAME_LOCAL("sizes"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STEMV = new AttributeName(ALL_NO_NS, SAME_LOCAL("stemv"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName START = new AttributeName(ALL_NO_NS, SAME_LOCAL("start"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XMLNS = new AttributeName(XMLNS_NS, SAME_LOCAL("xmlns"), ALL_NO_PREFIX, IS_XMLNS); - public static final AttributeName ACCEPT = new AttributeName(ALL_NO_NS, SAME_LOCAL("accept"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACCENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("accent"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ASCENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("ascent"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACTIVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("active"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName ALTIMG = new AttributeName(ALL_NO_NS, SAME_LOCAL("altimg"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACTION = new AttributeName(ALL_NO_NS, SAME_LOCAL("action"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BORDER = new AttributeName(ALL_NO_NS, SAME_LOCAL("border"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CURSOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("cursor"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COORDS = new AttributeName(ALL_NO_NS, SAME_LOCAL("coords"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FILTER = new AttributeName(ALL_NO_NS, SAME_LOCAL("filter"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FORMAT = new AttributeName(ALL_NO_NS, SAME_LOCAL("format"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HIDDEN = new AttributeName(ALL_NO_NS, SAME_LOCAL("hidden"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("hspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("height"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmove"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONLOAD = new AttributeName(ALL_NO_NS, SAME_LOCAL("onload"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAG = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondrag"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ORIGIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("origin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONZOOM = new AttributeName(ALL_NO_NS, SAME_LOCAL("onzoom"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONHELP = new AttributeName(ALL_NO_NS, SAME_LOCAL("onhelp"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONSTOP = new AttributeName(ALL_NO_NS, SAME_LOCAL("onstop"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDROP = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondrop"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBLUR = new AttributeName(ALL_NO_NS, SAME_LOCAL("onblur"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OBJECT = new AttributeName(ALL_NO_NS, SAME_LOCAL("object"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OFFSET = new AttributeName(ALL_NO_NS, SAME_LOCAL("offset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ORIENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("orient"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCOPY = new AttributeName(ALL_NO_NS, SAME_LOCAL("oncopy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NOWRAP = new AttributeName(ALL_NO_NS, SAME_LOCAL("nowrap"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName NOHREF = new AttributeName(ALL_NO_NS, SAME_LOCAL("nohref"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName MACROS = new AttributeName(ALL_NO_NS, SAME_LOCAL("macros"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName METHOD = new AttributeName(ALL_NO_NS, SAME_LOCAL("method"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName LOWSRC = new AttributeName(ALL_NO_NS, SAME_LOCAL("lowsrc"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("lspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LQUOTE = new AttributeName(ALL_NO_NS, SAME_LOCAL("lquote"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName USEMAP = new AttributeName(ALL_NO_NS, SAME_LOCAL("usemap"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName WIDTHS = new AttributeName(ALL_NO_NS, SAME_LOCAL("widths"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TARGET = new AttributeName(ALL_NO_NS, SAME_LOCAL("target"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VALUES = new AttributeName(ALL_NO_NS, SAME_LOCAL("values"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VALIGN = new AttributeName(ALL_NO_NS, SAME_LOCAL("valign"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName VSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("vspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName POSTER = new AttributeName(ALL_NO_NS, SAME_LOCAL("poster"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName POINTS = new AttributeName(ALL_NO_NS, SAME_LOCAL("points"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PROMPT = new AttributeName(ALL_NO_NS, SAME_LOCAL("prompt"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SRCDOC = new AttributeName(ALL_NO_NS, SAME_LOCAL("srcdoc"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCOPED = new AttributeName(ALL_NO_NS, SAME_LOCAL("scoped"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STRING = new AttributeName(ALL_NO_NS, SAME_LOCAL("string"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCHEME = new AttributeName(ALL_NO_NS, SAME_LOCAL("scheme"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RADIUS = new AttributeName(ALL_NO_NS, SAME_LOCAL("radius"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RESULT = new AttributeName(ALL_NO_NS, SAME_LOCAL("result"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPEAT = new AttributeName(ALL_NO_NS, SAME_LOCAL("repeat"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SRCSET = new AttributeName(ALL_NO_NS, SAME_LOCAL("srcset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("rspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ROTATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("rotate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RQUOTE = new AttributeName(ALL_NO_NS, SAME_LOCAL("rquote"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ALTTEXT = new AttributeName(ALL_NO_NS, SAME_LOCAL("alttext"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARCHIVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("archive"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName AZIMUTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("azimuth"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLOSURE = new AttributeName(ALL_NO_NS, SAME_LOCAL("closure"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CHECKED = new AttributeName(ALL_NO_NS, SAME_LOCAL("checked"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName CLASSID = new AttributeName(ALL_NO_NS, SAME_LOCAL("classid"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CHAROFF = new AttributeName(ALL_NO_NS, SAME_LOCAL("charoff"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BGCOLOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("bgcolor"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLSPAN = new AttributeName(ALL_NO_NS, SAME_LOCAL("colspan"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CHARSET = new AttributeName(ALL_NO_NS, SAME_LOCAL("charset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COMPACT = new AttributeName(ALL_NO_NS, SAME_LOCAL("compact"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName CONTENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("content"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ENCTYPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("enctype"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName DATASRC = new AttributeName(ALL_NO_NS, SAME_LOCAL("datasrc"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DATAFLD = new AttributeName(ALL_NO_NS, SAME_LOCAL("datafld"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DECLARE = new AttributeName(ALL_NO_NS, SAME_LOCAL("declare"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName DISPLAY = new AttributeName(ALL_NO_NS, SAME_LOCAL("display"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DIVISOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("divisor"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DEFAULT = new AttributeName(ALL_NO_NS, SAME_LOCAL("default"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName DESCENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("descent"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KERNING = new AttributeName(ALL_NO_NS, SAME_LOCAL("kerning"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HANGING = new AttributeName(ALL_NO_NS, SAME_LOCAL("hanging"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HEADERS = new AttributeName(ALL_NO_NS, SAME_LOCAL("headers"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONPASTE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onpaste"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCLICK = new AttributeName(ALL_NO_NS, SAME_LOCAL("onclick"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OPTIMUM = new AttributeName(ALL_NO_NS, SAME_LOCAL("optimum"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEGIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbegin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONKEYUP = new AttributeName(ALL_NO_NS, SAME_LOCAL("onkeyup"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFOCUS = new AttributeName(ALL_NO_NS, SAME_LOCAL("onfocus"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONERROR = new AttributeName(ALL_NO_NS, SAME_LOCAL("onerror"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONINPUT = new AttributeName(ALL_NO_NS, SAME_LOCAL("oninput"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONABORT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onabort"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONSTART = new AttributeName(ALL_NO_NS, SAME_LOCAL("onstart"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONRESET = new AttributeName(ALL_NO_NS, SAME_LOCAL("onreset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OPACITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("opacity"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NOSHADE = new AttributeName(ALL_NO_NS, SAME_LOCAL("noshade"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName MINSIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("minsize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MAXSIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("maxsize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LARGEOP = new AttributeName(ALL_NO_NS, SAME_LOCAL("largeop"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNICODE = new AttributeName(ALL_NO_NS, SAME_LOCAL("unicode"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TARGETX = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("targetx", "targetX"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TARGETY = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("targety", "targetY"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VIEWBOX = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("viewbox", "viewBox"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERSION = new AttributeName(ALL_NO_NS, SAME_LOCAL("version"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PATTERN = new AttributeName(ALL_NO_NS, SAME_LOCAL("pattern"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PROFILE = new AttributeName(ALL_NO_NS, SAME_LOCAL("profile"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("spacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RESTART = new AttributeName(ALL_NO_NS, SAME_LOCAL("restart"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ROWSPAN = new AttributeName(ALL_NO_NS, SAME_LOCAL("rowspan"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SANDBOX = new AttributeName(ALL_NO_NS, SAME_LOCAL("sandbox"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SUMMARY = new AttributeName(ALL_NO_NS, SAME_LOCAL("summary"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STANDBY = new AttributeName(ALL_NO_NS, SAME_LOCAL("standby"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPLACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("replace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName AUTOPLAY = new AttributeName(ALL_NO_NS, SAME_LOCAL("autoplay"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ADDITIVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("additive"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CALCMODE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("calcmode", "calcMode"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CODETYPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("codetype"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CODEBASE = new AttributeName(ALL_NO_NS, SAME_LOCAL("codebase"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CONTROLS = new AttributeName(ALL_NO_NS, SAME_LOCAL("controls"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BEVELLED = new AttributeName(ALL_NO_NS, SAME_LOCAL("bevelled"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BASELINE = new AttributeName(ALL_NO_NS, SAME_LOCAL("baseline"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName EXPONENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("exponent"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName EDGEMODE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("edgemode", "edgeMode"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ENCODING = new AttributeName(ALL_NO_NS, SAME_LOCAL("encoding"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GLYPHREF = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("glyphref", "glyphRef"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DATETIME = new AttributeName(ALL_NO_NS, SAME_LOCAL("datetime"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DISABLED = new AttributeName(ALL_NO_NS, SAME_LOCAL("disabled"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName FONTSIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("fontsize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KEYTIMES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("keytimes", "keyTimes"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PANOSE_1 = new AttributeName(ALL_NO_NS, SAME_LOCAL("panose-1"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HREFLANG = new AttributeName(ALL_NO_NS, SAME_LOCAL("hreflang"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONRESIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onresize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCHANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onchange"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBOUNCE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbounce"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONUNLOAD = new AttributeName(ALL_NO_NS, SAME_LOCAL("onunload"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFINISH = new AttributeName(ALL_NO_NS, SAME_LOCAL("onfinish"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONSCROLL = new AttributeName(ALL_NO_NS, SAME_LOCAL("onscroll"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OPERATOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("operator"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OVERFLOW = new AttributeName(ALL_NO_NS, SAME_LOCAL("overflow"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONSUBMIT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onsubmit"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONREPEAT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onrepeat"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONSELECT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onselect"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NOTATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("notation"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NORESIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("noresize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName MANIFEST = new AttributeName(ALL_NO_NS, SAME_LOCAL("manifest"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MATHSIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("mathsize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MULTIPLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("multiple"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName LONGDESC = new AttributeName(ALL_NO_NS, SAME_LOCAL("longdesc"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LANGUAGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("language"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TEMPLATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("template"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TABINDEX = new AttributeName(ALL_NO_NS, SAME_LOCAL("tabindex"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PROPERTY = new AttributeName(ALL_NO_NS, SAME_LOCAL("property"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName READONLY = new AttributeName(ALL_NO_NS, SAME_LOCAL("readonly"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName SELECTED = new AttributeName(ALL_NO_NS, SAME_LOCAL("selected"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName ROWLINES = new AttributeName(ALL_NO_NS, SAME_LOCAL("rowlines"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SEAMLESS = new AttributeName(ALL_NO_NS, SAME_LOCAL("seamless"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ROWALIGN = new AttributeName(ALL_NO_NS, SAME_LOCAL("rowalign"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STRETCHY = new AttributeName(ALL_NO_NS, SAME_LOCAL("stretchy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REQUIRED = new AttributeName(ALL_NO_NS, SAME_LOCAL("required"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName XML_BASE = new AttributeName(XML_NS, COLONIFIED_LOCAL("xml:base", "base"), XML_PREFIX, NCNAME_FOREIGN); - public static final AttributeName XML_LANG = new AttributeName(XML_NS, COLONIFIED_LOCAL("xml:lang", "lang"), XML_PREFIX, NCNAME_FOREIGN); - public static final AttributeName X_HEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("x-height"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_OWNS = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-owns"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName AUTOFOCUS = new AttributeName(ALL_NO_NS, SAME_LOCAL("autofocus"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName ARIA_SORT = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-sort"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACCESSKEY = new AttributeName(ALL_NO_NS, SAME_LOCAL("accesskey"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_BUSY = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-busy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_GRAB = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-grab"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName AMPLITUDE = new AttributeName(ALL_NO_NS, SAME_LOCAL("amplitude"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_LIVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-live"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLIP_RULE = new AttributeName(ALL_NO_NS, SAME_LOCAL("clip-rule"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLIP_PATH = new AttributeName(ALL_NO_NS, SAME_LOCAL("clip-path"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName EQUALROWS = new AttributeName(ALL_NO_NS, SAME_LOCAL("equalrows"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ELEVATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("elevation"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DIRECTION = new AttributeName(ALL_NO_NS, SAME_LOCAL("direction"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DRAGGABLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("draggable"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FILL_RULE = new AttributeName(ALL_NO_NS, SAME_LOCAL("fill-rule"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONTSTYLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("fontstyle"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_SIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-size"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KEYSYSTEM = new AttributeName(ALL_NO_NS, SAME_LOCAL("keysystem"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KEYPOINTS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("keypoints", "keyPoints"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HIDEFOCUS = new AttributeName(ALL_NO_NS, SAME_LOCAL("hidefocus"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMESSAGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmessage"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName INTERCEPT = new AttributeName(ALL_NO_NS, SAME_LOCAL("intercept"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAGEND = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondragend"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOVEEND = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmoveend"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONINVALID = new AttributeName(ALL_NO_NS, SAME_LOCAL("oninvalid"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName INTEGRITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("integrity"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONKEYDOWN = new AttributeName(ALL_NO_NS, SAME_LOCAL("onkeydown"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFOCUSIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("onfocusin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEUP = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmouseup"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName INPUTMODE = new AttributeName(ALL_NO_NS, SAME_LOCAL("inputmode"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONROWEXIT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onrowexit"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MATHCOLOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("mathcolor"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MASKUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("maskunits", "maskUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MAXLENGTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("maxlength"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LINEBREAK = new AttributeName(ALL_NO_NS, SAME_LOCAL("linebreak"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TRANSFORM = new AttributeName(ALL_NO_NS, SAME_LOCAL("transform"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName V_HANGING = new AttributeName(ALL_NO_NS, SAME_LOCAL("v-hanging"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VALUETYPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("valuetype"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName POINTSATZ = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("pointsatz", "pointsAtZ"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName POINTSATX = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("pointsatx", "pointsAtX"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName POINTSATY = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("pointsaty", "pointsAtY"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SYMMETRIC = new AttributeName(ALL_NO_NS, SAME_LOCAL("symmetric"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCROLLING = new AttributeName(ALL_NO_NS, SAME_LOCAL("scrolling"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName REPEATDUR = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("repeatdur", "repeatDur"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SELECTION = new AttributeName(ALL_NO_NS, SAME_LOCAL("selection"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SEPARATOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("separator"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XML_SPACE = new AttributeName(XML_NS, COLONIFIED_LOCAL("xml:space", "space"), XML_PREFIX, NCNAME_FOREIGN); - public static final AttributeName AUTOSUBMIT = new AttributeName(ALL_NO_NS, SAME_LOCAL("autosubmit"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN); - public static final AttributeName ALPHABETIC = new AttributeName(ALL_NO_NS, SAME_LOCAL("alphabetic"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACTIONTYPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("actiontype"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACCUMULATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("accumulate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_LEVEL = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-level"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLUMNSPAN = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnspan"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CAP_HEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("cap-height"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BACKGROUND = new AttributeName(ALL_NO_NS, SAME_LOCAL("background"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GLYPH_NAME = new AttributeName(ALL_NO_NS, SAME_LOCAL("glyph-name"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GROUPALIGN = new AttributeName(ALL_NO_NS, SAME_LOCAL("groupalign"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONTFAMILY = new AttributeName(ALL_NO_NS, SAME_LOCAL("fontfamily"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONTWEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("fontweight"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_STYLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-style"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KEYSPLINES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("keysplines", "keySplines"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HTTP_EQUIV = new AttributeName(ALL_NO_NS, SAME_LOCAL("http-equiv"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONACTIVATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onactivate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OCCURRENCE = new AttributeName(ALL_NO_NS, SAME_LOCAL("occurrence"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName IRRELEVANT = new AttributeName(ALL_NO_NS, SAME_LOCAL("irrelevant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDBLCLICK = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondblclick"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAGDROP = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondragdrop"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONKEYPRESS = new AttributeName(ALL_NO_NS, SAME_LOCAL("onkeypress"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONROWENTER = new AttributeName(ALL_NO_NS, SAME_LOCAL("onrowenter"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAGOVER = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondragover"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFOCUSOUT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onfocusout"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEOUT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmouseout"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName NUMOCTAVES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("numoctaves", "numOctaves"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARKER_MID = new AttributeName(ALL_NO_NS, SAME_LOCAL("marker-mid"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARKER_END = new AttributeName(ALL_NO_NS, SAME_LOCAL("marker-end"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TEXTLENGTH = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("textlength", "textLength"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VISIBILITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("visibility"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VIEWTARGET = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("viewtarget", "viewTarget"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERT_ADV_Y = new AttributeName(ALL_NO_NS, SAME_LOCAL("vert-adv-y"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PATHLENGTH = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("pathlength", "pathLength"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPEAT_MAX = new AttributeName(ALL_NO_NS, SAME_LOCAL("repeat-max"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RADIOGROUP = new AttributeName(ALL_NO_NS, SAME_LOCAL("radiogroup"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STOP_COLOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("stop-color"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SEPARATORS = new AttributeName(ALL_NO_NS, SAME_LOCAL("separators"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPEAT_MIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("repeat-min"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ROWSPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("rowspacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ZOOMANDPAN = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("zoomandpan", "zoomAndPan"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XLINK_TYPE = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:type", "type"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName XLINK_ROLE = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:role", "role"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName XLINK_HREF = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:href", "href"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName XLINK_SHOW = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:show", "show"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName ACCENTUNDER = new AttributeName(ALL_NO_NS, SAME_LOCAL("accentunder"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_SECRET = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-secret"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_ATOMIC = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-atomic"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_HIDDEN = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-hidden"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_FLOWTO = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-flowto"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARABIC_FORM = new AttributeName(ALL_NO_NS, SAME_LOCAL("arabic-form"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CELLPADDING = new AttributeName(ALL_NO_NS, SAME_LOCAL("cellpadding"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CELLSPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("cellspacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLUMNWIDTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnwidth"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CROSSORIGIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("crossorigin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLUMNALIGN = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnalign"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLUMNLINES = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnlines"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CONTEXTMENU = new AttributeName(ALL_NO_NS, SAME_LOCAL("contextmenu"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BASEPROFILE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("baseprofile", "baseProfile"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_FAMILY = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-family"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FRAMEBORDER = new AttributeName(ALL_NO_NS, SAME_LOCAL("frameborder"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FILTERUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("filterunits", "filterUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FLOOD_COLOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("flood-color"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_WEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-weight"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HORIZ_ADV_X = new AttributeName(ALL_NO_NS, SAME_LOCAL("horiz-adv-x"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAGLEAVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondragleave"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEMOVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmousemove"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ORIENTATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("orientation"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEDOWN = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmousedown"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEOVER = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmouseover"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAGENTER = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondragenter"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName IDEOGRAPHIC = new AttributeName(ALL_NO_NS, SAME_LOCAL("ideographic"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFORECUT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforecut"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFORMINPUT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onforminput"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDRAGSTART = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondragstart"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOVESTART = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmovestart"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARKERUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("markerunits", "markerUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MATHVARIANT = new AttributeName(ALL_NO_NS, SAME_LOCAL("mathvariant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARGINWIDTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("marginwidth"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARKERWIDTH = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("markerwidth", "markerWidth"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TEXT_ANCHOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("text-anchor"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TABLEVALUES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("tablevalues", "tableValues"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCRIPTLEVEL = new AttributeName(ALL_NO_NS, SAME_LOCAL("scriptlevel"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPEATCOUNT = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("repeatcount", "repeatCount"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STITCHTILES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("stitchtiles", "stitchTiles"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STARTOFFSET = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("startoffset", "startOffset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCROLLDELAY = new AttributeName(ALL_NO_NS, SAME_LOCAL("scrolldelay"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XMLNS_XLINK = new AttributeName(XMLNS_NS, COLONIFIED_LOCAL("xmlns:xlink", "xlink"), XMLNS_PREFIX, IS_XMLNS); - public static final AttributeName XLINK_TITLE = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:title", "title"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName ARIA_INVALID = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-invalid"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_PRESSED = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-pressed"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_CHECKED = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-checked"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName AUTOCOMPLETE = new AttributeName(ALL_NO_NS, SAME_LOCAL("autocomplete"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName ARIA_SETSIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-setsize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_CHANNEL = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-channel"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName EQUALCOLUMNS = new AttributeName(ALL_NO_NS, SAME_LOCAL("equalcolumns"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DISPLAYSTYLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("displaystyle"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DATAFORMATAS = new AttributeName(ALL_NO_NS, SAME_LOCAL("dataformatas"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED); - public static final AttributeName FILL_OPACITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("fill-opacity"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_VARIANT = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-variant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_STRETCH = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-stretch"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FRAMESPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("framespacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KERNELMATRIX = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("kernelmatrix", "kernelMatrix"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDEACTIVATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondeactivate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONROWSDELETE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onrowsdelete"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSELEAVE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmouseleave"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFORMCHANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onformchange"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCELLCHANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("oncellchange"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEWHEEL = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmousewheel"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONMOUSEENTER = new AttributeName(ALL_NO_NS, SAME_LOCAL("onmouseenter"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONAFTERPRINT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onafterprint"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFORECOPY = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforecopy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARGINHEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("marginheight"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARKERHEIGHT = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("markerheight", "markerHeight"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MARKER_START = new AttributeName(ALL_NO_NS, SAME_LOCAL("marker-start"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MATHEMATICAL = new AttributeName(ALL_NO_NS, SAME_LOCAL("mathematical"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LENGTHADJUST = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("lengthadjust", "lengthAdjust"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNSELECTABLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("unselectable"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNICODE_BIDI = new AttributeName(ALL_NO_NS, SAME_LOCAL("unicode-bidi"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNITS_PER_EM = new AttributeName(ALL_NO_NS, SAME_LOCAL("units-per-em"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName WORD_SPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("word-spacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName WRITING_MODE = new AttributeName(ALL_NO_NS, SAME_LOCAL("writing-mode"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName V_ALPHABETIC = new AttributeName(ALL_NO_NS, SAME_LOCAL("v-alphabetic"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PATTERNUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("patternunits", "patternUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPREADMETHOD = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("spreadmethod", "spreadMethod"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SURFACESCALE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("surfacescale", "surfaceScale"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_WIDTH = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-width"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPEAT_START = new AttributeName(ALL_NO_NS, SAME_LOCAL("repeat-start"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STDDEVIATION = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("stddeviation", "stdDeviation"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STOP_OPACITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("stop-opacity"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_CONTROLS = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-controls"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_HASPOPUP = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-haspopup"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ACCENT_HEIGHT = new AttributeName(ALL_NO_NS, SAME_LOCAL("accent-height"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_VALUENOW = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-valuenow"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_RELEVANT = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-relevant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_POSINSET = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-posinset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_VALUEMAX = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-valuemax"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_READONLY = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-readonly"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_SELECTED = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-selected"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_REQUIRED = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-required"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_EXPANDED = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-expanded"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_DISABLED = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-disabled"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ATTRIBUTETYPE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("attributetype", "attributeType"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ATTRIBUTENAME = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("attributename", "attributeName"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_DATATYPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-datatype"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_VALUEMIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-valuemin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BASEFREQUENCY = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("basefrequency", "baseFrequency"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLUMNSPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("columnspacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLOR_PROFILE = new AttributeName(ALL_NO_NS, SAME_LOCAL("color-profile"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CLIPPATHUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("clippathunits", "clipPathUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DEFINITIONURL = new AttributeName(ALL_NO_NS, MATH_DIFFERENT("definitionurl", "definitionURL"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GRADIENTUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("gradientunits", "gradientUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FLOOD_OPACITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("flood-opacity"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONAFTERUPDATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onafterupdate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONERRORUPDATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onerrorupdate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFOREPASTE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforepaste"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONLOSECAPTURE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onlosecapture"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCONTEXTMENU = new AttributeName(ALL_NO_NS, SAME_LOCAL("oncontextmenu"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONSELECTSTART = new AttributeName(ALL_NO_NS, SAME_LOCAL("onselectstart"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFOREPRINT = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforeprint"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MOVABLELIMITS = new AttributeName(ALL_NO_NS, SAME_LOCAL("movablelimits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LINETHICKNESS = new AttributeName(ALL_NO_NS, SAME_LOCAL("linethickness"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNICODE_RANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("unicode-range"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName THINMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("thinmathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERT_ORIGIN_X = new AttributeName(ALL_NO_NS, SAME_LOCAL("vert-origin-x"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERT_ORIGIN_Y = new AttributeName(ALL_NO_NS, SAME_LOCAL("vert-origin-y"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName V_IDEOGRAPHIC = new AttributeName(ALL_NO_NS, SAME_LOCAL("v-ideographic"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PRESERVEALPHA = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("preservealpha", "preserveAlpha"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCRIPTMINSIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("scriptminsize"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPECIFICATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("specification"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XLINK_ACTUATE = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:actuate", "actuate"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName XLINK_ARCROLE = new AttributeName(XLINK_NS, COLONIFIED_LOCAL("xlink:arcrole", "arcrole"), XLINK_PREFIX, NCNAME_FOREIGN); - public static final AttributeName ACCEPT_CHARSET = new AttributeName(ALL_NO_NS, SAME_LOCAL("accept-charset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ALIGNMENTSCOPE = new AttributeName(ALL_NO_NS, SAME_LOCAL("alignmentscope"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_MULTILINE = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-multiline"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName BASELINE_SHIFT = new AttributeName(ALL_NO_NS, SAME_LOCAL("baseline-shift"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HORIZ_ORIGIN_X = new AttributeName(ALL_NO_NS, SAME_LOCAL("horiz-origin-x"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName HORIZ_ORIGIN_Y = new AttributeName(ALL_NO_NS, SAME_LOCAL("horiz-origin-y"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFOREUPDATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforeupdate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONFILTERCHANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onfilterchange"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONROWSINSERTED = new AttributeName(ALL_NO_NS, SAME_LOCAL("onrowsinserted"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFOREUNLOAD = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforeunload"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MATHBACKGROUND = new AttributeName(ALL_NO_NS, SAME_LOCAL("mathbackground"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LETTER_SPACING = new AttributeName(ALL_NO_NS, SAME_LOCAL("letter-spacing"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LIGHTING_COLOR = new AttributeName(ALL_NO_NS, SAME_LOCAL("lighting-color"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName THICKMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("thickmathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TEXT_RENDERING = new AttributeName(ALL_NO_NS, SAME_LOCAL("text-rendering"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName V_MATHEMATICAL = new AttributeName(ALL_NO_NS, SAME_LOCAL("v-mathematical"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName POINTER_EVENTS = new AttributeName(ALL_NO_NS, SAME_LOCAL("pointer-events"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PRIMITIVEUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("primitiveunits", "primitiveUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REFERRERPOLICY = new AttributeName(ALL_NO_NS, SAME_LOCAL("referrerpolicy"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SYSTEMLANGUAGE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("systemlanguage", "systemLanguage"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_LINECAP = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-linecap"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SUBSCRIPTSHIFT = new AttributeName(ALL_NO_NS, SAME_LOCAL("subscriptshift"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_OPACITY = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-opacity"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_DROPEFFECT = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-dropeffect"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_LABELLEDBY = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-labelledby"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_TEMPLATEID = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-templateid"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLOR_RENDERING = new AttributeName(ALL_NO_NS, SAME_LOCAL("color-rendering"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName CONTENTEDITABLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("contenteditable"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DIFFUSECONSTANT = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("diffuseconstant", "diffuseConstant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDATAAVAILABLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondataavailable"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONCONTROLSELECT = new AttributeName(ALL_NO_NS, SAME_LOCAL("oncontrolselect"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName IMAGE_RENDERING = new AttributeName(ALL_NO_NS, SAME_LOCAL("image-rendering"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MEDIUMMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("mediummathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName TEXT_DECORATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("text-decoration"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SHAPE_RENDERING = new AttributeName(ALL_NO_NS, SAME_LOCAL("shape-rendering"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_LINEJOIN = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-linejoin"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REPEAT_TEMPLATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("repeat-template"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_DESCRIBEDBY = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-describedby"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName FONT_SIZE_ADJUST = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-size-adjust"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName KERNELUNITLENGTH = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("kernelunitlength", "kernelUnitLength"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFOREACTIVATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforeactivate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONPROPERTYCHANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onpropertychange"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDATASETCHANGED = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondatasetchanged"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName MASKCONTENTUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("maskcontentunits", "maskContentUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PATTERNTRANSFORM = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("patterntransform", "patternTransform"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REQUIREDFEATURES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("requiredfeatures", "requiredFeatures"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName RENDERING_INTENT = new AttributeName(ALL_NO_NS, SAME_LOCAL("rendering-intent"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPECULAREXPONENT = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("specularexponent", "specularExponent"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SPECULARCONSTANT = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("specularconstant", "specularConstant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SUPERSCRIPTSHIFT = new AttributeName(ALL_NO_NS, SAME_LOCAL("superscriptshift"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_DASHARRAY = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-dasharray"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName XCHANNELSELECTOR = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("xchannelselector", "xChannelSelector"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName YCHANNELSELECTOR = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("ychannelselector", "yChannelSelector"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_AUTOCOMPLETE = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-autocomplete"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ENABLE_BACKGROUND = new AttributeName(ALL_NO_NS, SAME_LOCAL("enable-background"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName DOMINANT_BASELINE = new AttributeName(ALL_NO_NS, SAME_LOCAL("dominant-baseline"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GRADIENTTRANSFORM = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("gradienttransform", "gradientTransform"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFORDEACTIVATE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbefordeactivate"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONDATASETCOMPLETE = new AttributeName(ALL_NO_NS, SAME_LOCAL("ondatasetcomplete"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OVERLINE_POSITION = new AttributeName(ALL_NO_NS, SAME_LOCAL("overline-position"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONBEFOREEDITFOCUS = new AttributeName(ALL_NO_NS, SAME_LOCAL("onbeforeeditfocus"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName LIMITINGCONEANGLE = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("limitingconeangle", "limitingConeAngle"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERYTHINMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("verythinmathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_DASHOFFSET = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-dashoffset"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STROKE_MITERLIMIT = new AttributeName(ALL_NO_NS, SAME_LOCAL("stroke-miterlimit"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ALIGNMENT_BASELINE = new AttributeName(ALL_NO_NS, SAME_LOCAL("alignment-baseline"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ONREADYSTATECHANGE = new AttributeName(ALL_NO_NS, SAME_LOCAL("onreadystatechange"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName OVERLINE_THICKNESS = new AttributeName(ALL_NO_NS, SAME_LOCAL("overline-thickness"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNDERLINE_POSITION = new AttributeName(ALL_NO_NS, SAME_LOCAL("underline-position"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERYTHICKMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("verythickmathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName REQUIREDEXTENSIONS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("requiredextensions", "requiredExtensions"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLOR_INTERPOLATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("color-interpolation"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName UNDERLINE_THICKNESS = new AttributeName(ALL_NO_NS, SAME_LOCAL("underline-thickness"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PRESERVEASPECTRATIO = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("preserveaspectratio", "preserveAspectRatio"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName PATTERNCONTENTUNITS = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("patterncontentunits", "patternContentUnits"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_MULTISELECTABLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-multiselectable"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName SCRIPTSIZEMULTIPLIER = new AttributeName(ALL_NO_NS, SAME_LOCAL("scriptsizemultiplier"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName ARIA_ACTIVEDESCENDANT = new AttributeName(ALL_NO_NS, SAME_LOCAL("aria-activedescendant"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERYVERYTHINMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("veryverythinmathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName VERYVERYTHICKMATHSPACE = new AttributeName(ALL_NO_NS, SAME_LOCAL("veryverythickmathspace"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STRIKETHROUGH_POSITION = new AttributeName(ALL_NO_NS, SAME_LOCAL("strikethrough-position"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName STRIKETHROUGH_THICKNESS = new AttributeName(ALL_NO_NS, SAME_LOCAL("strikethrough-thickness"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GLYPH_ORIENTATION_VERTICAL = new AttributeName(ALL_NO_NS, SAME_LOCAL("glyph-orientation-vertical"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName COLOR_INTERPOLATION_FILTERS = new AttributeName(ALL_NO_NS, SAME_LOCAL("color-interpolation-filters"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - public static final AttributeName GLYPH_ORIENTATION_HORIZONTAL = new AttributeName(ALL_NO_NS, SAME_LOCAL("glyph-orientation-horizontal"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG); - private final static @NoLength AttributeName[] ATTRIBUTE_NAMES = { - D, - K, - R, - X, - Y, - Z, - BY, - CX, - CY, - DX, - DY, - G2, - G1, - FX, - FY, - K4, - K2, - K3, - K1, - ID, - IN, - U2, - U1, - RT, - RX, - RY, - TO, - Y2, - Y1, - X1, - X2, - ALT, - DIR, - DUR, - END, - FOR, - IN2, - MAX, - MIN, - LOW, - REL, - REV, - SRC, - AXIS, - ABBR, - BBOX, - CITE, - CODE, - BIAS, - COLS, - CLIP, - CHAR, - BASE, - EDGE, - DATA, - FILL, - FROM, - FORM, - FACE, - HIGH, - HREF, - OPEN, - ICON, - NAME, - MODE, - MASK, - LINK, - LANG, - LOOP, - LIST, - TYPE, - WHEN, - WRAP, - TEXT, - PATH, - PING, - REFX, - REFY, - SIZE, - SEED, - ROWS, - SPAN, - STEP, - ROLE, - XREF, - ASYNC, - ALINK, - ALIGN, - CLOSE, - COLOR, - CLASS, - CLEAR, - BEGIN, - DEPTH, - DEFER, - FENCE, - FRAME, - ISMAP, - ONEND, - INDEX, - ORDER, - OTHER, - ONCUT, - NARGS, - MEDIA, - LABEL, - LOCAL, - WIDTH, - TITLE, - VLINK, - VALUE, - SLOPE, - SHAPE, - SCOPE, - SCALE, - SPEED, - STYLE, - RULES, - STEMH, - SIZES, - STEMV, - START, - XMLNS, - ACCEPT, - ACCENT, - ASCENT, - ACTIVE, - ALTIMG, - ACTION, - BORDER, - CURSOR, - COORDS, - FILTER, - FORMAT, - HIDDEN, - HSPACE, - HEIGHT, - ONMOVE, - ONLOAD, - ONDRAG, - ORIGIN, - ONZOOM, - ONHELP, - ONSTOP, - ONDROP, - ONBLUR, - OBJECT, - OFFSET, - ORIENT, - ONCOPY, - NOWRAP, - NOHREF, - MACROS, - METHOD, - LOWSRC, - LSPACE, - LQUOTE, - USEMAP, - WIDTHS, - TARGET, - VALUES, - VALIGN, - VSPACE, - POSTER, - POINTS, - PROMPT, - SRCDOC, - SCOPED, - STRING, - SCHEME, - STROKE, - RADIUS, - RESULT, - REPEAT, - SRCSET, - RSPACE, - ROTATE, - RQUOTE, - ALTTEXT, - ARCHIVE, - AZIMUTH, - CLOSURE, - CHECKED, - CLASSID, - CHAROFF, - BGCOLOR, - COLSPAN, - CHARSET, - COMPACT, - CONTENT, - ENCTYPE, - DATASRC, - DATAFLD, - DECLARE, - DISPLAY, - DIVISOR, - DEFAULT, - DESCENT, - KERNING, - HANGING, - HEADERS, - ONPASTE, - ONCLICK, - OPTIMUM, - ONBEGIN, - ONKEYUP, - ONFOCUS, - ONERROR, - ONINPUT, - ONABORT, - ONSTART, - ONRESET, - OPACITY, - NOSHADE, - MINSIZE, - MAXSIZE, - LARGEOP, - UNICODE, - TARGETX, - TARGETY, - VIEWBOX, - VERSION, - PATTERN, - PROFILE, - SPACING, - RESTART, - ROWSPAN, - SANDBOX, - SUMMARY, - STANDBY, - REPLACE, - AUTOPLAY, - ADDITIVE, - CALCMODE, - CODETYPE, - CODEBASE, - CONTROLS, - BEVELLED, - BASELINE, - EXPONENT, - EDGEMODE, - ENCODING, - GLYPHREF, - DATETIME, - DISABLED, - FONTSIZE, - KEYTIMES, - PANOSE_1, - HREFLANG, - ONRESIZE, - ONCHANGE, - ONBOUNCE, - ONUNLOAD, - ONFINISH, - ONSCROLL, - OPERATOR, - OVERFLOW, - ONSUBMIT, - ONREPEAT, - ONSELECT, - NOTATION, - NORESIZE, - MANIFEST, - MATHSIZE, - MULTIPLE, - LONGDESC, - LANGUAGE, - TEMPLATE, - TABINDEX, - PROPERTY, - READONLY, - SELECTED, - ROWLINES, - SEAMLESS, - ROWALIGN, - STRETCHY, - REQUIRED, - XML_BASE, - XML_LANG, - X_HEIGHT, - ARIA_OWNS, - AUTOFOCUS, - ARIA_SORT, - ACCESSKEY, - ARIA_BUSY, - ARIA_GRAB, - AMPLITUDE, - ARIA_LIVE, - CLIP_RULE, - CLIP_PATH, - EQUALROWS, - ELEVATION, - DIRECTION, - DRAGGABLE, - FILL_RULE, - FONTSTYLE, - FONT_SIZE, - KEYSYSTEM, - KEYPOINTS, - HIDEFOCUS, - ONMESSAGE, - INTERCEPT, - ONDRAGEND, - ONMOVEEND, - ONINVALID, - INTEGRITY, - ONKEYDOWN, - ONFOCUSIN, - ONMOUSEUP, - INPUTMODE, - ONROWEXIT, - MATHCOLOR, - MASKUNITS, - MAXLENGTH, - LINEBREAK, - TRANSFORM, - V_HANGING, - VALUETYPE, - POINTSATZ, - POINTSATX, - POINTSATY, - SYMMETRIC, - SCROLLING, - REPEATDUR, - SELECTION, - SEPARATOR, - XML_SPACE, - AUTOSUBMIT, - ALPHABETIC, - ACTIONTYPE, - ACCUMULATE, - ARIA_LEVEL, - COLUMNSPAN, - CAP_HEIGHT, - BACKGROUND, - GLYPH_NAME, - GROUPALIGN, - FONTFAMILY, - FONTWEIGHT, - FONT_STYLE, - KEYSPLINES, - HTTP_EQUIV, - ONACTIVATE, - OCCURRENCE, - IRRELEVANT, - ONDBLCLICK, - ONDRAGDROP, - ONKEYPRESS, - ONROWENTER, - ONDRAGOVER, - ONFOCUSOUT, - ONMOUSEOUT, - NUMOCTAVES, - MARKER_MID, - MARKER_END, - TEXTLENGTH, - VISIBILITY, - VIEWTARGET, - VERT_ADV_Y, - PATHLENGTH, - REPEAT_MAX, - RADIOGROUP, - STOP_COLOR, - SEPARATORS, - REPEAT_MIN, - ROWSPACING, - ZOOMANDPAN, - XLINK_TYPE, - XLINK_ROLE, - XLINK_HREF, - XLINK_SHOW, - ACCENTUNDER, - ARIA_SECRET, - ARIA_ATOMIC, - ARIA_HIDDEN, - ARIA_FLOWTO, - ARABIC_FORM, - CELLPADDING, - CELLSPACING, - COLUMNWIDTH, - CROSSORIGIN, - COLUMNALIGN, - COLUMNLINES, - CONTEXTMENU, - BASEPROFILE, - FONT_FAMILY, - FRAMEBORDER, - FILTERUNITS, - FLOOD_COLOR, - FONT_WEIGHT, - HORIZ_ADV_X, - ONDRAGLEAVE, - ONMOUSEMOVE, - ORIENTATION, - ONMOUSEDOWN, - ONMOUSEOVER, - ONDRAGENTER, - IDEOGRAPHIC, - ONBEFORECUT, - ONFORMINPUT, - ONDRAGSTART, - ONMOVESTART, - MARKERUNITS, - MATHVARIANT, - MARGINWIDTH, - MARKERWIDTH, - TEXT_ANCHOR, - TABLEVALUES, - SCRIPTLEVEL, - REPEATCOUNT, - STITCHTILES, - STARTOFFSET, - SCROLLDELAY, - XMLNS_XLINK, - XLINK_TITLE, - ARIA_INVALID, - ARIA_PRESSED, - ARIA_CHECKED, - AUTOCOMPLETE, - ARIA_SETSIZE, - ARIA_CHANNEL, - EQUALCOLUMNS, - DISPLAYSTYLE, - DATAFORMATAS, - FILL_OPACITY, - FONT_VARIANT, - FONT_STRETCH, - FRAMESPACING, - KERNELMATRIX, - ONDEACTIVATE, - ONROWSDELETE, - ONMOUSELEAVE, - ONFORMCHANGE, - ONCELLCHANGE, - ONMOUSEWHEEL, - ONMOUSEENTER, - ONAFTERPRINT, - ONBEFORECOPY, - MARGINHEIGHT, - MARKERHEIGHT, - MARKER_START, - MATHEMATICAL, - LENGTHADJUST, - UNSELECTABLE, - UNICODE_BIDI, - UNITS_PER_EM, - WORD_SPACING, - WRITING_MODE, - V_ALPHABETIC, - PATTERNUNITS, - SPREADMETHOD, - SURFACESCALE, - STROKE_WIDTH, - REPEAT_START, - STDDEVIATION, - STOP_OPACITY, - ARIA_CONTROLS, - ARIA_HASPOPUP, - ACCENT_HEIGHT, - ARIA_VALUENOW, - ARIA_RELEVANT, - ARIA_POSINSET, - ARIA_VALUEMAX, - ARIA_READONLY, - ARIA_SELECTED, - ARIA_REQUIRED, - ARIA_EXPANDED, - ARIA_DISABLED, - ATTRIBUTETYPE, - ATTRIBUTENAME, - ARIA_DATATYPE, - ARIA_VALUEMIN, - BASEFREQUENCY, - COLUMNSPACING, - COLOR_PROFILE, - CLIPPATHUNITS, - DEFINITIONURL, - GRADIENTUNITS, - FLOOD_OPACITY, - ONAFTERUPDATE, - ONERRORUPDATE, - ONBEFOREPASTE, - ONLOSECAPTURE, - ONCONTEXTMENU, - ONSELECTSTART, - ONBEFOREPRINT, - MOVABLELIMITS, - LINETHICKNESS, - UNICODE_RANGE, - THINMATHSPACE, - VERT_ORIGIN_X, - VERT_ORIGIN_Y, - V_IDEOGRAPHIC, - PRESERVEALPHA, - SCRIPTMINSIZE, - SPECIFICATION, - XLINK_ACTUATE, - XLINK_ARCROLE, - ACCEPT_CHARSET, - ALIGNMENTSCOPE, - ARIA_MULTILINE, - BASELINE_SHIFT, - HORIZ_ORIGIN_X, - HORIZ_ORIGIN_Y, - ONBEFOREUPDATE, - ONFILTERCHANGE, - ONROWSINSERTED, - ONBEFOREUNLOAD, - MATHBACKGROUND, - LETTER_SPACING, - LIGHTING_COLOR, - THICKMATHSPACE, - TEXT_RENDERING, - V_MATHEMATICAL, - POINTER_EVENTS, - PRIMITIVEUNITS, - REFERRERPOLICY, - SYSTEMLANGUAGE, - STROKE_LINECAP, - SUBSCRIPTSHIFT, - STROKE_OPACITY, - ARIA_DROPEFFECT, - ARIA_LABELLEDBY, - ARIA_TEMPLATEID, - COLOR_RENDERING, - CONTENTEDITABLE, - DIFFUSECONSTANT, - ONDATAAVAILABLE, - ONCONTROLSELECT, - IMAGE_RENDERING, - MEDIUMMATHSPACE, - TEXT_DECORATION, - SHAPE_RENDERING, - STROKE_LINEJOIN, - REPEAT_TEMPLATE, - ARIA_DESCRIBEDBY, - FONT_SIZE_ADJUST, - KERNELUNITLENGTH, - ONBEFOREACTIVATE, - ONPROPERTYCHANGE, - ONDATASETCHANGED, - MASKCONTENTUNITS, - PATTERNTRANSFORM, - REQUIREDFEATURES, - RENDERING_INTENT, - SPECULAREXPONENT, - SPECULARCONSTANT, - SUPERSCRIPTSHIFT, - STROKE_DASHARRAY, - XCHANNELSELECTOR, - YCHANNELSELECTOR, - ARIA_AUTOCOMPLETE, - ENABLE_BACKGROUND, - DOMINANT_BASELINE, - GRADIENTTRANSFORM, - ONBEFORDEACTIVATE, - ONDATASETCOMPLETE, - OVERLINE_POSITION, - ONBEFOREEDITFOCUS, - LIMITINGCONEANGLE, - VERYTHINMATHSPACE, - STROKE_DASHOFFSET, - STROKE_MITERLIMIT, - ALIGNMENT_BASELINE, - ONREADYSTATECHANGE, - OVERLINE_THICKNESS, - UNDERLINE_POSITION, - VERYTHICKMATHSPACE, - REQUIREDEXTENSIONS, - COLOR_INTERPOLATION, - UNDERLINE_THICKNESS, - PRESERVEASPECTRATIO, - PATTERNCONTENTUNITS, - ARIA_MULTISELECTABLE, - SCRIPTSIZEMULTIPLIER, - ARIA_ACTIVEDESCENDANT, - VERYVERYTHINMATHSPACE, - VERYVERYTHICKMATHSPACE, - STRIKETHROUGH_POSITION, - STRIKETHROUGH_THICKNESS, - GLYPH_ORIENTATION_VERTICAL, - COLOR_INTERPOLATION_FILTERS, - GLYPH_ORIENTATION_HORIZONTAL, - }; - private final static int[] ATTRIBUTE_HASHES = { - 1153, - 1383, - 1601, - 1793, - 1827, - 1857, - 68600, - 69146, - 69177, - 70237, - 70270, - 71572, - 71669, - 72415, - 72444, - 74846, - 74904, - 74943, - 75001, - 75276, - 75590, - 84742, - 84839, - 85575, - 85963, - 85992, - 87204, - 88074, - 88171, - 89130, - 89163, - 3207892, - 3283895, - 3284791, - 3338752, - 3358197, - 3369562, - 3539124, - 3562402, - 3574260, - 3670335, - 3696933, - 3721879, - 135280021, - 135346322, - 136317019, - 136475749, - 136548517, - 136652214, - 136884919, - 136902418, - 136942992, - 137292068, - 139120259, - 139785574, - 142250603, - 142314056, - 142331176, - 142519584, - 144752417, - 145106895, - 146147200, - 146765926, - 148805544, - 149655723, - 149809441, - 150018784, - 150445028, - 150813181, - 150923321, - 152528754, - 152536216, - 152647366, - 152962785, - 155219321, - 155654904, - 157317483, - 157350248, - 157437941, - 157447478, - 157604838, - 157685404, - 157894402, - 158315188, - 166078431, - 169409980, - 169700259, - 169856932, - 170007032, - 170409695, - 170466488, - 170513710, - 170608367, - 173028944, - 173896963, - 176090625, - 176129212, - 179390001, - 179489057, - 179627464, - 179840468, - 179849042, - 180004216, - 181779081, - 183027151, - 183645319, - 183698797, - 185922012, - 185997252, - 188312483, - 188675799, - 190977533, - 190992569, - 191006194, - 191033518, - 191038774, - 191096249, - 191166163, - 191194426, - 191443343, - 191522106, - 191568039, - 200104642, - 202506661, - 202537381, - 202602917, - 203070590, - 203120766, - 203389054, - 203690071, - 203971238, - 203986524, - 209040857, - 209125756, - 212055489, - 212322418, - 212746849, - 213002877, - 213055164, - 213088023, - 213259873, - 213273386, - 213435118, - 213437318, - 213438231, - 213493071, - 213532268, - 213542834, - 213584431, - 213659891, - 215285828, - 215880731, - 216112976, - 216684637, - 217369699, - 217565298, - 217576549, - 218186795, - 219743185, - 220082234, - 221623802, - 221986406, - 222283890, - 223089542, - 223138630, - 223311265, - 224431494, - 224547358, - 224587256, - 224589550, - 224655650, - 224785518, - 224810917, - 224813302, - 225126263, - 225429618, - 225432950, - 225440869, - 236107233, - 236709921, - 236838947, - 237117095, - 237143271, - 237172455, - 237209953, - 237354143, - 237372743, - 237668065, - 237703073, - 237714273, - 239743521, - 240512803, - 240522627, - 240560417, - 240656513, - 241015715, - 241062755, - 241065383, - 243523041, - 245865199, - 246261793, - 246556195, - 246774817, - 246923491, - 246928419, - 246981667, - 247014847, - 247058369, - 247112833, - 247118177, - 247119137, - 247128739, - 247316903, - 249533729, - 250235623, - 250269543, - 251402351, - 252339047, - 253260911, - 253293679, - 254844367, - 255547879, - 256077281, - 256345377, - 258124199, - 258354465, - 258605063, - 258744193, - 258845603, - 258856961, - 258926689, - 269869248, - 270174334, - 270709417, - 270778994, - 270781796, - 271102503, - 271478858, - 271490090, - 272870654, - 273335275, - 273369140, - 273924313, - 274108530, - 274116736, - 276818662, - 277476156, - 279156579, - 279349675, - 280108533, - 280128712, - 280132869, - 280162403, - 280280292, - 280413430, - 280506130, - 280677397, - 280678580, - 280686710, - 280689066, - 282736758, - 283110901, - 283275116, - 283823226, - 283890012, - 284479340, - 284606461, - 286700477, - 286798916, - 290055764, - 291557706, - 291665349, - 291804100, - 292138018, - 292166446, - 292418738, - 292451039, - 300298041, - 300374839, - 300597935, - 303073389, - 303083839, - 303266673, - 303354997, - 303430688, - 303576261, - 303724281, - 303819694, - 304242723, - 304382625, - 306247792, - 307227811, - 307468786, - 307724489, - 310252031, - 310358241, - 310373094, - 310833159, - 311015256, - 313357609, - 313683893, - 313701861, - 313706996, - 313707317, - 313710350, - 313795700, - 314027746, - 314038181, - 314091299, - 314205627, - 314233813, - 316741830, - 316797986, - 317486755, - 317794164, - 320076137, - 322657125, - 322887778, - 323506876, - 323572412, - 323605180, - 325060058, - 325320188, - 325398738, - 325541490, - 325671619, - 333868843, - 336806130, - 337212108, - 337282686, - 337285434, - 337585223, - 338036037, - 338298087, - 338566051, - 340943551, - 341190970, - 342995704, - 343352124, - 343912673, - 344585053, - 346977248, - 347218098, - 347262163, - 347278576, - 347438191, - 347655959, - 347684788, - 347726430, - 347727772, - 347776035, - 347776629, - 349500753, - 350880161, - 350887073, - 353384123, - 355496998, - 355906922, - 355979793, - 356545959, - 358637867, - 358905016, - 359164318, - 359247286, - 359350571, - 359579447, - 365560330, - 367399355, - 367420285, - 367510727, - 368013212, - 370234760, - 370353345, - 370710317, - 371074566, - 371122285, - 371194213, - 371448425, - 371448430, - 371545055, - 371593469, - 371596922, - 371758751, - 371964792, - 372151328, - 376550136, - 376710172, - 376795771, - 376826271, - 376906556, - 380514830, - 380774774, - 380775037, - 381030322, - 381136500, - 381281631, - 381282269, - 381285504, - 381330595, - 381331422, - 381335911, - 381336484, - 383907298, - 383917408, - 384595009, - 384595013, - 387799894, - 387823201, - 392581647, - 392584937, - 392742684, - 392906485, - 393003349, - 400644707, - 400973830, - 404428547, - 404432113, - 404432865, - 404469244, - 404478897, - 404694860, - 406887479, - 408294949, - 408789955, - 410022510, - 410467324, - 410586448, - 410945965, - 411845275, - 414327152, - 414327932, - 414329781, - 414346257, - 414346439, - 414639928, - 414835998, - 414894517, - 414986533, - 417465377, - 417465381, - 417492216, - 418259232, - 419310946, - 420103495, - 420242342, - 420380455, - 420658662, - 420717432, - 423183880, - 424539259, - 425929170, - 425972964, - 426050649, - 426126450, - 426142833, - 426607922, - 437289840, - 437347469, - 437412335, - 437423943, - 437455540, - 437462252, - 437597991, - 437617485, - 437986305, - 437986507, - 437986828, - 437987072, - 438015591, - 438034813, - 438038966, - 438179623, - 438347971, - 438483573, - 438547062, - 438895551, - 441592676, - 442032555, - 443548979, - 447881379, - 447881655, - 447881895, - 447887844, - 448416189, - 448445746, - 448449012, - 450942191, - 452816744, - 453668677, - 454434495, - 456610076, - 456642844, - 456738709, - 457544600, - 459451897, - 459680944, - 468058810, - 468083581, - 470964084, - 471470955, - 471567278, - 472267822, - 481177859, - 481210627, - 481435874, - 481455115, - 481485378, - 481490218, - 485105638, - 486005878, - 486383494, - 487988916, - 488103783, - 490661867, - 491574090, - 491578272, - 492891370, - 493041952, - 493441205, - 493582844, - 493716979, - 504577572, - 504740359, - 505091638, - 505592418, - 505656212, - 509516275, - 514998531, - 515571132, - 515594682, - 518712698, - 521362273, - 526592419, - 526807354, - 527348842, - 538294791, - 544689535, - 545535009, - 548544752, - 548563346, - 548595116, - 551679010, - 558034099, - 560329411, - 560356209, - 560671018, - 560671152, - 560692590, - 560845442, - 569212097, - 569474241, - 572252718, - 575326764, - 576174758, - 576190819, - 582099184, - 582099438, - 582372519, - 582558889, - 586552164, - 591325418, - 594231990, - 594243961, - 605711268, - 615672071, - 616086845, - 621792370, - 624879850, - 627432831, - 640040548, - 654392808, - 658675477, - 659420283, - 672891587, - 694768102, - 705890982, - 725543146, - 759097578, - 761686526, - 795383908, - 878105336, - 908643300, - 945213471, - }; -} diff --git a/parser/html/javasrc/ElementName.java b/parser/html/javasrc/ElementName.java deleted file mode 100644 index ee551a737..000000000 --- a/parser/html/javasrc/ElementName.java +++ /dev/null @@ -1,1609 +0,0 @@ -/* - * Copyright (c) 2008-2014 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import java.util.Arrays; - -import nu.validator.htmlparser.annotation.Inline; -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NoLength; -import nu.validator.htmlparser.annotation.Virtual; -import nu.validator.htmlparser.common.Interner; - -public final class ElementName -// uncomment when regenerating self -// implements Comparable<ElementName> -{ - - /** - * The mask for extracting the dispatch group. - */ - public static final int GROUP_MASK = 127; - - /** - * Indicates that the element is not a pre-interned element. Forbidden - * on preinterned elements. - */ - public static final int CUSTOM = (1 << 30); - - /** - * Indicates that the element is in the "special" category. This bit - * should not be pre-set on MathML or SVG specials--only on HTML specials. - */ - public static final int SPECIAL = (1 << 29); - - /** - * The element is foster-parenting. This bit should be pre-set on elements - * that are foster-parenting as HTML. - */ - public static final int FOSTER_PARENTING = (1 << 28); - - /** - * The element is scoping. This bit should be pre-set on elements - * that are scoping as HTML. - */ - public static final int SCOPING = (1 << 27); - - /** - * The element is scoping as SVG. - */ - public static final int SCOPING_AS_SVG = (1 << 26); - - /** - * The element is scoping as MathML. - */ - public static final int SCOPING_AS_MATHML = (1 << 25); - - /** - * The element is an HTML integration point. - */ - public static final int HTML_INTEGRATION_POINT = (1 << 24); - - /** - * The element has an optional end tag. - */ - public static final int OPTIONAL_END_TAG = (1 << 23); - - public static final ElementName NULL_ELEMENT_NAME = new ElementName(null); - - public final @Local String name; - - public final @Local String camelCaseName; - - /** - * The lowest 7 bits are the dispatch group. The high bits are flags. - */ - public final int flags; - - @Inline public int getFlags() { - return flags; - } - - public int getGroup() { - return flags & GROUP_MASK; - } - - public boolean isCustom() { - return (flags & CUSTOM) != 0; - } - - static ElementName elementNameByBuffer(@NoLength char[] buf, int offset, int length, Interner interner) { - int hash = ElementName.bufToHash(buf, length); - int index = Arrays.binarySearch(ElementName.ELEMENT_HASHES, hash); - if (index < 0) { - return new ElementName(Portability.newLocalNameFromBuffer(buf, offset, length, interner)); - } else { - ElementName elementName = ElementName.ELEMENT_NAMES[index]; - @Local String name = elementName.name; - if (!Portability.localEqualsBuffer(name, buf, offset, length)) { - return new ElementName(Portability.newLocalNameFromBuffer(buf, - offset, length, interner)); - } - return elementName; - } - } - - /** - * This method has to return a unique integer for each well-known - * lower-cased element name. - * - * @param buf - * @param len - * @return - */ - private static int bufToHash(@NoLength char[] buf, int len) { - int hash = len; - hash <<= 5; - hash += buf[0] - 0x60; - int j = len; - for (int i = 0; i < 4 && j > 0; i++) { - j--; - hash <<= 5; - hash += buf[j] - 0x60; - } - return hash; - } - - private ElementName(@Local String name, @Local String camelCaseName, - int flags) { - this.name = name; - this.camelCaseName = camelCaseName; - this.flags = flags; - } - - protected ElementName(@Local String name) { - this.name = name; - this.camelCaseName = name; - this.flags = TreeBuilder.OTHER | CUSTOM; - } - - @Virtual void release() { - // No-op in Java. - // Implement as delete this in subclass. - // Be sure to release the local name - } - - @SuppressWarnings("unused") @Virtual private void destructor() { - } - - @Virtual public ElementName cloneElementName(Interner interner) { - return this; - } - - // START CODE ONLY USED FOR GENERATING CODE uncomment and run to regenerate - -// /** -// * @see java.lang.Object#toString() -// */ -// @Override public String toString() { -// return "(\"" + name + "\", \"" + camelCaseName + "\", " + decomposedFlags() + ")"; -// } -// -// private String decomposedFlags() { -// StringBuilder buf = new StringBuilder("TreeBuilder."); -// buf.append(treeBuilderGroupToName()); -// if ((flags & SPECIAL) != 0) { -// buf.append(" | SPECIAL"); -// } -// if ((flags & FOSTER_PARENTING) != 0) { -// buf.append(" | FOSTER_PARENTING"); -// } -// if ((flags & SCOPING) != 0) { -// buf.append(" | SCOPING"); -// } -// if ((flags & SCOPING_AS_MATHML) != 0) { -// buf.append(" | SCOPING_AS_MATHML"); -// } -// if ((flags & SCOPING_AS_SVG) != 0) { -// buf.append(" | SCOPING_AS_SVG"); -// } -// if ((flags & OPTIONAL_END_TAG) != 0) { -// buf.append(" | OPTIONAL_END_TAG"); -// } -// return buf.toString(); -// } -// -// private String constName() { -// char[] buf = new char[name.length()]; -// for (int i = 0; i < name.length(); i++) { -// char c = name.charAt(i); -// if (c == '-') { -// buf[i] = '_'; -// } else if (c >= '0' && c <= '9') { -// buf[i] = c; -// } else { -// buf[i] = (char) (c - 0x20); -// } -// } -// return new String(buf); -// } -// -// private int hash() { -// return bufToHash(name.toCharArray(), name.length()); -// } -// -// public int compareTo(ElementName other) { -// int thisHash = this.hash(); -// int otherHash = other.hash(); -// if (thisHash < otherHash) { -// return -1; -// } else if (thisHash == otherHash) { -// return 0; -// } else { -// return 1; -// } -// } -// -// private String treeBuilderGroupToName() { -// switch (getGroup()) { -// case TreeBuilder.OTHER: -// return "OTHER"; -// case TreeBuilder.A: -// return "A"; -// case TreeBuilder.BASE: -// return "BASE"; -// case TreeBuilder.BODY: -// return "BODY"; -// case TreeBuilder.BR: -// return "BR"; -// case TreeBuilder.BUTTON: -// return "BUTTON"; -// case TreeBuilder.CAPTION: -// return "CAPTION"; -// case TreeBuilder.COL: -// return "COL"; -// case TreeBuilder.COLGROUP: -// return "COLGROUP"; -// case TreeBuilder.FONT: -// return "FONT"; -// case TreeBuilder.FORM: -// return "FORM"; -// case TreeBuilder.FRAME: -// return "FRAME"; -// case TreeBuilder.FRAMESET: -// return "FRAMESET"; -// case TreeBuilder.IMAGE: -// return "IMAGE"; -// case TreeBuilder.INPUT: -// return "INPUT"; -// case TreeBuilder.ISINDEX: -// return "ISINDEX"; -// case TreeBuilder.LI: -// return "LI"; -// case TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND: -// return "LINK_OR_BASEFONT_OR_BGSOUND"; -// case TreeBuilder.MATH: -// return "MATH"; -// case TreeBuilder.META: -// return "META"; -// case TreeBuilder.SVG: -// return "SVG"; -// case TreeBuilder.HEAD: -// return "HEAD"; -// case TreeBuilder.HR: -// return "HR"; -// case TreeBuilder.HTML: -// return "HTML"; -// case TreeBuilder.KEYGEN: -// return "KEYGEN"; -// case TreeBuilder.NOBR: -// return "NOBR"; -// case TreeBuilder.NOFRAMES: -// return "NOFRAMES"; -// case TreeBuilder.NOSCRIPT: -// return "NOSCRIPT"; -// case TreeBuilder.OPTGROUP: -// return "OPTGROUP"; -// case TreeBuilder.OPTION: -// return "OPTION"; -// case TreeBuilder.P: -// return "P"; -// case TreeBuilder.PLAINTEXT: -// return "PLAINTEXT"; -// case TreeBuilder.SCRIPT: -// return "SCRIPT"; -// case TreeBuilder.SELECT: -// return "SELECT"; -// case TreeBuilder.STYLE: -// return "STYLE"; -// case TreeBuilder.TABLE: -// return "TABLE"; -// case TreeBuilder.TEXTAREA: -// return "TEXTAREA"; -// case TreeBuilder.TITLE: -// return "TITLE"; -// case TreeBuilder.TEMPLATE: -// return "TEMPLATE"; -// case TreeBuilder.TR: -// return "TR"; -// case TreeBuilder.XMP: -// return "XMP"; -// case TreeBuilder.TBODY_OR_THEAD_OR_TFOOT: -// return "TBODY_OR_THEAD_OR_TFOOT"; -// case TreeBuilder.TD_OR_TH: -// return "TD_OR_TH"; -// case TreeBuilder.DD_OR_DT: -// return "DD_OR_DT"; -// case TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: -// return "H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6"; -// case TreeBuilder.OBJECT: -// return "OBJECT"; -// case TreeBuilder.OUTPUT: -// return "OUTPUT"; -// case TreeBuilder.MARQUEE_OR_APPLET: -// return "MARQUEE_OR_APPLET"; -// case TreeBuilder.PRE_OR_LISTING: -// return "PRE_OR_LISTING"; -// case TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U: -// return "B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U"; -// case TreeBuilder.UL_OR_OL_OR_DL: -// return "UL_OR_OL_OR_DL"; -// case TreeBuilder.IFRAME: -// return "IFRAME"; -// case TreeBuilder.NOEMBED: -// return "NOEMBED"; -// case TreeBuilder.EMBED: -// return "EMBED"; -// case TreeBuilder.IMG: -// return "IMG"; -// case TreeBuilder.AREA_OR_WBR: -// return "AREA_OR_WBR"; -// case TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU: -// return "DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU"; -// case TreeBuilder.FIELDSET: -// return "FIELDSET"; -// case TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: -// return "ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY"; -// case TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR: -// return "RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR"; -// case TreeBuilder.RB_OR_RTC: -// return "RB_OR_RTC"; -// case TreeBuilder.RT_OR_RP: -// return "RT_OR_RP"; -// case TreeBuilder.PARAM_OR_SOURCE_OR_TRACK: -// return "PARAM_OR_SOURCE_OR_TRACK"; -// case TreeBuilder.MGLYPH_OR_MALIGNMARK: -// return "MGLYPH_OR_MALIGNMARK"; -// case TreeBuilder.MI_MO_MN_MS_MTEXT: -// return "MI_MO_MN_MS_MTEXT"; -// case TreeBuilder.ANNOTATION_XML: -// return "ANNOTATION_XML"; -// case TreeBuilder.FOREIGNOBJECT_OR_DESC: -// return "FOREIGNOBJECT_OR_DESC"; -// case TreeBuilder.MENUITEM: -// return "MENUITEM"; -// } -// return null; -// } -// -// /** -// * Regenerate self -// * -// * @param args -// */ -// public static void main(String[] args) { -// Arrays.sort(ELEMENT_NAMES); -// for (int i = 1; i < ELEMENT_NAMES.length; i++) { -// if (ELEMENT_NAMES[i].hash() == ELEMENT_NAMES[i - 1].hash()) { -// System.err.println("Hash collision: " + ELEMENT_NAMES[i].name -// + ", " + ELEMENT_NAMES[i - 1].name); -// return; -// } -// } -// for (int i = 0; i < ELEMENT_NAMES.length; i++) { -// ElementName el = ELEMENT_NAMES[i]; -// System.out.println("public static final ElementName " -// + el.constName() + " = new ElementName" + el.toString() -// + ";"); -// } -// System.out.println("private final static @NoLength ElementName[] ELEMENT_NAMES = {"); -// for (int i = 0; i < ELEMENT_NAMES.length; i++) { -// ElementName el = ELEMENT_NAMES[i]; -// System.out.println(el.constName() + ","); -// } -// System.out.println("};"); -// System.out.println("private final static int[] ELEMENT_HASHES = {"); -// for (int i = 0; i < ELEMENT_NAMES.length; i++) { -// ElementName el = ELEMENT_NAMES[i]; -// System.out.println(Integer.toString(el.hash()) + ","); -// } -// System.out.println("};"); -// } - - // START GENERATED CODE - public static final ElementName A = new ElementName("a", "a", TreeBuilder.A); - public static final ElementName B = new ElementName("b", "b", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName G = new ElementName("g", "g", TreeBuilder.OTHER); - public static final ElementName I = new ElementName("i", "i", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName P = new ElementName("p", "p", TreeBuilder.P | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName Q = new ElementName("q", "q", TreeBuilder.OTHER); - public static final ElementName S = new ElementName("s", "s", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName U = new ElementName("u", "u", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName BR = new ElementName("br", "br", TreeBuilder.BR | SPECIAL); - public static final ElementName CI = new ElementName("ci", "ci", TreeBuilder.OTHER); - public static final ElementName CN = new ElementName("cn", "cn", TreeBuilder.OTHER); - public static final ElementName DD = new ElementName("dd", "dd", TreeBuilder.DD_OR_DT | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName DL = new ElementName("dl", "dl", TreeBuilder.UL_OR_OL_OR_DL | SPECIAL); - public static final ElementName DT = new ElementName("dt", "dt", TreeBuilder.DD_OR_DT | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName EM = new ElementName("em", "em", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName EQ = new ElementName("eq", "eq", TreeBuilder.OTHER); - public static final ElementName FN = new ElementName("fn", "fn", TreeBuilder.OTHER); - public static final ElementName H1 = new ElementName("h1", "h1", TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 | SPECIAL); - public static final ElementName H2 = new ElementName("h2", "h2", TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 | SPECIAL); - public static final ElementName H3 = new ElementName("h3", "h3", TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 | SPECIAL); - public static final ElementName H4 = new ElementName("h4", "h4", TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 | SPECIAL); - public static final ElementName H5 = new ElementName("h5", "h5", TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 | SPECIAL); - public static final ElementName H6 = new ElementName("h6", "h6", TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 | SPECIAL); - public static final ElementName GT = new ElementName("gt", "gt", TreeBuilder.OTHER); - public static final ElementName HR = new ElementName("hr", "hr", TreeBuilder.HR | SPECIAL); - public static final ElementName IN = new ElementName("in", "in", TreeBuilder.OTHER); - public static final ElementName LI = new ElementName("li", "li", TreeBuilder.LI | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName LN = new ElementName("ln", "ln", TreeBuilder.OTHER); - public static final ElementName LT = new ElementName("lt", "lt", TreeBuilder.OTHER); - public static final ElementName MI = new ElementName("mi", "mi", TreeBuilder.MI_MO_MN_MS_MTEXT | SCOPING_AS_MATHML); - public static final ElementName MN = new ElementName("mn", "mn", TreeBuilder.MI_MO_MN_MS_MTEXT | SCOPING_AS_MATHML); - public static final ElementName MO = new ElementName("mo", "mo", TreeBuilder.MI_MO_MN_MS_MTEXT | SCOPING_AS_MATHML); - public static final ElementName MS = new ElementName("ms", "ms", TreeBuilder.MI_MO_MN_MS_MTEXT | SCOPING_AS_MATHML); - public static final ElementName OL = new ElementName("ol", "ol", TreeBuilder.UL_OR_OL_OR_DL | SPECIAL); - public static final ElementName OR = new ElementName("or", "or", TreeBuilder.OTHER); - public static final ElementName PI = new ElementName("pi", "pi", TreeBuilder.OTHER); - public static final ElementName RB = new ElementName("rb", "rb", TreeBuilder.RB_OR_RTC | OPTIONAL_END_TAG); - public static final ElementName RP = new ElementName("rp", "rp", TreeBuilder.RT_OR_RP | OPTIONAL_END_TAG); - public static final ElementName RT = new ElementName("rt", "rt", TreeBuilder.RT_OR_RP | OPTIONAL_END_TAG); - public static final ElementName TD = new ElementName("td", "td", TreeBuilder.TD_OR_TH | SPECIAL | SCOPING | OPTIONAL_END_TAG); - public static final ElementName TH = new ElementName("th", "th", TreeBuilder.TD_OR_TH | SPECIAL | SCOPING | OPTIONAL_END_TAG); - public static final ElementName TR = new ElementName("tr", "tr", TreeBuilder.TR | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG); - public static final ElementName TT = new ElementName("tt", "tt", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName UL = new ElementName("ul", "ul", TreeBuilder.UL_OR_OL_OR_DL | SPECIAL); - public static final ElementName AND = new ElementName("and", "and", TreeBuilder.OTHER); - public static final ElementName ARG = new ElementName("arg", "arg", TreeBuilder.OTHER); - public static final ElementName ABS = new ElementName("abs", "abs", TreeBuilder.OTHER); - public static final ElementName BIG = new ElementName("big", "big", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName BDO = new ElementName("bdo", "bdo", TreeBuilder.OTHER); - public static final ElementName CSC = new ElementName("csc", "csc", TreeBuilder.OTHER); - public static final ElementName COL = new ElementName("col", "col", TreeBuilder.COL | SPECIAL); - public static final ElementName COS = new ElementName("cos", "cos", TreeBuilder.OTHER); - public static final ElementName COT = new ElementName("cot", "cot", TreeBuilder.OTHER); - public static final ElementName DEL = new ElementName("del", "del", TreeBuilder.OTHER); - public static final ElementName DFN = new ElementName("dfn", "dfn", TreeBuilder.OTHER); - public static final ElementName DIR = new ElementName("dir", "dir", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName DIV = new ElementName("div", "div", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL); - public static final ElementName EXP = new ElementName("exp", "exp", TreeBuilder.OTHER); - public static final ElementName GCD = new ElementName("gcd", "gcd", TreeBuilder.OTHER); - public static final ElementName GEQ = new ElementName("geq", "geq", TreeBuilder.OTHER); - public static final ElementName IMG = new ElementName("img", "img", TreeBuilder.IMG | SPECIAL); - public static final ElementName INS = new ElementName("ins", "ins", TreeBuilder.OTHER); - public static final ElementName INT = new ElementName("int", "int", TreeBuilder.OTHER); - public static final ElementName KBD = new ElementName("kbd", "kbd", TreeBuilder.OTHER); - public static final ElementName LOG = new ElementName("log", "log", TreeBuilder.OTHER); - public static final ElementName LCM = new ElementName("lcm", "lcm", TreeBuilder.OTHER); - public static final ElementName LEQ = new ElementName("leq", "leq", TreeBuilder.OTHER); - public static final ElementName MTD = new ElementName("mtd", "mtd", TreeBuilder.OTHER); - public static final ElementName MIN = new ElementName("min", "min", TreeBuilder.OTHER); - public static final ElementName MAP = new ElementName("map", "map", TreeBuilder.OTHER); - public static final ElementName MTR = new ElementName("mtr", "mtr", TreeBuilder.OTHER); - public static final ElementName MAX = new ElementName("max", "max", TreeBuilder.OTHER); - public static final ElementName NEQ = new ElementName("neq", "neq", TreeBuilder.OTHER); - public static final ElementName NOT = new ElementName("not", "not", TreeBuilder.OTHER); - public static final ElementName NAV = new ElementName("nav", "nav", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName PRE = new ElementName("pre", "pre", TreeBuilder.PRE_OR_LISTING | SPECIAL); - public static final ElementName RTC = new ElementName("rtc", "rtc", TreeBuilder.RB_OR_RTC | OPTIONAL_END_TAG); - public static final ElementName REM = new ElementName("rem", "rem", TreeBuilder.OTHER); - public static final ElementName SUB = new ElementName("sub", "sub", TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR); - public static final ElementName SEC = new ElementName("sec", "sec", TreeBuilder.OTHER); - public static final ElementName SVG = new ElementName("svg", "svg", TreeBuilder.SVG); - public static final ElementName SUM = new ElementName("sum", "sum", TreeBuilder.OTHER); - public static final ElementName SIN = new ElementName("sin", "sin", TreeBuilder.OTHER); - public static final ElementName SEP = new ElementName("sep", "sep", TreeBuilder.OTHER); - public static final ElementName SUP = new ElementName("sup", "sup", TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR); - public static final ElementName SET = new ElementName("set", "set", TreeBuilder.OTHER); - public static final ElementName TAN = new ElementName("tan", "tan", TreeBuilder.OTHER); - public static final ElementName USE = new ElementName("use", "use", TreeBuilder.OTHER); - public static final ElementName VAR = new ElementName("var", "var", TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR); - public static final ElementName WBR = new ElementName("wbr", "wbr", TreeBuilder.AREA_OR_WBR | SPECIAL); - public static final ElementName XMP = new ElementName("xmp", "xmp", TreeBuilder.XMP | SPECIAL); - public static final ElementName XOR = new ElementName("xor", "xor", TreeBuilder.OTHER); - public static final ElementName AREA = new ElementName("area", "area", TreeBuilder.AREA_OR_WBR | SPECIAL); - public static final ElementName ABBR = new ElementName("abbr", "abbr", TreeBuilder.OTHER); - public static final ElementName BASE = new ElementName("base", "base", TreeBuilder.BASE | SPECIAL); - public static final ElementName BVAR = new ElementName("bvar", "bvar", TreeBuilder.OTHER); - public static final ElementName BODY = new ElementName("body", "body", TreeBuilder.BODY | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName CARD = new ElementName("card", "card", TreeBuilder.OTHER); - public static final ElementName CODE = new ElementName("code", "code", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName CITE = new ElementName("cite", "cite", TreeBuilder.OTHER); - public static final ElementName CSCH = new ElementName("csch", "csch", TreeBuilder.OTHER); - public static final ElementName COSH = new ElementName("cosh", "cosh", TreeBuilder.OTHER); - public static final ElementName COTH = new ElementName("coth", "coth", TreeBuilder.OTHER); - public static final ElementName CURL = new ElementName("curl", "curl", TreeBuilder.OTHER); - public static final ElementName DESC = new ElementName("desc", "desc", TreeBuilder.FOREIGNOBJECT_OR_DESC | SCOPING_AS_SVG); - public static final ElementName DIFF = new ElementName("diff", "diff", TreeBuilder.OTHER); - public static final ElementName DEFS = new ElementName("defs", "defs", TreeBuilder.OTHER); - public static final ElementName FORM = new ElementName("form", "form", TreeBuilder.FORM | SPECIAL); - public static final ElementName FONT = new ElementName("font", "font", TreeBuilder.FONT); - public static final ElementName GRAD = new ElementName("grad", "grad", TreeBuilder.OTHER); - public static final ElementName HEAD = new ElementName("head", "head", TreeBuilder.HEAD | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName HTML = new ElementName("html", "html", TreeBuilder.HTML | SPECIAL | SCOPING | OPTIONAL_END_TAG); - public static final ElementName LINE = new ElementName("line", "line", TreeBuilder.OTHER); - public static final ElementName LINK = new ElementName("link", "link", TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND | SPECIAL); - public static final ElementName LIST = new ElementName("list", "list", TreeBuilder.OTHER); - public static final ElementName META = new ElementName("meta", "meta", TreeBuilder.META | SPECIAL); - public static final ElementName MSUB = new ElementName("msub", "msub", TreeBuilder.OTHER); - public static final ElementName MODE = new ElementName("mode", "mode", TreeBuilder.OTHER); - public static final ElementName MATH = new ElementName("math", "math", TreeBuilder.MATH); - public static final ElementName MARK = new ElementName("mark", "mark", TreeBuilder.OTHER); - public static final ElementName MASK = new ElementName("mask", "mask", TreeBuilder.OTHER); - public static final ElementName MEAN = new ElementName("mean", "mean", TreeBuilder.OTHER); - public static final ElementName MAIN = new ElementName("main", "main", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName MSUP = new ElementName("msup", "msup", TreeBuilder.OTHER); - public static final ElementName MENU = new ElementName("menu", "menu", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL); - public static final ElementName MROW = new ElementName("mrow", "mrow", TreeBuilder.OTHER); - public static final ElementName NONE = new ElementName("none", "none", TreeBuilder.OTHER); - public static final ElementName NOBR = new ElementName("nobr", "nobr", TreeBuilder.NOBR); - public static final ElementName NEST = new ElementName("nest", "nest", TreeBuilder.OTHER); - public static final ElementName PATH = new ElementName("path", "path", TreeBuilder.OTHER); - public static final ElementName PLUS = new ElementName("plus", "plus", TreeBuilder.OTHER); - public static final ElementName RULE = new ElementName("rule", "rule", TreeBuilder.OTHER); - public static final ElementName REAL = new ElementName("real", "real", TreeBuilder.OTHER); - public static final ElementName RELN = new ElementName("reln", "reln", TreeBuilder.OTHER); - public static final ElementName RECT = new ElementName("rect", "rect", TreeBuilder.OTHER); - public static final ElementName ROOT = new ElementName("root", "root", TreeBuilder.OTHER); - public static final ElementName RUBY = new ElementName("ruby", "ruby", TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR); - public static final ElementName SECH = new ElementName("sech", "sech", TreeBuilder.OTHER); - public static final ElementName SINH = new ElementName("sinh", "sinh", TreeBuilder.OTHER); - public static final ElementName SPAN = new ElementName("span", "span", TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR); - public static final ElementName SAMP = new ElementName("samp", "samp", TreeBuilder.OTHER); - public static final ElementName STOP = new ElementName("stop", "stop", TreeBuilder.OTHER); - public static final ElementName SDEV = new ElementName("sdev", "sdev", TreeBuilder.OTHER); - public static final ElementName TIME = new ElementName("time", "time", TreeBuilder.OTHER); - public static final ElementName TRUE = new ElementName("true", "true", TreeBuilder.OTHER); - public static final ElementName TREF = new ElementName("tref", "tref", TreeBuilder.OTHER); - public static final ElementName TANH = new ElementName("tanh", "tanh", TreeBuilder.OTHER); - public static final ElementName TEXT = new ElementName("text", "text", TreeBuilder.OTHER); - public static final ElementName VIEW = new ElementName("view", "view", TreeBuilder.OTHER); - public static final ElementName ASIDE = new ElementName("aside", "aside", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName AUDIO = new ElementName("audio", "audio", TreeBuilder.OTHER); - public static final ElementName APPLY = new ElementName("apply", "apply", TreeBuilder.OTHER); - public static final ElementName EMBED = new ElementName("embed", "embed", TreeBuilder.EMBED | SPECIAL); - public static final ElementName FRAME = new ElementName("frame", "frame", TreeBuilder.FRAME | SPECIAL); - public static final ElementName FALSE = new ElementName("false", "false", TreeBuilder.OTHER); - public static final ElementName FLOOR = new ElementName("floor", "floor", TreeBuilder.OTHER); - public static final ElementName GLYPH = new ElementName("glyph", "glyph", TreeBuilder.OTHER); - public static final ElementName HKERN = new ElementName("hkern", "hkern", TreeBuilder.OTHER); - public static final ElementName IMAGE = new ElementName("image", "image", TreeBuilder.IMAGE); - public static final ElementName IDENT = new ElementName("ident", "ident", TreeBuilder.OTHER); - public static final ElementName INPUT = new ElementName("input", "input", TreeBuilder.INPUT | SPECIAL); - public static final ElementName LABEL = new ElementName("label", "label", TreeBuilder.OTHER); - public static final ElementName LIMIT = new ElementName("limit", "limit", TreeBuilder.OTHER); - public static final ElementName MFRAC = new ElementName("mfrac", "mfrac", TreeBuilder.OTHER); - public static final ElementName MPATH = new ElementName("mpath", "mpath", TreeBuilder.OTHER); - public static final ElementName METER = new ElementName("meter", "meter", TreeBuilder.OTHER); - public static final ElementName MOVER = new ElementName("mover", "mover", TreeBuilder.OTHER); - public static final ElementName MINUS = new ElementName("minus", "minus", TreeBuilder.OTHER); - public static final ElementName MROOT = new ElementName("mroot", "mroot", TreeBuilder.OTHER); - public static final ElementName MSQRT = new ElementName("msqrt", "msqrt", TreeBuilder.OTHER); - public static final ElementName MTEXT = new ElementName("mtext", "mtext", TreeBuilder.MI_MO_MN_MS_MTEXT | SCOPING_AS_MATHML); - public static final ElementName NOTIN = new ElementName("notin", "notin", TreeBuilder.OTHER); - public static final ElementName PIECE = new ElementName("piece", "piece", TreeBuilder.OTHER); - public static final ElementName PARAM = new ElementName("param", "param", TreeBuilder.PARAM_OR_SOURCE_OR_TRACK | SPECIAL); - public static final ElementName POWER = new ElementName("power", "power", TreeBuilder.OTHER); - public static final ElementName REALS = new ElementName("reals", "reals", TreeBuilder.OTHER); - public static final ElementName STYLE = new ElementName("style", "style", TreeBuilder.STYLE | SPECIAL); - public static final ElementName SMALL = new ElementName("small", "small", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName THEAD = new ElementName("thead", "thead", TreeBuilder.TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG); - public static final ElementName TABLE = new ElementName("table", "table", TreeBuilder.TABLE | SPECIAL | FOSTER_PARENTING | SCOPING); - public static final ElementName TITLE = new ElementName("title", "title", TreeBuilder.TITLE | SPECIAL | SCOPING_AS_SVG); - public static final ElementName TRACK = new ElementName("track", "track", TreeBuilder.PARAM_OR_SOURCE_OR_TRACK | SPECIAL); - public static final ElementName TSPAN = new ElementName("tspan", "tspan", TreeBuilder.OTHER); - public static final ElementName TIMES = new ElementName("times", "times", TreeBuilder.OTHER); - public static final ElementName TFOOT = new ElementName("tfoot", "tfoot", TreeBuilder.TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG); - public static final ElementName TBODY = new ElementName("tbody", "tbody", TreeBuilder.TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG); - public static final ElementName UNION = new ElementName("union", "union", TreeBuilder.OTHER); - public static final ElementName VKERN = new ElementName("vkern", "vkern", TreeBuilder.OTHER); - public static final ElementName VIDEO = new ElementName("video", "video", TreeBuilder.OTHER); - public static final ElementName ARCSEC = new ElementName("arcsec", "arcsec", TreeBuilder.OTHER); - public static final ElementName ARCCSC = new ElementName("arccsc", "arccsc", TreeBuilder.OTHER); - public static final ElementName ARCTAN = new ElementName("arctan", "arctan", TreeBuilder.OTHER); - public static final ElementName ARCSIN = new ElementName("arcsin", "arcsin", TreeBuilder.OTHER); - public static final ElementName ARCCOS = new ElementName("arccos", "arccos", TreeBuilder.OTHER); - public static final ElementName APPLET = new ElementName("applet", "applet", TreeBuilder.MARQUEE_OR_APPLET | SPECIAL | SCOPING); - public static final ElementName ARCCOT = new ElementName("arccot", "arccot", TreeBuilder.OTHER); - public static final ElementName APPROX = new ElementName("approx", "approx", TreeBuilder.OTHER); - public static final ElementName BUTTON = new ElementName("button", "button", TreeBuilder.BUTTON | SPECIAL); - public static final ElementName CIRCLE = new ElementName("circle", "circle", TreeBuilder.OTHER); - public static final ElementName CENTER = new ElementName("center", "center", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL); - public static final ElementName CURSOR = new ElementName("cursor", "cursor", TreeBuilder.OTHER); - public static final ElementName CANVAS = new ElementName("canvas", "canvas", TreeBuilder.OTHER); - public static final ElementName DIVIDE = new ElementName("divide", "divide", TreeBuilder.OTHER); - public static final ElementName DEGREE = new ElementName("degree", "degree", TreeBuilder.OTHER); - public static final ElementName DOMAIN = new ElementName("domain", "domain", TreeBuilder.OTHER); - public static final ElementName EXISTS = new ElementName("exists", "exists", TreeBuilder.OTHER); - public static final ElementName FETILE = new ElementName("fetile", "feTile", TreeBuilder.OTHER); - public static final ElementName FIGURE = new ElementName("figure", "figure", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName FORALL = new ElementName("forall", "forall", TreeBuilder.OTHER); - public static final ElementName FILTER = new ElementName("filter", "filter", TreeBuilder.OTHER); - public static final ElementName FOOTER = new ElementName("footer", "footer", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName HGROUP = new ElementName("hgroup", "hgroup", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName HEADER = new ElementName("header", "header", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName IFRAME = new ElementName("iframe", "iframe", TreeBuilder.IFRAME | SPECIAL); - public static final ElementName KEYGEN = new ElementName("keygen", "keygen", TreeBuilder.KEYGEN); - public static final ElementName LAMBDA = new ElementName("lambda", "lambda", TreeBuilder.OTHER); - public static final ElementName LEGEND = new ElementName("legend", "legend", TreeBuilder.OTHER); - public static final ElementName MSPACE = new ElementName("mspace", "mspace", TreeBuilder.OTHER); - public static final ElementName MTABLE = new ElementName("mtable", "mtable", TreeBuilder.OTHER); - public static final ElementName MSTYLE = new ElementName("mstyle", "mstyle", TreeBuilder.OTHER); - public static final ElementName MGLYPH = new ElementName("mglyph", "mglyph", TreeBuilder.MGLYPH_OR_MALIGNMARK); - public static final ElementName MEDIAN = new ElementName("median", "median", TreeBuilder.OTHER); - public static final ElementName MUNDER = new ElementName("munder", "munder", TreeBuilder.OTHER); - public static final ElementName MARKER = new ElementName("marker", "marker", TreeBuilder.OTHER); - public static final ElementName MERROR = new ElementName("merror", "merror", TreeBuilder.OTHER); - public static final ElementName MOMENT = new ElementName("moment", "moment", TreeBuilder.OTHER); - public static final ElementName MATRIX = new ElementName("matrix", "matrix", TreeBuilder.OTHER); - public static final ElementName OPTION = new ElementName("option", "option", TreeBuilder.OPTION | OPTIONAL_END_TAG); - public static final ElementName OBJECT = new ElementName("object", "object", TreeBuilder.OBJECT | SPECIAL | SCOPING); - public static final ElementName OUTPUT = new ElementName("output", "output", TreeBuilder.OUTPUT); - public static final ElementName PRIMES = new ElementName("primes", "primes", TreeBuilder.OTHER); - public static final ElementName SOURCE = new ElementName("source", "source", TreeBuilder.PARAM_OR_SOURCE_OR_TRACK); - public static final ElementName STRIKE = new ElementName("strike", "strike", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName STRONG = new ElementName("strong", "strong", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U); - public static final ElementName SWITCH = new ElementName("switch", "switch", TreeBuilder.OTHER); - public static final ElementName SYMBOL = new ElementName("symbol", "symbol", TreeBuilder.OTHER); - public static final ElementName SELECT = new ElementName("select", "select", TreeBuilder.SELECT | SPECIAL); - public static final ElementName SUBSET = new ElementName("subset", "subset", TreeBuilder.OTHER); - public static final ElementName SCRIPT = new ElementName("script", "script", TreeBuilder.SCRIPT | SPECIAL); - public static final ElementName TBREAK = new ElementName("tbreak", "tbreak", TreeBuilder.OTHER); - public static final ElementName VECTOR = new ElementName("vector", "vector", TreeBuilder.OTHER); - public static final ElementName ARTICLE = new ElementName("article", "article", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName ANIMATE = new ElementName("animate", "animate", TreeBuilder.OTHER); - public static final ElementName ARCSECH = new ElementName("arcsech", "arcsech", TreeBuilder.OTHER); - public static final ElementName ARCCSCH = new ElementName("arccsch", "arccsch", TreeBuilder.OTHER); - public static final ElementName ARCTANH = new ElementName("arctanh", "arctanh", TreeBuilder.OTHER); - public static final ElementName ARCSINH = new ElementName("arcsinh", "arcsinh", TreeBuilder.OTHER); - public static final ElementName ARCCOSH = new ElementName("arccosh", "arccosh", TreeBuilder.OTHER); - public static final ElementName ARCCOTH = new ElementName("arccoth", "arccoth", TreeBuilder.OTHER); - public static final ElementName ACRONYM = new ElementName("acronym", "acronym", TreeBuilder.OTHER); - public static final ElementName ADDRESS = new ElementName("address", "address", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName BGSOUND = new ElementName("bgsound", "bgsound", TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND | SPECIAL); - public static final ElementName COMPOSE = new ElementName("compose", "compose", TreeBuilder.OTHER); - public static final ElementName CEILING = new ElementName("ceiling", "ceiling", TreeBuilder.OTHER); - public static final ElementName CSYMBOL = new ElementName("csymbol", "csymbol", TreeBuilder.OTHER); - public static final ElementName CAPTION = new ElementName("caption", "caption", TreeBuilder.CAPTION | SPECIAL | SCOPING); - public static final ElementName DISCARD = new ElementName("discard", "discard", TreeBuilder.OTHER); - public static final ElementName DECLARE = new ElementName("declare", "declare", TreeBuilder.OTHER); - public static final ElementName DETAILS = new ElementName("details", "details", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName ELLIPSE = new ElementName("ellipse", "ellipse", TreeBuilder.OTHER); - public static final ElementName FEFUNCA = new ElementName("fefunca", "feFuncA", TreeBuilder.OTHER); - public static final ElementName FEFUNCB = new ElementName("fefuncb", "feFuncB", TreeBuilder.OTHER); - public static final ElementName FEBLEND = new ElementName("feblend", "feBlend", TreeBuilder.OTHER); - public static final ElementName FEFLOOD = new ElementName("feflood", "feFlood", TreeBuilder.OTHER); - public static final ElementName FEIMAGE = new ElementName("feimage", "feImage", TreeBuilder.OTHER); - public static final ElementName FEMERGE = new ElementName("femerge", "feMerge", TreeBuilder.OTHER); - public static final ElementName FEFUNCG = new ElementName("fefuncg", "feFuncG", TreeBuilder.OTHER); - public static final ElementName FEFUNCR = new ElementName("fefuncr", "feFuncR", TreeBuilder.OTHER); - public static final ElementName HANDLER = new ElementName("handler", "handler", TreeBuilder.OTHER); - public static final ElementName INVERSE = new ElementName("inverse", "inverse", TreeBuilder.OTHER); - public static final ElementName IMPLIES = new ElementName("implies", "implies", TreeBuilder.OTHER); - public static final ElementName ISINDEX = new ElementName("isindex", "isindex", TreeBuilder.ISINDEX | SPECIAL); - public static final ElementName LOGBASE = new ElementName("logbase", "logbase", TreeBuilder.OTHER); - public static final ElementName LISTING = new ElementName("listing", "listing", TreeBuilder.PRE_OR_LISTING | SPECIAL); - public static final ElementName MFENCED = new ElementName("mfenced", "mfenced", TreeBuilder.OTHER); - public static final ElementName MPADDED = new ElementName("mpadded", "mpadded", TreeBuilder.OTHER); - public static final ElementName MARQUEE = new ElementName("marquee", "marquee", TreeBuilder.MARQUEE_OR_APPLET | SPECIAL | SCOPING); - public static final ElementName MACTION = new ElementName("maction", "maction", TreeBuilder.OTHER); - public static final ElementName MSUBSUP = new ElementName("msubsup", "msubsup", TreeBuilder.OTHER); - public static final ElementName NOEMBED = new ElementName("noembed", "noembed", TreeBuilder.NOEMBED | SPECIAL); - public static final ElementName POLYGON = new ElementName("polygon", "polygon", TreeBuilder.OTHER); - public static final ElementName PATTERN = new ElementName("pattern", "pattern", TreeBuilder.OTHER); - public static final ElementName PICTURE = new ElementName("picture", "picture", TreeBuilder.OTHER); - public static final ElementName PRODUCT = new ElementName("product", "product", TreeBuilder.OTHER); - public static final ElementName SETDIFF = new ElementName("setdiff", "setdiff", TreeBuilder.OTHER); - public static final ElementName SECTION = new ElementName("section", "section", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName SUMMARY = new ElementName("summary", "summary", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName TENDSTO = new ElementName("tendsto", "tendsto", TreeBuilder.OTHER); - public static final ElementName UPLIMIT = new ElementName("uplimit", "uplimit", TreeBuilder.OTHER); - public static final ElementName ALTGLYPH = new ElementName("altglyph", "altGlyph", TreeBuilder.OTHER); - public static final ElementName BASEFONT = new ElementName("basefont", "basefont", TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND | SPECIAL); - public static final ElementName CLIPPATH = new ElementName("clippath", "clipPath", TreeBuilder.OTHER); - public static final ElementName CODOMAIN = new ElementName("codomain", "codomain", TreeBuilder.OTHER); - public static final ElementName COLGROUP = new ElementName("colgroup", "colgroup", TreeBuilder.COLGROUP | SPECIAL | OPTIONAL_END_TAG); - public static final ElementName EMPTYSET = new ElementName("emptyset", "emptyset", TreeBuilder.OTHER); - public static final ElementName FACTOROF = new ElementName("factorof", "factorof", TreeBuilder.OTHER); - public static final ElementName FIELDSET = new ElementName("fieldset", "fieldset", TreeBuilder.FIELDSET | SPECIAL); - public static final ElementName FRAMESET = new ElementName("frameset", "frameset", TreeBuilder.FRAMESET | SPECIAL); - public static final ElementName FEOFFSET = new ElementName("feoffset", "feOffset", TreeBuilder.OTHER); - public static final ElementName GLYPHREF = new ElementName("glyphref", "glyphRef", TreeBuilder.OTHER); - public static final ElementName INTERVAL = new ElementName("interval", "interval", TreeBuilder.OTHER); - public static final ElementName INTEGERS = new ElementName("integers", "integers", TreeBuilder.OTHER); - public static final ElementName INFINITY = new ElementName("infinity", "infinity", TreeBuilder.OTHER); - public static final ElementName LISTENER = new ElementName("listener", "listener", TreeBuilder.OTHER); - public static final ElementName LOWLIMIT = new ElementName("lowlimit", "lowlimit", TreeBuilder.OTHER); - public static final ElementName METADATA = new ElementName("metadata", "metadata", TreeBuilder.OTHER); - public static final ElementName MENCLOSE = new ElementName("menclose", "menclose", TreeBuilder.OTHER); - public static final ElementName MENUITEM = new ElementName("menuitem", "menuitem", TreeBuilder.MENUITEM); - public static final ElementName MPHANTOM = new ElementName("mphantom", "mphantom", TreeBuilder.OTHER); - public static final ElementName NOFRAMES = new ElementName("noframes", "noframes", TreeBuilder.NOFRAMES | SPECIAL); - public static final ElementName NOSCRIPT = new ElementName("noscript", "noscript", TreeBuilder.NOSCRIPT | SPECIAL); - public static final ElementName OPTGROUP = new ElementName("optgroup", "optgroup", TreeBuilder.OPTGROUP | OPTIONAL_END_TAG); - public static final ElementName POLYLINE = new ElementName("polyline", "polyline", TreeBuilder.OTHER); - public static final ElementName PREFETCH = new ElementName("prefetch", "prefetch", TreeBuilder.OTHER); - public static final ElementName PROGRESS = new ElementName("progress", "progress", TreeBuilder.OTHER); - public static final ElementName PRSUBSET = new ElementName("prsubset", "prsubset", TreeBuilder.OTHER); - public static final ElementName QUOTIENT = new ElementName("quotient", "quotient", TreeBuilder.OTHER); - public static final ElementName SELECTOR = new ElementName("selector", "selector", TreeBuilder.OTHER); - public static final ElementName TEXTAREA = new ElementName("textarea", "textarea", TreeBuilder.TEXTAREA | SPECIAL); - public static final ElementName TEMPLATE = new ElementName("template", "template", TreeBuilder.TEMPLATE | SPECIAL | SCOPING); - public static final ElementName TEXTPATH = new ElementName("textpath", "textPath", TreeBuilder.OTHER); - public static final ElementName VARIANCE = new ElementName("variance", "variance", TreeBuilder.OTHER); - public static final ElementName ANIMATION = new ElementName("animation", "animation", TreeBuilder.OTHER); - public static final ElementName CONJUGATE = new ElementName("conjugate", "conjugate", TreeBuilder.OTHER); - public static final ElementName CONDITION = new ElementName("condition", "condition", TreeBuilder.OTHER); - public static final ElementName COMPLEXES = new ElementName("complexes", "complexes", TreeBuilder.OTHER); - public static final ElementName FONT_FACE = new ElementName("font-face", "font-face", TreeBuilder.OTHER); - public static final ElementName FACTORIAL = new ElementName("factorial", "factorial", TreeBuilder.OTHER); - public static final ElementName INTERSECT = new ElementName("intersect", "intersect", TreeBuilder.OTHER); - public static final ElementName IMAGINARY = new ElementName("imaginary", "imaginary", TreeBuilder.OTHER); - public static final ElementName LAPLACIAN = new ElementName("laplacian", "laplacian", TreeBuilder.OTHER); - public static final ElementName MATRIXROW = new ElementName("matrixrow", "matrixrow", TreeBuilder.OTHER); - public static final ElementName NOTSUBSET = new ElementName("notsubset", "notsubset", TreeBuilder.OTHER); - public static final ElementName OTHERWISE = new ElementName("otherwise", "otherwise", TreeBuilder.OTHER); - public static final ElementName PIECEWISE = new ElementName("piecewise", "piecewise", TreeBuilder.OTHER); - public static final ElementName PLAINTEXT = new ElementName("plaintext", "plaintext", TreeBuilder.PLAINTEXT | SPECIAL); - public static final ElementName RATIONALS = new ElementName("rationals", "rationals", TreeBuilder.OTHER); - public static final ElementName SEMANTICS = new ElementName("semantics", "semantics", TreeBuilder.OTHER); - public static final ElementName TRANSPOSE = new ElementName("transpose", "transpose", TreeBuilder.OTHER); - public static final ElementName ANNOTATION = new ElementName("annotation", "annotation", TreeBuilder.OTHER); - public static final ElementName BLOCKQUOTE = new ElementName("blockquote", "blockquote", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL); - public static final ElementName DIVERGENCE = new ElementName("divergence", "divergence", TreeBuilder.OTHER); - public static final ElementName EULERGAMMA = new ElementName("eulergamma", "eulergamma", TreeBuilder.OTHER); - public static final ElementName EQUIVALENT = new ElementName("equivalent", "equivalent", TreeBuilder.OTHER); - public static final ElementName FIGCAPTION = new ElementName("figcaption", "figcaption", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL); - public static final ElementName IMAGINARYI = new ElementName("imaginaryi", "imaginaryi", TreeBuilder.OTHER); - public static final ElementName MALIGNMARK = new ElementName("malignmark", "malignmark", TreeBuilder.MGLYPH_OR_MALIGNMARK); - public static final ElementName MUNDEROVER = new ElementName("munderover", "munderover", TreeBuilder.OTHER); - public static final ElementName MLABELEDTR = new ElementName("mlabeledtr", "mlabeledtr", TreeBuilder.OTHER); - public static final ElementName NOTANUMBER = new ElementName("notanumber", "notanumber", TreeBuilder.OTHER); - public static final ElementName SOLIDCOLOR = new ElementName("solidcolor", "solidcolor", TreeBuilder.OTHER); - public static final ElementName ALTGLYPHDEF = new ElementName("altglyphdef", "altGlyphDef", TreeBuilder.OTHER); - public static final ElementName DETERMINANT = new ElementName("determinant", "determinant", TreeBuilder.OTHER); - public static final ElementName FEMERGENODE = new ElementName("femergenode", "feMergeNode", TreeBuilder.OTHER); - public static final ElementName FECOMPOSITE = new ElementName("fecomposite", "feComposite", TreeBuilder.OTHER); - public static final ElementName FESPOTLIGHT = new ElementName("fespotlight", "feSpotLight", TreeBuilder.OTHER); - public static final ElementName MALIGNGROUP = new ElementName("maligngroup", "maligngroup", TreeBuilder.OTHER); - public static final ElementName MPRESCRIPTS = new ElementName("mprescripts", "mprescripts", TreeBuilder.OTHER); - public static final ElementName MOMENTABOUT = new ElementName("momentabout", "momentabout", TreeBuilder.OTHER); - public static final ElementName NOTPRSUBSET = new ElementName("notprsubset", "notprsubset", TreeBuilder.OTHER); - public static final ElementName PARTIALDIFF = new ElementName("partialdiff", "partialdiff", TreeBuilder.OTHER); - public static final ElementName ALTGLYPHITEM = new ElementName("altglyphitem", "altGlyphItem", TreeBuilder.OTHER); - public static final ElementName ANIMATECOLOR = new ElementName("animatecolor", "animateColor", TreeBuilder.OTHER); - public static final ElementName DATATEMPLATE = new ElementName("datatemplate", "datatemplate", TreeBuilder.OTHER); - public static final ElementName EXPONENTIALE = new ElementName("exponentiale", "exponentiale", TreeBuilder.OTHER); - public static final ElementName FETURBULENCE = new ElementName("feturbulence", "feTurbulence", TreeBuilder.OTHER); - public static final ElementName FEPOINTLIGHT = new ElementName("fepointlight", "fePointLight", TreeBuilder.OTHER); - public static final ElementName FEDROPSHADOW = new ElementName("fedropshadow", "feDropShadow", TreeBuilder.OTHER); - public static final ElementName FEMORPHOLOGY = new ElementName("femorphology", "feMorphology", TreeBuilder.OTHER); - public static final ElementName OUTERPRODUCT = new ElementName("outerproduct", "outerproduct", TreeBuilder.OTHER); - public static final ElementName ANIMATEMOTION = new ElementName("animatemotion", "animateMotion", TreeBuilder.OTHER); - public static final ElementName COLOR_PROFILE = new ElementName("color-profile", "color-profile", TreeBuilder.OTHER); - public static final ElementName FONT_FACE_SRC = new ElementName("font-face-src", "font-face-src", TreeBuilder.OTHER); - public static final ElementName FONT_FACE_URI = new ElementName("font-face-uri", "font-face-uri", TreeBuilder.OTHER); - public static final ElementName FOREIGNOBJECT = new ElementName("foreignobject", "foreignObject", TreeBuilder.FOREIGNOBJECT_OR_DESC | SCOPING_AS_SVG); - public static final ElementName FECOLORMATRIX = new ElementName("fecolormatrix", "feColorMatrix", TreeBuilder.OTHER); - public static final ElementName MISSING_GLYPH = new ElementName("missing-glyph", "missing-glyph", TreeBuilder.OTHER); - public static final ElementName MMULTISCRIPTS = new ElementName("mmultiscripts", "mmultiscripts", TreeBuilder.OTHER); - public static final ElementName SCALARPRODUCT = new ElementName("scalarproduct", "scalarproduct", TreeBuilder.OTHER); - public static final ElementName VECTORPRODUCT = new ElementName("vectorproduct", "vectorproduct", TreeBuilder.OTHER); - public static final ElementName ANNOTATION_XML = new ElementName("annotation-xml", "annotation-xml", TreeBuilder.ANNOTATION_XML | SCOPING_AS_MATHML); - public static final ElementName DEFINITION_SRC = new ElementName("definition-src", "definition-src", TreeBuilder.OTHER); - public static final ElementName FONT_FACE_NAME = new ElementName("font-face-name", "font-face-name", TreeBuilder.OTHER); - public static final ElementName FEGAUSSIANBLUR = new ElementName("fegaussianblur", "feGaussianBlur", TreeBuilder.OTHER); - public static final ElementName FEDISTANTLIGHT = new ElementName("fedistantlight", "feDistantLight", TreeBuilder.OTHER); - public static final ElementName LINEARGRADIENT = new ElementName("lineargradient", "linearGradient", TreeBuilder.OTHER); - public static final ElementName NATURALNUMBERS = new ElementName("naturalnumbers", "naturalnumbers", TreeBuilder.OTHER); - public static final ElementName RADIALGRADIENT = new ElementName("radialgradient", "radialGradient", TreeBuilder.OTHER); - public static final ElementName ANIMATETRANSFORM = new ElementName("animatetransform", "animateTransform", TreeBuilder.OTHER); - public static final ElementName CARTESIANPRODUCT = new ElementName("cartesianproduct", "cartesianproduct", TreeBuilder.OTHER); - public static final ElementName FONT_FACE_FORMAT = new ElementName("font-face-format", "font-face-format", TreeBuilder.OTHER); - public static final ElementName FECONVOLVEMATRIX = new ElementName("feconvolvematrix", "feConvolveMatrix", TreeBuilder.OTHER); - public static final ElementName FEDIFFUSELIGHTING = new ElementName("fediffuselighting", "feDiffuseLighting", TreeBuilder.OTHER); - public static final ElementName FEDISPLACEMENTMAP = new ElementName("fedisplacementmap", "feDisplacementMap", TreeBuilder.OTHER); - public static final ElementName FESPECULARLIGHTING = new ElementName("fespecularlighting", "feSpecularLighting", TreeBuilder.OTHER); - public static final ElementName DOMAINOFAPPLICATION = new ElementName("domainofapplication", "domainofapplication", TreeBuilder.OTHER); - public static final ElementName FECOMPONENTTRANSFER = new ElementName("fecomponenttransfer", "feComponentTransfer", TreeBuilder.OTHER); - private final static @NoLength ElementName[] ELEMENT_NAMES = { - A, - B, - G, - I, - P, - Q, - S, - U, - BR, - CI, - CN, - DD, - DL, - DT, - EM, - EQ, - FN, - H1, - H2, - H3, - H4, - H5, - H6, - GT, - HR, - IN, - LI, - LN, - LT, - MI, - MN, - MO, - MS, - OL, - OR, - PI, - RB, - RP, - RT, - TD, - TH, - TR, - TT, - UL, - AND, - ARG, - ABS, - BIG, - BDO, - CSC, - COL, - COS, - COT, - DEL, - DFN, - DIR, - DIV, - EXP, - GCD, - GEQ, - IMG, - INS, - INT, - KBD, - LOG, - LCM, - LEQ, - MTD, - MIN, - MAP, - MTR, - MAX, - NEQ, - NOT, - NAV, - PRE, - RTC, - REM, - SUB, - SEC, - SVG, - SUM, - SIN, - SEP, - SUP, - SET, - TAN, - USE, - VAR, - WBR, - XMP, - XOR, - AREA, - ABBR, - BASE, - BVAR, - BODY, - CARD, - CODE, - CITE, - CSCH, - COSH, - COTH, - CURL, - DESC, - DIFF, - DEFS, - FORM, - FONT, - GRAD, - HEAD, - HTML, - LINE, - LINK, - LIST, - META, - MSUB, - MODE, - MATH, - MARK, - MASK, - MEAN, - MAIN, - MSUP, - MENU, - MROW, - NONE, - NOBR, - NEST, - PATH, - PLUS, - RULE, - REAL, - RELN, - RECT, - ROOT, - RUBY, - SECH, - SINH, - SPAN, - SAMP, - STOP, - SDEV, - TIME, - TRUE, - TREF, - TANH, - TEXT, - VIEW, - ASIDE, - AUDIO, - APPLY, - EMBED, - FRAME, - FALSE, - FLOOR, - GLYPH, - HKERN, - IMAGE, - IDENT, - INPUT, - LABEL, - LIMIT, - MFRAC, - MPATH, - METER, - MOVER, - MINUS, - MROOT, - MSQRT, - MTEXT, - NOTIN, - PIECE, - PARAM, - POWER, - REALS, - STYLE, - SMALL, - THEAD, - TABLE, - TITLE, - TRACK, - TSPAN, - TIMES, - TFOOT, - TBODY, - UNION, - VKERN, - VIDEO, - ARCSEC, - ARCCSC, - ARCTAN, - ARCSIN, - ARCCOS, - APPLET, - ARCCOT, - APPROX, - BUTTON, - CIRCLE, - CENTER, - CURSOR, - CANVAS, - DIVIDE, - DEGREE, - DOMAIN, - EXISTS, - FETILE, - FIGURE, - FORALL, - FILTER, - FOOTER, - HGROUP, - HEADER, - IFRAME, - KEYGEN, - LAMBDA, - LEGEND, - MSPACE, - MTABLE, - MSTYLE, - MGLYPH, - MEDIAN, - MUNDER, - MARKER, - MERROR, - MOMENT, - MATRIX, - OPTION, - OBJECT, - OUTPUT, - PRIMES, - SOURCE, - STRIKE, - STRONG, - SWITCH, - SYMBOL, - SELECT, - SUBSET, - SCRIPT, - TBREAK, - VECTOR, - ARTICLE, - ANIMATE, - ARCSECH, - ARCCSCH, - ARCTANH, - ARCSINH, - ARCCOSH, - ARCCOTH, - ACRONYM, - ADDRESS, - BGSOUND, - COMPOSE, - CEILING, - CSYMBOL, - CAPTION, - DISCARD, - DECLARE, - DETAILS, - ELLIPSE, - FEFUNCA, - FEFUNCB, - FEBLEND, - FEFLOOD, - FEIMAGE, - FEMERGE, - FEFUNCG, - FEFUNCR, - HANDLER, - INVERSE, - IMPLIES, - ISINDEX, - LOGBASE, - LISTING, - MFENCED, - MPADDED, - MARQUEE, - MACTION, - MSUBSUP, - NOEMBED, - POLYGON, - PATTERN, - PICTURE, - PRODUCT, - SETDIFF, - SECTION, - SUMMARY, - TENDSTO, - UPLIMIT, - ALTGLYPH, - BASEFONT, - CLIPPATH, - CODOMAIN, - COLGROUP, - EMPTYSET, - FACTOROF, - FIELDSET, - FRAMESET, - FEOFFSET, - GLYPHREF, - INTERVAL, - INTEGERS, - INFINITY, - LISTENER, - LOWLIMIT, - METADATA, - MENCLOSE, - MENUITEM, - MPHANTOM, - NOFRAMES, - NOSCRIPT, - OPTGROUP, - POLYLINE, - PREFETCH, - PROGRESS, - PRSUBSET, - QUOTIENT, - SELECTOR, - TEXTAREA, - TEMPLATE, - TEXTPATH, - VARIANCE, - ANIMATION, - CONJUGATE, - CONDITION, - COMPLEXES, - FONT_FACE, - FACTORIAL, - INTERSECT, - IMAGINARY, - LAPLACIAN, - MATRIXROW, - NOTSUBSET, - OTHERWISE, - PIECEWISE, - PLAINTEXT, - RATIONALS, - SEMANTICS, - TRANSPOSE, - ANNOTATION, - BLOCKQUOTE, - DIVERGENCE, - EULERGAMMA, - EQUIVALENT, - FIGCAPTION, - IMAGINARYI, - MALIGNMARK, - MUNDEROVER, - MLABELEDTR, - NOTANUMBER, - SOLIDCOLOR, - ALTGLYPHDEF, - DETERMINANT, - FEMERGENODE, - FECOMPOSITE, - FESPOTLIGHT, - MALIGNGROUP, - MPRESCRIPTS, - MOMENTABOUT, - NOTPRSUBSET, - PARTIALDIFF, - ALTGLYPHITEM, - ANIMATECOLOR, - DATATEMPLATE, - EXPONENTIALE, - FETURBULENCE, - FEPOINTLIGHT, - FEDROPSHADOW, - FEMORPHOLOGY, - OUTERPRODUCT, - ANIMATEMOTION, - COLOR_PROFILE, - FONT_FACE_SRC, - FONT_FACE_URI, - FOREIGNOBJECT, - FECOLORMATRIX, - MISSING_GLYPH, - MMULTISCRIPTS, - SCALARPRODUCT, - VECTORPRODUCT, - ANNOTATION_XML, - DEFINITION_SRC, - FONT_FACE_NAME, - FEGAUSSIANBLUR, - FEDISTANTLIGHT, - LINEARGRADIENT, - NATURALNUMBERS, - RADIALGRADIENT, - ANIMATETRANSFORM, - CARTESIANPRODUCT, - FONT_FACE_FORMAT, - FECONVOLVEMATRIX, - FEDIFFUSELIGHTING, - FEDISPLACEMENTMAP, - FESPECULARLIGHTING, - DOMAINOFAPPLICATION, - FECOMPONENTTRANSFER, - }; - private final static int[] ELEMENT_HASHES = { - 1057, - 1090, - 1255, - 1321, - 1552, - 1585, - 1651, - 1717, - 68162, - 68899, - 69059, - 69764, - 70020, - 70276, - 71077, - 71205, - 72134, - 72232, - 72264, - 72296, - 72328, - 72360, - 72392, - 73351, - 74312, - 75209, - 78124, - 78284, - 78476, - 79149, - 79309, - 79341, - 79469, - 81295, - 81487, - 82224, - 84050, - 84498, - 84626, - 86164, - 86292, - 86612, - 86676, - 87445, - 3183041, - 3186241, - 3198017, - 3218722, - 3226754, - 3247715, - 3256803, - 3263971, - 3264995, - 3289252, - 3291332, - 3295524, - 3299620, - 3326725, - 3379303, - 3392679, - 3448233, - 3460553, - 3461577, - 3510347, - 3546604, - 3552364, - 3556524, - 3576461, - 3586349, - 3588141, - 3590797, - 3596333, - 3622062, - 3625454, - 3627054, - 3675728, - 3739282, - 3749042, - 3771059, - 3771571, - 3776211, - 3782323, - 3782963, - 3784883, - 3785395, - 3788979, - 3815476, - 3839605, - 3885110, - 3917911, - 3948984, - 3951096, - 135304769, - 135858241, - 136498210, - 136906434, - 137138658, - 137512995, - 137531875, - 137548067, - 137629283, - 137645539, - 137646563, - 137775779, - 138529956, - 138615076, - 139040932, - 140954086, - 141179366, - 141690439, - 142738600, - 143013512, - 146979116, - 147175724, - 147475756, - 147902637, - 147936877, - 148017645, - 148131885, - 148228141, - 148229165, - 148309165, - 148317229, - 148395629, - 148551853, - 148618829, - 149076462, - 149490158, - 149572782, - 151277616, - 151639440, - 153268914, - 153486514, - 153563314, - 153750706, - 153763314, - 153914034, - 154406067, - 154417459, - 154600979, - 154678323, - 154680979, - 154866835, - 155366708, - 155375188, - 155391572, - 155465780, - 155869364, - 158045494, - 168988979, - 169321621, - 169652752, - 173151309, - 174240818, - 174247297, - 174669292, - 175391532, - 176638123, - 177380397, - 177879204, - 177886734, - 180753473, - 181020073, - 181503558, - 181686320, - 181999237, - 181999311, - 182048201, - 182074866, - 182078003, - 182083764, - 182920847, - 184716457, - 184976961, - 185145071, - 187281445, - 187872052, - 188100653, - 188875944, - 188919873, - 188920457, - 189107250, - 189203987, - 189371817, - 189414886, - 189567458, - 190266670, - 191318187, - 191337609, - 202479203, - 202493027, - 202835587, - 202843747, - 203013219, - 203036048, - 203045987, - 203177552, - 203898516, - 204648562, - 205067918, - 205078130, - 205096654, - 205689142, - 205690439, - 205988909, - 207213161, - 207794484, - 207800999, - 208023602, - 208213644, - 208213647, - 210261490, - 210310273, - 210940978, - 213325049, - 213946445, - 214055079, - 215125040, - 215134273, - 215135028, - 215237420, - 215418148, - 215553166, - 215553394, - 215563858, - 215627949, - 215754324, - 217529652, - 217713834, - 217732628, - 218731945, - 221417045, - 221424946, - 221493746, - 221515401, - 221658189, - 221908140, - 221910626, - 221921586, - 222659762, - 225001091, - 236105833, - 236113965, - 236194995, - 236195427, - 236206132, - 236206387, - 236211683, - 236212707, - 236381647, - 236571826, - 237124271, - 238210544, - 238270764, - 238435405, - 238501172, - 239224867, - 239257644, - 239710497, - 240307721, - 241208789, - 241241557, - 241318060, - 241319404, - 241343533, - 241344069, - 241405397, - 241765845, - 243864964, - 244502085, - 244946220, - 245109902, - 247647266, - 247707956, - 248648814, - 248648836, - 248682161, - 248986932, - 249058914, - 249697357, - 252132601, - 252135604, - 251841204, - 252317348, - 255007012, - 255278388, - 255641645, - 256365156, - 257566121, - 269763372, - 271202790, - 271863856, - 272049197, - 272127474, - 274339449, - 274939471, - 275388004, - 275388005, - 275388006, - 275977800, - 278267602, - 278513831, - 278712622, - 281613765, - 281683369, - 282120228, - 282250732, - 282498697, - 282508942, - 283743649, - 283787570, - 284710386, - 285391148, - 285478533, - 285854898, - 285873762, - 286931113, - 288964227, - 289445441, - 289591340, - 289689648, - 291671489, - 303512884, - 305319975, - 305610036, - 305764101, - 308448294, - 308675890, - 312085683, - 312264750, - 315032867, - 316391000, - 317331042, - 317902135, - 318950711, - 319447220, - 321499182, - 322538804, - 323145200, - 337067316, - 337826293, - 339905989, - 340833697, - 341457068, - 342310196, - 345302593, - 349554733, - 349771471, - 349786245, - 350819405, - 356072847, - 370349192, - 373962798, - 375558638, - 375574835, - 376053993, - 383276530, - 383373833, - 383407586, - 384439906, - 386079012, - 404133513, - 404307343, - 407031852, - 408072233, - 409112005, - 409608425, - 409713793, - 409771500, - 419040932, - 437730612, - 439529766, - 442616365, - 442813037, - 443157674, - 443295316, - 450118444, - 450482697, - 456789668, - 459935396, - 471217869, - 474073645, - 476230702, - 476665218, - 476717289, - 483014825, - 485083298, - 489306281, - 538364390, - 540675748, - 543819186, - 543958612, - 576960820, - 577242548, - 610515252, - 642202932, - 644420819, - }; -} diff --git a/parser/html/javasrc/HtmlAttributes.java b/parser/html/javasrc/HtmlAttributes.java deleted file mode 100644 index 0ec25f96f..000000000 --- a/parser/html/javasrc/HtmlAttributes.java +++ /dev/null @@ -1,618 +0,0 @@ -/* - * Copyright (c) 2007 Henri Sivonen - * Copyright (c) 2008-2011 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import nu.validator.htmlparser.annotation.Auto; -import nu.validator.htmlparser.annotation.IdType; -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NsUri; -import nu.validator.htmlparser.annotation.Prefix; -import nu.validator.htmlparser.annotation.QName; -import nu.validator.htmlparser.common.Interner; -import nu.validator.htmlparser.common.XmlViolationPolicy; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Be careful with this class. QName is the name in from HTML tokenization. - * Otherwise, please refer to the interface doc. - * - * @version $Id: AttributesImpl.java 206 2008-03-20 14:09:29Z hsivonen $ - * @author hsivonen - */ -public final class HtmlAttributes implements Attributes { - - // [NOCPP[ - - private static final AttributeName[] EMPTY_ATTRIBUTENAMES = new AttributeName[0]; - - private static final String[] EMPTY_STRINGS = new String[0]; - - // ]NOCPP] - - public static final HtmlAttributes EMPTY_ATTRIBUTES = new HtmlAttributes( - AttributeName.HTML); - - private int mode; - - private int length; - - private @Auto AttributeName[] names; - - private @Auto String[] values; // XXX perhaps make this @NoLength? - - // CPPONLY: private @Auto int[] lines; // XXX perhaps make this @NoLength? - - // [NOCPP[ - - private String idValue; - - private int xmlnsLength; - - private AttributeName[] xmlnsNames; - - private String[] xmlnsValues; - - // ]NOCPP] - - public HtmlAttributes(int mode) { - this.mode = mode; - this.length = 0; - /* - * The length of 5 covers covers 98.3% of elements - * according to Hixie, but lets round to the next power of two for - * jemalloc. - */ - this.names = new AttributeName[8]; - this.values = new String[8]; - // CPPONLY: this.lines = new int[8]; - - // [NOCPP[ - - this.idValue = null; - - this.xmlnsLength = 0; - - this.xmlnsNames = HtmlAttributes.EMPTY_ATTRIBUTENAMES; - - this.xmlnsValues = HtmlAttributes.EMPTY_STRINGS; - - // ]NOCPP] - } - /* - public HtmlAttributes(HtmlAttributes other) { - this.mode = other.mode; - this.length = other.length; - this.names = new AttributeName[other.length]; - this.values = new String[other.length]; - // [NOCPP[ - this.idValue = other.idValue; - this.xmlnsLength = other.xmlnsLength; - this.xmlnsNames = new AttributeName[other.xmlnsLength]; - this.xmlnsValues = new String[other.xmlnsLength]; - // ]NOCPP] - } - */ - - void destructor() { - clear(0); - } - - /** - * Only use with a static argument - * - * @param name - * @return - */ - public int getIndex(AttributeName name) { - for (int i = 0; i < length; i++) { - if (names[i] == name) { - return i; - } - } - return -1; - } - - /** - * Only use with static argument. - * - * @see org.xml.sax.Attributes#getValue(java.lang.String) - */ - public String getValue(AttributeName name) { - int index = getIndex(name); - if (index == -1) { - return null; - } else { - return getValueNoBoundsCheck(index); - } - } - - public int getLength() { - return length; - } - - /** - * Variant of <code>getLocalName(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the local name at index - */ - public @Local String getLocalNameNoBoundsCheck(int index) { - // CPPONLY: assert index < length && index >= 0: "Index out of bounds"; - return names[index].getLocal(mode); - } - - /** - * Variant of <code>getURI(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the namespace URI at index - */ - public @NsUri String getURINoBoundsCheck(int index) { - // CPPONLY: assert index < length && index >= 0: "Index out of bounds"; - return names[index].getUri(mode); - } - - /** - * Variant of <code>getPrefix(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the namespace prefix at index - */ - public @Prefix String getPrefixNoBoundsCheck(int index) { - // CPPONLY: assert index < length && index >= 0: "Index out of bounds"; - return names[index].getPrefix(mode); - } - - /** - * Variant of <code>getValue(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the attribute value at index - */ - public String getValueNoBoundsCheck(int index) { - // CPPONLY: assert index < length && index >= 0: "Index out of bounds"; - return values[index]; - } - - /** - * Variant of <code>getAttributeName(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the attribute name at index - */ - public AttributeName getAttributeNameNoBoundsCheck(int index) { - // CPPONLY: assert index < length && index >= 0: "Index out of bounds"; - return names[index]; - } - - // CPPONLY: /** - // CPPONLY: * Obtains a line number without bounds check. - // CPPONLY: * @param index a valid attribute index - // CPPONLY: * @return the line number at index or -1 if unknown - // CPPONLY: */ - // CPPONLY: public int getLineNoBoundsCheck(int index) { - // CPPONLY: assert index < length && index >= 0: "Index out of bounds"; - // CPPONLY: return lines[index]; - // CPPONLY: } - - // [NOCPP[ - - /** - * Variant of <code>getQName(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the QName at index - */ - public @QName String getQNameNoBoundsCheck(int index) { - return names[index].getQName(mode); - } - - /** - * Variant of <code>getType(int index)</code> without bounds check. - * @param index a valid attribute index - * @return the attribute type at index - */ - public @IdType String getTypeNoBoundsCheck(int index) { - return (names[index] == AttributeName.ID) ? "ID" : "CDATA"; - } - - public int getIndex(String qName) { - for (int i = 0; i < length; i++) { - if (names[i].getQName(mode).equals(qName)) { - return i; - } - } - return -1; - } - - public int getIndex(String uri, String localName) { - for (int i = 0; i < length; i++) { - if (names[i].getLocal(mode).equals(localName) - && names[i].getUri(mode).equals(uri)) { - return i; - } - } - return -1; - } - - public @IdType String getType(String qName) { - int index = getIndex(qName); - if (index == -1) { - return null; - } else { - return getType(index); - } - } - - public @IdType String getType(String uri, String localName) { - int index = getIndex(uri, localName); - if (index == -1) { - return null; - } else { - return getType(index); - } - } - - public String getValue(String qName) { - int index = getIndex(qName); - if (index == -1) { - return null; - } else { - return getValue(index); - } - } - - public String getValue(String uri, String localName) { - int index = getIndex(uri, localName); - if (index == -1) { - return null; - } else { - return getValue(index); - } - } - - public @Local String getLocalName(int index) { - if (index < length && index >= 0) { - return names[index].getLocal(mode); - } else { - return null; - } - } - - public @QName String getQName(int index) { - if (index < length && index >= 0) { - return names[index].getQName(mode); - } else { - return null; - } - } - - public @IdType String getType(int index) { - if (index < length && index >= 0) { - return (names[index] == AttributeName.ID) ? "ID" : "CDATA"; - } else { - return null; - } - } - - public AttributeName getAttributeName(int index) { - if (index < length && index >= 0) { - return names[index]; - } else { - return null; - } - } - - public @NsUri String getURI(int index) { - if (index < length && index >= 0) { - return names[index].getUri(mode); - } else { - return null; - } - } - - public @Prefix String getPrefix(int index) { - if (index < length && index >= 0) { - return names[index].getPrefix(mode); - } else { - return null; - } - } - - public String getValue(int index) { - if (index < length && index >= 0) { - return values[index]; - } else { - return null; - } - } - - public String getId() { - return idValue; - } - - public int getXmlnsLength() { - return xmlnsLength; - } - - public @Local String getXmlnsLocalName(int index) { - if (index < xmlnsLength && index >= 0) { - return xmlnsNames[index].getLocal(mode); - } else { - return null; - } - } - - public @NsUri String getXmlnsURI(int index) { - if (index < xmlnsLength && index >= 0) { - return xmlnsNames[index].getUri(mode); - } else { - return null; - } - } - - public String getXmlnsValue(int index) { - if (index < xmlnsLength && index >= 0) { - return xmlnsValues[index]; - } else { - return null; - } - } - - public int getXmlnsIndex(AttributeName name) { - for (int i = 0; i < xmlnsLength; i++) { - if (xmlnsNames[i] == name) { - return i; - } - } - return -1; - } - - public String getXmlnsValue(AttributeName name) { - int index = getXmlnsIndex(name); - if (index == -1) { - return null; - } else { - return getXmlnsValue(index); - } - } - - public AttributeName getXmlnsAttributeName(int index) { - if (index < xmlnsLength && index >= 0) { - return xmlnsNames[index]; - } else { - return null; - } - } - - // ]NOCPP] - - void addAttribute(AttributeName name, String value - // [NOCPP[ - , XmlViolationPolicy xmlnsPolicy - // ]NOCPP] - // CPPONLY: , int line - ) throws SAXException { - // [NOCPP[ - if (name == AttributeName.ID) { - idValue = value; - } - - if (name.isXmlns()) { - if (xmlnsNames.length == xmlnsLength) { - int newLen = xmlnsLength == 0 ? 2 : xmlnsLength << 1; - AttributeName[] newNames = new AttributeName[newLen]; - System.arraycopy(xmlnsNames, 0, newNames, 0, xmlnsNames.length); - xmlnsNames = newNames; - String[] newValues = new String[newLen]; - System.arraycopy(xmlnsValues, 0, newValues, 0, xmlnsValues.length); - xmlnsValues = newValues; - } - xmlnsNames[xmlnsLength] = name; - xmlnsValues[xmlnsLength] = value; - xmlnsLength++; - switch (xmlnsPolicy) { - case FATAL: - // this is ugly - throw new SAXException("Saw an xmlns attribute."); - case ALTER_INFOSET: - return; - case ALLOW: - // fall through - } - } - - // ]NOCPP] - - if (names.length == length) { - int newLen = length << 1; // The first growth covers virtually - // 100% of elements according to - // Hixie - AttributeName[] newNames = new AttributeName[newLen]; - System.arraycopy(names, 0, newNames, 0, names.length); - names = newNames; - String[] newValues = new String[newLen]; - System.arraycopy(values, 0, newValues, 0, values.length); - values = newValues; - // CPPONLY: int[] newLines = new int[newLen]; - // CPPONLY: System.arraycopy(lines, 0, newLines, 0, lines.length); - // CPPONLY: lines = newLines; - } - names[length] = name; - values[length] = value; - // CPPONLY: lines[length] = line; - length++; - } - - void clear(int m) { - for (int i = 0; i < length; i++) { - names[i].release(); - names[i] = null; - Portability.releaseString(values[i]); - values[i] = null; - } - length = 0; - mode = m; - // [NOCPP[ - idValue = null; - for (int i = 0; i < xmlnsLength; i++) { - xmlnsNames[i] = null; - xmlnsValues[i] = null; - } - xmlnsLength = 0; - // ]NOCPP] - } - - /** - * This is used in C++ to release special <code>isindex</code> - * attribute values whose ownership is not transferred. - */ - void releaseValue(int i) { - Portability.releaseString(values[i]); - } - - /** - * This is only used for <code>AttributeName</code> ownership transfer - * in the isindex case to avoid freeing custom names twice in C++. - */ - void clearWithoutReleasingContents() { - for (int i = 0; i < length; i++) { - names[i] = null; - values[i] = null; - } - length = 0; - } - - boolean contains(AttributeName name) { - for (int i = 0; i < length; i++) { - if (name.equalsAnother(names[i])) { - return true; - } - } - // [NOCPP[ - for (int i = 0; i < xmlnsLength; i++) { - if (name.equalsAnother(xmlnsNames[i])) { - return true; - } - } - // ]NOCPP] - return false; - } - - public void adjustForMath() { - mode = AttributeName.MATHML; - } - - public void adjustForSvg() { - mode = AttributeName.SVG; - } - - public HtmlAttributes cloneAttributes(Interner interner) - throws SAXException { - assert (length == 0 - // [NOCPP[ - && xmlnsLength == 0 - // ]NOCPP] - ) - || mode == 0 || mode == 3; - HtmlAttributes clone = new HtmlAttributes(0); - for (int i = 0; i < length; i++) { - clone.addAttribute(names[i].cloneAttributeName(interner), - Portability.newStringFromString(values[i]) - // [NOCPP[ - , XmlViolationPolicy.ALLOW - // ]NOCPP] - // CPPONLY: , lines[i] - ); - } - // [NOCPP[ - for (int i = 0; i < xmlnsLength; i++) { - clone.addAttribute(xmlnsNames[i], xmlnsValues[i], - XmlViolationPolicy.ALLOW); - } - // ]NOCPP] - return clone; // XXX!!! - } - - public boolean equalsAnother(HtmlAttributes other) { - assert mode == 0 || mode == 3 : "Trying to compare attributes in foreign content."; - int otherLength = other.getLength(); - if (length != otherLength) { - return false; - } - for (int i = 0; i < length; i++) { - // Work around the limitations of C++ - boolean found = false; - // The comparing just the local names is OK, since these attribute - // holders are both supposed to belong to HTML formatting elements - @Local String ownLocal = names[i].getLocal(AttributeName.HTML); - for (int j = 0; j < otherLength; j++) { - if (ownLocal == other.names[j].getLocal(AttributeName.HTML)) { - found = true; - if (!Portability.stringEqualsString(values[i], other.values[j])) { - return false; - } - } - } - if (!found) { - return false; - } - } - return true; - } - - // [NOCPP[ - - void processNonNcNames(TreeBuilder<?> treeBuilder, XmlViolationPolicy namePolicy) throws SAXException { - for (int i = 0; i < length; i++) { - AttributeName attName = names[i]; - if (!attName.isNcName(mode)) { - String name = attName.getLocal(mode); - switch (namePolicy) { - case ALTER_INFOSET: - names[i] = AttributeName.create(NCName.escapeName(name)); - // fall through - case ALLOW: - if (attName != AttributeName.XML_LANG) { - treeBuilder.warn("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); - } - break; - case FATAL: - treeBuilder.fatal("Attribute \u201C" + name + "\u201D is not serializable as XML 1.0."); - break; - } - } - } - } - - public void merge(HtmlAttributes attributes) throws SAXException { - int len = attributes.getLength(); - for (int i = 0; i < len; i++) { - AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); - if (!contains(name)) { - addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); - } - } - } - - - // ]NOCPP] - -} diff --git a/parser/html/javasrc/MetaScanner.java b/parser/html/javasrc/MetaScanner.java deleted file mode 100644 index be9aabfe3..000000000 --- a/parser/html/javasrc/MetaScanner.java +++ /dev/null @@ -1,854 +0,0 @@ -/* - * Copyright (c) 2007 Henri Sivonen - * Copyright (c) 2008-2015 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import java.io.IOException; - -import nu.validator.htmlparser.annotation.Auto; -import nu.validator.htmlparser.annotation.Inline; -import nu.validator.htmlparser.common.ByteReadable; - -import org.xml.sax.SAXException; - -public abstract class MetaScanner { - - /** - * Constant for "charset". - */ - private static final char[] CHARSET = { 'h', 'a', 'r', 's', 'e', 't' }; - - /** - * Constant for "content". - */ - private static final char[] CONTENT = { 'o', 'n', 't', 'e', 'n', 't' }; - - /** - * Constant for "http-equiv". - */ - private static final char[] HTTP_EQUIV = { 't', 't', 'p', '-', 'e', 'q', - 'u', 'i', 'v' }; - - /** - * Constant for "content-type". - */ - private static final char[] CONTENT_TYPE = { 'c', 'o', 'n', 't', 'e', 'n', - 't', '-', 't', 'y', 'p', 'e' }; - - private static final int NO = 0; - - private static final int M = 1; - - private static final int E = 2; - - private static final int T = 3; - - private static final int A = 4; - - private static final int DATA = 0; - - private static final int TAG_OPEN = 1; - - private static final int SCAN_UNTIL_GT = 2; - - private static final int TAG_NAME = 3; - - private static final int BEFORE_ATTRIBUTE_NAME = 4; - - private static final int ATTRIBUTE_NAME = 5; - - private static final int AFTER_ATTRIBUTE_NAME = 6; - - private static final int BEFORE_ATTRIBUTE_VALUE = 7; - - private static final int ATTRIBUTE_VALUE_DOUBLE_QUOTED = 8; - - private static final int ATTRIBUTE_VALUE_SINGLE_QUOTED = 9; - - private static final int ATTRIBUTE_VALUE_UNQUOTED = 10; - - private static final int AFTER_ATTRIBUTE_VALUE_QUOTED = 11; - - private static final int MARKUP_DECLARATION_OPEN = 13; - - private static final int MARKUP_DECLARATION_HYPHEN = 14; - - private static final int COMMENT_START = 15; - - private static final int COMMENT_START_DASH = 16; - - private static final int COMMENT = 17; - - private static final int COMMENT_END_DASH = 18; - - private static final int COMMENT_END = 19; - - private static final int SELF_CLOSING_START_TAG = 20; - - private static final int HTTP_EQUIV_NOT_SEEN = 0; - - private static final int HTTP_EQUIV_CONTENT_TYPE = 1; - - private static final int HTTP_EQUIV_OTHER = 2; - - /** - * The data source. - */ - protected ByteReadable readable; - - /** - * The state of the state machine that recognizes the tag name "meta". - */ - private int metaState = NO; - - /** - * The current position in recognizing the attribute name "content". - */ - private int contentIndex = Integer.MAX_VALUE; - - /** - * The current position in recognizing the attribute name "charset". - */ - private int charsetIndex = Integer.MAX_VALUE; - - /** - * The current position in recognizing the attribute name "http-equive". - */ - private int httpEquivIndex = Integer.MAX_VALUE; - - /** - * The current position in recognizing the attribute value "content-type". - */ - private int contentTypeIndex = Integer.MAX_VALUE; - - /** - * The tokenizer state. - */ - protected int stateSave = DATA; - - /** - * The currently filled length of strBuf. - */ - private int strBufLen; - - /** - * Accumulation buffer for attribute values. - */ - private @Auto char[] strBuf; - - private String content; - - private String charset; - - private int httpEquivState; - - // CPPONLY: private TreeBuilder treeBuilder; - - public MetaScanner( - // CPPONLY: TreeBuilder tb - ) { - this.readable = null; - this.metaState = NO; - this.contentIndex = Integer.MAX_VALUE; - this.charsetIndex = Integer.MAX_VALUE; - this.httpEquivIndex = Integer.MAX_VALUE; - this.contentTypeIndex = Integer.MAX_VALUE; - this.stateSave = DATA; - this.strBufLen = 0; - this.strBuf = new char[36]; - this.content = null; - this.charset = null; - this.httpEquivState = HTTP_EQUIV_NOT_SEEN; - // CPPONLY: this.treeBuilder = tb; - } - - @SuppressWarnings("unused") private void destructor() { - Portability.releaseString(content); - Portability.releaseString(charset); - } - - // [NOCPP[ - - /** - * Reads a byte from the data source. - * - * -1 means end. - * @return - * @throws IOException - */ - protected int read() throws IOException { - return readable.readByte(); - } - - // ]NOCPP] - - // WARNING When editing this, makes sure the bytecode length shown by javap - // stays under 8000 bytes! - /** - * The runs the meta scanning algorithm. - */ - protected final void stateLoop(int state) - throws SAXException, IOException { - int c = -1; - boolean reconsume = false; - stateloop: for (;;) { - switch (state) { - case DATA: - dataloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - c = read(); - } - switch (c) { - case -1: - break stateloop; - case '<': - state = MetaScanner.TAG_OPEN; - break dataloop; // FALL THROUGH continue - // stateloop; - default: - continue; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case TAG_OPEN: - tagopenloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case 'm': - case 'M': - metaState = M; - state = MetaScanner.TAG_NAME; - break tagopenloop; - // continue stateloop; - case '!': - state = MetaScanner.MARKUP_DECLARATION_OPEN; - continue stateloop; - case '?': - case '/': - state = MetaScanner.SCAN_UNTIL_GT; - continue stateloop; - case '>': - state = MetaScanner.DATA; - continue stateloop; - default: - if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) { - metaState = NO; - state = MetaScanner.TAG_NAME; - break tagopenloop; - // continue stateloop; - } - state = MetaScanner.DATA; - reconsume = true; - continue stateloop; - } - } - // FALL THROUGH DON'T REORDER - case TAG_NAME: - tagnameloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - case '\u000C': - state = MetaScanner.BEFORE_ATTRIBUTE_NAME; - break tagnameloop; - // continue stateloop; - case '/': - state = MetaScanner.SELF_CLOSING_START_TAG; - continue stateloop; - case '>': - state = MetaScanner.DATA; - continue stateloop; - case 'e': - case 'E': - if (metaState == M) { - metaState = E; - } else { - metaState = NO; - } - continue; - case 't': - case 'T': - if (metaState == E) { - metaState = T; - } else { - metaState = NO; - } - continue; - case 'a': - case 'A': - if (metaState == T) { - metaState = A; - } else { - metaState = NO; - } - continue; - default: - metaState = NO; - continue; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_ATTRIBUTE_NAME: - beforeattributenameloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - c = read(); - } - /* - * Consume the next input character: - */ - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - case '\u000C': - continue; - case '/': - state = MetaScanner.SELF_CLOSING_START_TAG; - continue stateloop; - case '>': - if (handleTag()) { - break stateloop; - } - state = DATA; - continue stateloop; - case 'c': - case 'C': - contentIndex = 0; - charsetIndex = 0; - httpEquivIndex = Integer.MAX_VALUE; - contentTypeIndex = Integer.MAX_VALUE; - state = MetaScanner.ATTRIBUTE_NAME; - break beforeattributenameloop; - case 'h': - case 'H': - contentIndex = Integer.MAX_VALUE; - charsetIndex = Integer.MAX_VALUE; - httpEquivIndex = 0; - contentTypeIndex = Integer.MAX_VALUE; - state = MetaScanner.ATTRIBUTE_NAME; - break beforeattributenameloop; - default: - contentIndex = Integer.MAX_VALUE; - charsetIndex = Integer.MAX_VALUE; - httpEquivIndex = Integer.MAX_VALUE; - contentTypeIndex = Integer.MAX_VALUE; - state = MetaScanner.ATTRIBUTE_NAME; - break beforeattributenameloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case ATTRIBUTE_NAME: - attributenameloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - case '\u000C': - state = MetaScanner.AFTER_ATTRIBUTE_NAME; - continue stateloop; - case '/': - state = MetaScanner.SELF_CLOSING_START_TAG; - continue stateloop; - case '=': - strBufLen = 0; - contentTypeIndex = 0; - state = MetaScanner.BEFORE_ATTRIBUTE_VALUE; - break attributenameloop; - // continue stateloop; - case '>': - if (handleTag()) { - break stateloop; - } - state = MetaScanner.DATA; - continue stateloop; - default: - if (metaState == A) { - if (c >= 'A' && c <= 'Z') { - c += 0x20; - } - if (contentIndex < CONTENT.length && c == CONTENT[contentIndex]) { - ++contentIndex; - } else { - contentIndex = Integer.MAX_VALUE; - } - if (charsetIndex < CHARSET.length && c == CHARSET[charsetIndex]) { - ++charsetIndex; - } else { - charsetIndex = Integer.MAX_VALUE; - } - if (httpEquivIndex < HTTP_EQUIV.length && c == HTTP_EQUIV[httpEquivIndex]) { - ++httpEquivIndex; - } else { - httpEquivIndex = Integer.MAX_VALUE; - } - } - continue; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_ATTRIBUTE_VALUE: - beforeattributevalueloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - case '\u000C': - continue; - case '"': - state = MetaScanner.ATTRIBUTE_VALUE_DOUBLE_QUOTED; - break beforeattributevalueloop; - // continue stateloop; - case '\'': - state = MetaScanner.ATTRIBUTE_VALUE_SINGLE_QUOTED; - continue stateloop; - case '>': - if (handleTag()) { - break stateloop; - } - state = MetaScanner.DATA; - continue stateloop; - default: - handleCharInAttributeValue(c); - state = MetaScanner.ATTRIBUTE_VALUE_UNQUOTED; - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case ATTRIBUTE_VALUE_DOUBLE_QUOTED: - attributevaluedoublequotedloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - c = read(); - } - switch (c) { - case -1: - break stateloop; - case '"': - handleAttributeValue(); - state = MetaScanner.AFTER_ATTRIBUTE_VALUE_QUOTED; - break attributevaluedoublequotedloop; - // continue stateloop; - default: - handleCharInAttributeValue(c); - continue; - } - } - // FALLTHRU DON'T REORDER - case AFTER_ATTRIBUTE_VALUE_QUOTED: - afterattributevaluequotedloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - case '\u000C': - state = MetaScanner.BEFORE_ATTRIBUTE_NAME; - continue stateloop; - case '/': - state = MetaScanner.SELF_CLOSING_START_TAG; - break afterattributevaluequotedloop; - // continue stateloop; - case '>': - if (handleTag()) { - break stateloop; - } - state = MetaScanner.DATA; - continue stateloop; - default: - state = MetaScanner.BEFORE_ATTRIBUTE_NAME; - reconsume = true; - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case SELF_CLOSING_START_TAG: - c = read(); - switch (c) { - case -1: - break stateloop; - case '>': - if (handleTag()) { - break stateloop; - } - state = MetaScanner.DATA; - continue stateloop; - default: - state = MetaScanner.BEFORE_ATTRIBUTE_NAME; - reconsume = true; - continue stateloop; - } - // XXX reorder point - case ATTRIBUTE_VALUE_UNQUOTED: - for (;;) { - if (reconsume) { - reconsume = false; - } else { - c = read(); - } - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - - case '\u000C': - handleAttributeValue(); - state = MetaScanner.BEFORE_ATTRIBUTE_NAME; - continue stateloop; - case '>': - handleAttributeValue(); - if (handleTag()) { - break stateloop; - } - state = MetaScanner.DATA; - continue stateloop; - default: - handleCharInAttributeValue(c); - continue; - } - } - // XXX reorder point - case AFTER_ATTRIBUTE_NAME: - for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case ' ': - case '\t': - case '\n': - case '\u000C': - continue; - case '/': - handleAttributeValue(); - state = MetaScanner.SELF_CLOSING_START_TAG; - continue stateloop; - case '=': - strBufLen = 0; - contentTypeIndex = 0; - state = MetaScanner.BEFORE_ATTRIBUTE_VALUE; - continue stateloop; - case '>': - handleAttributeValue(); - if (handleTag()) { - break stateloop; - } - state = MetaScanner.DATA; - continue stateloop; - case 'c': - case 'C': - contentIndex = 0; - charsetIndex = 0; - state = MetaScanner.ATTRIBUTE_NAME; - continue stateloop; - default: - contentIndex = Integer.MAX_VALUE; - charsetIndex = Integer.MAX_VALUE; - state = MetaScanner.ATTRIBUTE_NAME; - continue stateloop; - } - } - // XXX reorder point - case MARKUP_DECLARATION_OPEN: - markupdeclarationopenloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case '-': - state = MetaScanner.MARKUP_DECLARATION_HYPHEN; - break markupdeclarationopenloop; - // continue stateloop; - default: - state = MetaScanner.SCAN_UNTIL_GT; - reconsume = true; - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case MARKUP_DECLARATION_HYPHEN: - markupdeclarationhyphenloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case '-': - state = MetaScanner.COMMENT_START; - break markupdeclarationhyphenloop; - // continue stateloop; - default: - state = MetaScanner.SCAN_UNTIL_GT; - reconsume = true; - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case COMMENT_START: - commentstartloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case '-': - state = MetaScanner.COMMENT_START_DASH; - continue stateloop; - case '>': - state = MetaScanner.DATA; - continue stateloop; - default: - state = MetaScanner.COMMENT; - break commentstartloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case COMMENT: - commentloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case '-': - state = MetaScanner.COMMENT_END_DASH; - break commentloop; - // continue stateloop; - default: - continue; - } - } - // FALLTHRU DON'T REORDER - case COMMENT_END_DASH: - commentenddashloop: for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case '-': - state = MetaScanner.COMMENT_END; - break commentenddashloop; - // continue stateloop; - default: - state = MetaScanner.COMMENT; - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case COMMENT_END: - for (;;) { - c = read(); - switch (c) { - case -1: - break stateloop; - case '>': - state = MetaScanner.DATA; - continue stateloop; - case '-': - continue; - default: - state = MetaScanner.COMMENT; - continue stateloop; - } - } - // XXX reorder point - case COMMENT_START_DASH: - c = read(); - switch (c) { - case -1: - break stateloop; - case '-': - state = MetaScanner.COMMENT_END; - continue stateloop; - case '>': - state = MetaScanner.DATA; - continue stateloop; - default: - state = MetaScanner.COMMENT; - continue stateloop; - } - // XXX reorder point - case ATTRIBUTE_VALUE_SINGLE_QUOTED: - for (;;) { - if (reconsume) { - reconsume = false; - } else { - c = read(); - } - switch (c) { - case -1: - break stateloop; - case '\'': - handleAttributeValue(); - state = MetaScanner.AFTER_ATTRIBUTE_VALUE_QUOTED; - continue stateloop; - default: - handleCharInAttributeValue(c); - continue; - } - } - // XXX reorder point - case SCAN_UNTIL_GT: - for (;;) { - if (reconsume) { - reconsume = false; - } else { - c = read(); - } - switch (c) { - case -1: - break stateloop; - case '>': - state = MetaScanner.DATA; - continue stateloop; - default: - continue; - } - } - } - } - stateSave = state; - } - - private void handleCharInAttributeValue(int c) { - if (metaState == A) { - if (contentIndex == CONTENT.length || charsetIndex == CHARSET.length) { - addToBuffer(c); - } else if (httpEquivIndex == HTTP_EQUIV.length) { - if (contentTypeIndex < CONTENT_TYPE.length && toAsciiLowerCase(c) == CONTENT_TYPE[contentTypeIndex]) { - ++contentTypeIndex; - } else { - contentTypeIndex = Integer.MAX_VALUE; - } - } - } - } - - @Inline private int toAsciiLowerCase(int c) { - if (c >= 'A' && c <= 'Z') { - return c + 0x20; - } - return c; - } - - /** - * Adds a character to the accumulation buffer. - * @param c the character to add - */ - private void addToBuffer(int c) { - if (strBufLen == strBuf.length) { - char[] newBuf = new char[strBuf.length + (strBuf.length << 1)]; - System.arraycopy(strBuf, 0, newBuf, 0, strBuf.length); - strBuf = newBuf; - } - strBuf[strBufLen++] = (char)c; - } - - /** - * Attempts to extract a charset name from the accumulation buffer. - * @return <code>true</code> if successful - * @throws SAXException - */ - private void handleAttributeValue() throws SAXException { - if (metaState != A) { - return; - } - if (contentIndex == CONTENT.length && content == null) { - content = Portability.newStringFromBuffer(strBuf, 0, strBufLen - // CPPONLY: , treeBuilder - ); - return; - } - if (charsetIndex == CHARSET.length && charset == null) { - charset = Portability.newStringFromBuffer(strBuf, 0, strBufLen - // CPPONLY: , treeBuilder - ); - return; - } - if (httpEquivIndex == HTTP_EQUIV.length - && httpEquivState == HTTP_EQUIV_NOT_SEEN) { - httpEquivState = (contentTypeIndex == CONTENT_TYPE.length) ? HTTP_EQUIV_CONTENT_TYPE - : HTTP_EQUIV_OTHER; - return; - } - } - - private boolean handleTag() throws SAXException { - boolean stop = handleTagInner(); - Portability.releaseString(content); - content = null; - Portability.releaseString(charset); - charset = null; - httpEquivState = HTTP_EQUIV_NOT_SEEN; - return stop; - } - - private boolean handleTagInner() throws SAXException { - if (charset != null && tryCharset(charset)) { - return true; - } - if (content != null && httpEquivState == HTTP_EQUIV_CONTENT_TYPE) { - String extract = TreeBuilder.extractCharsetFromContent(content - // CPPONLY: , treeBuilder - ); - if (extract == null) { - return false; - } - boolean success = tryCharset(extract); - Portability.releaseString(extract); - return success; - } - return false; - } - - /** - * Tries to switch to an encoding. - * - * @param encoding - * @return <code>true</code> if successful - * @throws SAXException - */ - protected abstract boolean tryCharset(String encoding) throws SAXException; - -} diff --git a/parser/html/javasrc/Portability.java b/parser/html/javasrc/Portability.java deleted file mode 100644 index 485684ea1..000000000 --- a/parser/html/javasrc/Portability.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2008-2015 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import nu.validator.htmlparser.annotation.Literal; -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NoLength; -import nu.validator.htmlparser.common.Interner; - -public final class Portability { - - // Allocating methods - - /** - * Allocates a new local name object. In C++, the refcount must be set up in such a way that - * calling <code>releaseLocal</code> on the return value balances the refcount set by this method. - */ - public static @Local String newLocalNameFromBuffer(@NoLength char[] buf, int offset, int length, Interner interner) { - return new String(buf, offset, length).intern(); - } - - public static String newStringFromBuffer(@NoLength char[] buf, int offset, int length - // CPPONLY: , TreeBuilder treeBuilder - ) { - return new String(buf, offset, length); - } - - public static String newEmptyString() { - return ""; - } - - public static String newStringFromLiteral(@Literal String literal) { - return literal; - } - - public static String newStringFromString(String string) { - return string; - } - - // XXX get rid of this - public static char[] newCharArrayFromLocal(@Local String local) { - return local.toCharArray(); - } - - public static char[] newCharArrayFromString(String string) { - return string.toCharArray(); - } - - public static @Local String newLocalFromLocal(@Local String local, Interner interner) { - return local; - } - - // Deallocation methods - - public static void releaseString(String str) { - // No-op in Java - } - - // Comparison methods - - public static boolean localEqualsBuffer(@Local String local, @NoLength char[] buf, int offset, int length) { - if (local.length() != length) { - return false; - } - for (int i = 0; i < length; i++) { - if (local.charAt(i) != buf[offset + i]) { - return false; - } - } - return true; - } - - public static boolean lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(@Literal String lowerCaseLiteral, - String string) { - if (string == null) { - return false; - } - if (lowerCaseLiteral.length() > string.length()) { - return false; - } - for (int i = 0; i < lowerCaseLiteral.length(); i++) { - char c0 = lowerCaseLiteral.charAt(i); - char c1 = string.charAt(i); - if (c1 >= 'A' && c1 <= 'Z') { - c1 += 0x20; - } - if (c0 != c1) { - return false; - } - } - return true; - } - - public static boolean lowerCaseLiteralEqualsIgnoreAsciiCaseString(@Literal String lowerCaseLiteral, - String string) { - if (string == null) { - return false; - } - if (lowerCaseLiteral.length() != string.length()) { - return false; - } - for (int i = 0; i < lowerCaseLiteral.length(); i++) { - char c0 = lowerCaseLiteral.charAt(i); - char c1 = string.charAt(i); - if (c1 >= 'A' && c1 <= 'Z') { - c1 += 0x20; - } - if (c0 != c1) { - return false; - } - } - return true; - } - - public static boolean literalEqualsString(@Literal String literal, String string) { - return literal.equals(string); - } - - public static boolean stringEqualsString(String one, String other) { - return one.equals(other); - } - - public static void delete(Object o) { - - } - - public static void deleteArray(Object o) { - - } -} diff --git a/parser/html/javasrc/README.txt b/parser/html/javasrc/README.txt deleted file mode 100644 index 4555969ca..000000000 --- a/parser/html/javasrc/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -The .java files in this directory were placed here by the Java-to-C++ -translator that lives in parser/html/java/translator. Together they represent -a snapshot of the Java code that was translated to produce the corresponding -.h and .cpp files in the parent directory. Changing these .java files is not -worthwhile, as they will just be overwritten by the next translation. See -parser/html/java/README.txt for information about performing the translation. diff --git a/parser/html/javasrc/StackNode.java b/parser/html/javasrc/StackNode.java deleted file mode 100644 index 9aeaba0be..000000000 --- a/parser/html/javasrc/StackNode.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2007 Henri Sivonen - * Copyright (c) 2007-2011 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import nu.validator.htmlparser.annotation.Inline; -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NsUri; - -final class StackNode<T> { - final int flags; - - final @Local String name; - - final @Local String popName; - - final @NsUri String ns; - - final T node; - - // Only used on the list of formatting elements - HtmlAttributes attributes; - - private int refcount = 1; - - // [NOCPP[ - - private final TaintableLocatorImpl locator; - - public TaintableLocatorImpl getLocator() { - return locator; - } - - // ]NOCPP] - - @Inline public int getFlags() { - return flags; - } - - public int getGroup() { - return flags & ElementName.GROUP_MASK; - } - - public boolean isScoping() { - return (flags & ElementName.SCOPING) != 0; - } - - public boolean isSpecial() { - return (flags & ElementName.SPECIAL) != 0; - } - - public boolean isFosterParenting() { - return (flags & ElementName.FOSTER_PARENTING) != 0; - } - - public boolean isHtmlIntegrationPoint() { - return (flags & ElementName.HTML_INTEGRATION_POINT) != 0; - } - - // [NOCPP[ - - public boolean isOptionalEndTag() { - return (flags & ElementName.OPTIONAL_END_TAG) != 0; - } - - // ]NOCPP] - - /** - * Constructor for copying. This doesn't take another <code>StackNode</code> - * because in C++ the caller is reponsible for reobtaining the local names - * from another interner. - * - * @param flags - * @param ns - * @param name - * @param node - * @param popName - * @param attributes - */ - StackNode(int flags, @NsUri String ns, @Local String name, T node, - @Local String popName, HtmlAttributes attributes - // [NOCPP[ - , TaintableLocatorImpl locator - // ]NOCPP] - ) { - this.flags = flags; - this.name = name; - this.popName = popName; - this.ns = ns; - this.node = node; - this.attributes = attributes; - this.refcount = 1; - // [NOCPP[ - this.locator = locator; - // ]NOCPP] - } - - /** - * Short hand for well-known HTML elements. - * - * @param elementName - * @param node - */ - StackNode(ElementName elementName, T node - // [NOCPP[ - , TaintableLocatorImpl locator - // ]NOCPP] - ) { - this.flags = elementName.getFlags(); - this.name = elementName.name; - this.popName = elementName.name; - this.ns = "http://www.w3.org/1999/xhtml"; - this.node = node; - this.attributes = null; - this.refcount = 1; - assert !elementName.isCustom() : "Don't use this constructor for custom elements."; - // [NOCPP[ - this.locator = locator; - // ]NOCPP] - } - - /** - * Constructor for HTML formatting elements. - * - * @param elementName - * @param node - * @param attributes - */ - StackNode(ElementName elementName, T node, HtmlAttributes attributes - // [NOCPP[ - , TaintableLocatorImpl locator - // ]NOCPP] - ) { - this.flags = elementName.getFlags(); - this.name = elementName.name; - this.popName = elementName.name; - this.ns = "http://www.w3.org/1999/xhtml"; - this.node = node; - this.attributes = attributes; - this.refcount = 1; - assert !elementName.isCustom() : "Don't use this constructor for custom elements."; - // [NOCPP[ - this.locator = locator; - // ]NOCPP] - } - - /** - * The common-case HTML constructor. - * - * @param elementName - * @param node - * @param popName - */ - StackNode(ElementName elementName, T node, @Local String popName - // [NOCPP[ - , TaintableLocatorImpl locator - // ]NOCPP] - ) { - this.flags = elementName.getFlags(); - this.name = elementName.name; - this.popName = popName; - this.ns = "http://www.w3.org/1999/xhtml"; - this.node = node; - this.attributes = null; - this.refcount = 1; - // [NOCPP[ - this.locator = locator; - // ]NOCPP] - } - - /** - * Constructor for SVG elements. Note that the order of the arguments is - * what distinguishes this from the HTML constructor. This is ugly, but - * AFAICT the least disruptive way to make this work with Java's generics - * and without unnecessary branches. :-( - * - * @param elementName - * @param popName - * @param node - */ - StackNode(ElementName elementName, @Local String popName, T node - // [NOCPP[ - , TaintableLocatorImpl locator - // ]NOCPP] - ) { - this.flags = prepareSvgFlags(elementName.getFlags()); - this.name = elementName.name; - this.popName = popName; - this.ns = "http://www.w3.org/2000/svg"; - this.node = node; - this.attributes = null; - this.refcount = 1; - // [NOCPP[ - this.locator = locator; - // ]NOCPP] - } - - /** - * Constructor for MathML. - * - * @param elementName - * @param node - * @param popName - * @param markAsIntegrationPoint - */ - StackNode(ElementName elementName, T node, @Local String popName, - boolean markAsIntegrationPoint - // [NOCPP[ - , TaintableLocatorImpl locator - // ]NOCPP] - ) { - this.flags = prepareMathFlags(elementName.getFlags(), - markAsIntegrationPoint); - this.name = elementName.name; - this.popName = popName; - this.ns = "http://www.w3.org/1998/Math/MathML"; - this.node = node; - this.attributes = null; - this.refcount = 1; - // [NOCPP[ - this.locator = locator; - // ]NOCPP] - } - - private static int prepareSvgFlags(int flags) { - flags &= ~(ElementName.FOSTER_PARENTING | ElementName.SCOPING - | ElementName.SPECIAL | ElementName.OPTIONAL_END_TAG); - if ((flags & ElementName.SCOPING_AS_SVG) != 0) { - flags |= (ElementName.SCOPING | ElementName.SPECIAL | ElementName.HTML_INTEGRATION_POINT); - } - return flags; - } - - private static int prepareMathFlags(int flags, - boolean markAsIntegrationPoint) { - flags &= ~(ElementName.FOSTER_PARENTING | ElementName.SCOPING - | ElementName.SPECIAL | ElementName.OPTIONAL_END_TAG); - if ((flags & ElementName.SCOPING_AS_MATHML) != 0) { - flags |= (ElementName.SCOPING | ElementName.SPECIAL); - } - if (markAsIntegrationPoint) { - flags |= ElementName.HTML_INTEGRATION_POINT; - } - return flags; - } - - @SuppressWarnings("unused") private void destructor() { - Portability.delete(attributes); - } - - public void dropAttributes() { - attributes = null; - } - - // [NOCPP[ - /** - * @see java.lang.Object#toString() - */ - @Override public @Local String toString() { - return name; - } - - // ]NOCPP] - - public void retain() { - refcount++; - } - - public void release() { - refcount--; - if (refcount == 0) { - Portability.delete(this); - } - } -} diff --git a/parser/html/javasrc/StateSnapshot.java b/parser/html/javasrc/StateSnapshot.java deleted file mode 100644 index ff89e0443..000000000 --- a/parser/html/javasrc/StateSnapshot.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2009-2010 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import nu.validator.htmlparser.annotation.Auto; - - -public class StateSnapshot<T> implements TreeBuilderState<T> { - - private final @Auto StackNode<T>[] stack; - - private final @Auto StackNode<T>[] listOfActiveFormattingElements; - - private final @Auto int[] templateModeStack; - - private final T formPointer; - - private final T headPointer; - - private final T deepTreeSurrogateParent; - - private final int mode; - - private final int originalMode; - - private final boolean framesetOk; - - private final boolean needToDropLF; - - private final boolean quirks; - - /** - * @param stack - * @param listOfActiveFormattingElements - * @param templateModeStack - * @param formPointer - * @param headPointer - * @param deepTreeSurrogateParent - * @param mode - * @param originalMode - * @param framesetOk - * @param needToDropLF - * @param quirks - */ - StateSnapshot(StackNode<T>[] stack, - StackNode<T>[] listOfActiveFormattingElements, int[] templateModeStack, T formPointer, - T headPointer, T deepTreeSurrogateParent, int mode, int originalMode, - boolean framesetOk, boolean needToDropLF, boolean quirks) { - this.stack = stack; - this.listOfActiveFormattingElements = listOfActiveFormattingElements; - this.templateModeStack = templateModeStack; - this.formPointer = formPointer; - this.headPointer = headPointer; - this.deepTreeSurrogateParent = deepTreeSurrogateParent; - this.mode = mode; - this.originalMode = originalMode; - this.framesetOk = framesetOk; - this.needToDropLF = needToDropLF; - this.quirks = quirks; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getStack() - */ - public StackNode<T>[] getStack() { - return stack; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getTemplateModeStack() - */ - public int[] getTemplateModeStack() { - return templateModeStack; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getListOfActiveFormattingElements() - */ - public StackNode<T>[] getListOfActiveFormattingElements() { - return listOfActiveFormattingElements; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getFormPointer() - */ - public T getFormPointer() { - return formPointer; - } - - /** - * Returns the headPointer. - * - * @return the headPointer - */ - public T getHeadPointer() { - return headPointer; - } - - /** - * Returns the deepTreeSurrogateParent. - * - * @return the deepTreeSurrogateParent - */ - public T getDeepTreeSurrogateParent() { - return deepTreeSurrogateParent; - } - - /** - * Returns the mode. - * - * @return the mode - */ - public int getMode() { - return mode; - } - - /** - * Returns the originalMode. - * - * @return the originalMode - */ - public int getOriginalMode() { - return originalMode; - } - - /** - * Returns the framesetOk. - * - * @return the framesetOk - */ - public boolean isFramesetOk() { - return framesetOk; - } - - /** - * Returns the needToDropLF. - * - * @return the needToDropLF - */ - public boolean isNeedToDropLF() { - return needToDropLF; - } - - /** - * Returns the quirks. - * - * @return the quirks - */ - public boolean isQuirks() { - return quirks; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getListOfActiveFormattingElementsLength() - */ - public int getListOfActiveFormattingElementsLength() { - return listOfActiveFormattingElements.length; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getStackLength() - */ - public int getStackLength() { - return stack.length; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getTemplateModeStackLength() - */ - public int getTemplateModeStackLength() { - return templateModeStack.length; - } - - @SuppressWarnings("unused") private void destructor() { - for (int i = 0; i < stack.length; i++) { - stack[i].release(); - } - for (int i = 0; i < listOfActiveFormattingElements.length; i++) { - if (listOfActiveFormattingElements[i] != null) { - listOfActiveFormattingElements[i].release(); - } - } - } -} diff --git a/parser/html/javasrc/Tokenizer.java b/parser/html/javasrc/Tokenizer.java deleted file mode 100644 index 70e1df75c..000000000 --- a/parser/html/javasrc/Tokenizer.java +++ /dev/null @@ -1,7064 +0,0 @@ -/* - * Copyright (c) 2005-2007 Henri Sivonen - * Copyright (c) 2007-2015 Mozilla Foundation - * Portions of comments Copyright 2004-2010 Apple Computer, Inc., Mozilla - * Foundation, and Opera Software ASA. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * The comments following this one that use the same comment syntax as this - * comment are quotes from the WHATWG HTML 5 spec as of 2 June 2007 - * amended as of June 18 2008 and May 31 2010. - * That document came with this statement: - * "© Copyright 2004-2010 Apple Computer, Inc., Mozilla Foundation, and - * Opera Software ASA. You are granted a license to use, reproduce and - * create derivative works of this document." - */ - -package nu.validator.htmlparser.impl; - -import org.xml.sax.ErrorHandler; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -import nu.validator.htmlparser.annotation.Auto; -import nu.validator.htmlparser.annotation.CharacterName; -import nu.validator.htmlparser.annotation.Const; -import nu.validator.htmlparser.annotation.Inline; -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NoLength; -import nu.validator.htmlparser.common.EncodingDeclarationHandler; -import nu.validator.htmlparser.common.Interner; -import nu.validator.htmlparser.common.TokenHandler; -import nu.validator.htmlparser.common.XmlViolationPolicy; - -/** - * An implementation of - * https://html.spec.whatwg.org/multipage/syntax.html#tokenization - * - * This class implements the <code>Locator</code> interface. This is not an - * incidental implementation detail: Users of this class are encouraged to make - * use of the <code>Locator</code> nature. - * - * By default, the tokenizer may report data that XML 1.0 bans. The tokenizer - * can be configured to treat these conditions as fatal or to coerce the infoset - * to something that XML 1.0 allows. - * - * @version $Id$ - * @author hsivonen - */ -public class Tokenizer implements Locator { - - private static final int DATA_AND_RCDATA_MASK = ~1; - - public static final int DATA = 0; - - public static final int RCDATA = 1; - - public static final int SCRIPT_DATA = 2; - - public static final int RAWTEXT = 3; - - public static final int SCRIPT_DATA_ESCAPED = 4; - - public static final int ATTRIBUTE_VALUE_DOUBLE_QUOTED = 5; - - public static final int ATTRIBUTE_VALUE_SINGLE_QUOTED = 6; - - public static final int ATTRIBUTE_VALUE_UNQUOTED = 7; - - public static final int PLAINTEXT = 8; - - public static final int TAG_OPEN = 9; - - public static final int CLOSE_TAG_OPEN = 10; - - public static final int TAG_NAME = 11; - - public static final int BEFORE_ATTRIBUTE_NAME = 12; - - public static final int ATTRIBUTE_NAME = 13; - - public static final int AFTER_ATTRIBUTE_NAME = 14; - - public static final int BEFORE_ATTRIBUTE_VALUE = 15; - - public static final int AFTER_ATTRIBUTE_VALUE_QUOTED = 16; - - public static final int BOGUS_COMMENT = 17; - - public static final int MARKUP_DECLARATION_OPEN = 18; - - public static final int DOCTYPE = 19; - - public static final int BEFORE_DOCTYPE_NAME = 20; - - public static final int DOCTYPE_NAME = 21; - - public static final int AFTER_DOCTYPE_NAME = 22; - - public static final int BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 23; - - public static final int DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 24; - - public static final int DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 25; - - public static final int AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 26; - - public static final int BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 27; - - public static final int DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 28; - - public static final int DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 29; - - public static final int AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 30; - - public static final int BOGUS_DOCTYPE = 31; - - public static final int COMMENT_START = 32; - - public static final int COMMENT_START_DASH = 33; - - public static final int COMMENT = 34; - - public static final int COMMENT_END_DASH = 35; - - public static final int COMMENT_END = 36; - - public static final int COMMENT_END_BANG = 37; - - public static final int NON_DATA_END_TAG_NAME = 38; - - public static final int MARKUP_DECLARATION_HYPHEN = 39; - - public static final int MARKUP_DECLARATION_OCTYPE = 40; - - public static final int DOCTYPE_UBLIC = 41; - - public static final int DOCTYPE_YSTEM = 42; - - public static final int AFTER_DOCTYPE_PUBLIC_KEYWORD = 43; - - public static final int BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 44; - - public static final int AFTER_DOCTYPE_SYSTEM_KEYWORD = 45; - - public static final int CONSUME_CHARACTER_REFERENCE = 46; - - public static final int CONSUME_NCR = 47; - - public static final int CHARACTER_REFERENCE_TAIL = 48; - - public static final int HEX_NCR_LOOP = 49; - - public static final int DECIMAL_NRC_LOOP = 50; - - public static final int HANDLE_NCR_VALUE = 51; - - public static final int HANDLE_NCR_VALUE_RECONSUME = 52; - - public static final int CHARACTER_REFERENCE_HILO_LOOKUP = 53; - - public static final int SELF_CLOSING_START_TAG = 54; - - public static final int CDATA_START = 55; - - public static final int CDATA_SECTION = 56; - - public static final int CDATA_RSQB = 57; - - public static final int CDATA_RSQB_RSQB = 58; - - public static final int SCRIPT_DATA_LESS_THAN_SIGN = 59; - - public static final int SCRIPT_DATA_ESCAPE_START = 60; - - public static final int SCRIPT_DATA_ESCAPE_START_DASH = 61; - - public static final int SCRIPT_DATA_ESCAPED_DASH = 62; - - public static final int SCRIPT_DATA_ESCAPED_DASH_DASH = 63; - - public static final int BOGUS_COMMENT_HYPHEN = 64; - - public static final int RAWTEXT_RCDATA_LESS_THAN_SIGN = 65; - - public static final int SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 66; - - public static final int SCRIPT_DATA_DOUBLE_ESCAPE_START = 67; - - public static final int SCRIPT_DATA_DOUBLE_ESCAPED = 68; - - public static final int SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 69; - - public static final int SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 70; - - public static final int SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 71; - - public static final int SCRIPT_DATA_DOUBLE_ESCAPE_END = 72; - - public static final int PROCESSING_INSTRUCTION = 73; - - public static final int PROCESSING_INSTRUCTION_QUESTION_MARK = 74; - - /** - * Magic value for UTF-16 operations. - */ - private static final int LEAD_OFFSET = (0xD800 - (0x10000 >> 10)); - - /** - * UTF-16 code unit array containing less than and greater than for emitting - * those characters on certain parse errors. - */ - private static final @NoLength char[] LT_GT = { '<', '>' }; - - /** - * UTF-16 code unit array containing less than and solidus for emitting - * those characters on certain parse errors. - */ - private static final @NoLength char[] LT_SOLIDUS = { '<', '/' }; - - /** - * UTF-16 code unit array containing ]] for emitting those characters on - * state transitions. - */ - private static final @NoLength char[] RSQB_RSQB = { ']', ']' }; - - /** - * Array version of U+FFFD. - */ - private static final @NoLength char[] REPLACEMENT_CHARACTER = { '\uFFFD' }; - - // [NOCPP[ - - /** - * Array version of space. - */ - private static final @NoLength char[] SPACE = { ' ' }; - - // ]NOCPP] - - /** - * Array version of line feed. - */ - private static final @NoLength char[] LF = { '\n' }; - - /** - * "CDATA[" as <code>char[]</code> - */ - private static final @NoLength char[] CDATA_LSQB = { 'C', 'D', 'A', 'T', - 'A', '[' }; - - /** - * "octype" as <code>char[]</code> - */ - private static final @NoLength char[] OCTYPE = { 'o', 'c', 't', 'y', 'p', - 'e' }; - - /** - * "ublic" as <code>char[]</code> - */ - private static final @NoLength char[] UBLIC = { 'u', 'b', 'l', 'i', 'c' }; - - /** - * "ystem" as <code>char[]</code> - */ - private static final @NoLength char[] YSTEM = { 'y', 's', 't', 'e', 'm' }; - - private static final char[] TITLE_ARR = { 't', 'i', 't', 'l', 'e' }; - - private static final char[] SCRIPT_ARR = { 's', 'c', 'r', 'i', 'p', 't' }; - - private static final char[] STYLE_ARR = { 's', 't', 'y', 'l', 'e' }; - - private static final char[] PLAINTEXT_ARR = { 'p', 'l', 'a', 'i', 'n', 't', - 'e', 'x', 't' }; - - private static final char[] XMP_ARR = { 'x', 'm', 'p' }; - - private static final char[] TEXTAREA_ARR = { 't', 'e', 'x', 't', 'a', 'r', - 'e', 'a' }; - - private static final char[] IFRAME_ARR = { 'i', 'f', 'r', 'a', 'm', 'e' }; - - private static final char[] NOEMBED_ARR = { 'n', 'o', 'e', 'm', 'b', 'e', - 'd' }; - - private static final char[] NOSCRIPT_ARR = { 'n', 'o', 's', 'c', 'r', 'i', - 'p', 't' }; - - private static final char[] NOFRAMES_ARR = { 'n', 'o', 'f', 'r', 'a', 'm', - 'e', 's' }; - - /** - * The token handler. - */ - protected final TokenHandler tokenHandler; - - protected EncodingDeclarationHandler encodingDeclarationHandler; - - // [NOCPP[ - - /** - * The error handler. - */ - protected ErrorHandler errorHandler; - - // ]NOCPP] - - /** - * Whether the previous char read was CR. - */ - protected boolean lastCR; - - protected int stateSave; - - private int returnStateSave; - - protected int index; - - private boolean forceQuirks; - - private char additional; - - private int entCol; - - private int firstCharKey; - - private int lo; - - private int hi; - - private int candidate; - - private int charRefBufMark; - - protected int value; - - private boolean seenDigits; - - protected int cstart; - - /** - * The SAX public id for the resource being tokenized. (Only passed to back - * as part of locator data.) - */ - private String publicId; - - /** - * The SAX system id for the resource being tokenized. (Only passed to back - * as part of locator data.) - */ - private String systemId; - - /** - * Buffer for bufferable things other than those that fit the description - * of <code>charRefBuf</code>. - */ - private @Auto char[] strBuf; - - /** - * Number of significant <code>char</code>s in <code>strBuf</code>. - */ - private int strBufLen; - - /** - * Buffer for characters that might form a character reference but may - * end up not forming one. - */ - private final @Auto char[] charRefBuf; - - /** - * Number of significant <code>char</code>s in <code>charRefBuf</code>. - */ - private int charRefBufLen; - - /** - * Buffer for expanding NCRs falling into the Basic Multilingual Plane. - */ - private final @Auto char[] bmpChar; - - /** - * Buffer for expanding astral NCRs. - */ - private final @Auto char[] astralChar; - - /** - * The element whose end tag closes the current CDATA or RCDATA element. - */ - protected ElementName endTagExpectation = null; - - private char[] endTagExpectationAsArray; // not @Auto! - - /** - * <code>true</code> if tokenizing an end tag - */ - protected boolean endTag; - - /** - * The current tag token name. - */ - private ElementName tagName = null; - - /** - * The current attribute name. - */ - protected AttributeName attributeName = null; - - // [NOCPP[ - - /** - * Whether comment tokens are emitted. - */ - private boolean wantsComments = false; - - /** - * <code>true</code> when HTML4-specific additional errors are requested. - */ - protected boolean html4; - - /** - * Whether the stream is past the first 1024 bytes. - */ - private boolean metaBoundaryPassed; - - // ]NOCPP] - - /** - * The name of the current doctype token. - */ - private @Local String doctypeName; - - /** - * The public id of the current doctype token. - */ - private String publicIdentifier; - - /** - * The system id of the current doctype token. - */ - private String systemIdentifier; - - /** - * The attribute holder. - */ - private HtmlAttributes attributes; - - // [NOCPP[ - - /** - * The policy for vertical tab and form feed. - */ - private XmlViolationPolicy contentSpacePolicy = XmlViolationPolicy.ALTER_INFOSET; - - /** - * The policy for comments. - */ - private XmlViolationPolicy commentPolicy = XmlViolationPolicy.ALTER_INFOSET; - - private XmlViolationPolicy xmlnsPolicy = XmlViolationPolicy.ALTER_INFOSET; - - private XmlViolationPolicy namePolicy = XmlViolationPolicy.ALTER_INFOSET; - - private boolean html4ModeCompatibleWithXhtml1Schemata; - - private int mappingLangToXmlLang; - - // ]NOCPP] - - private final boolean newAttributesEachTime; - - private boolean shouldSuspend; - - protected boolean confident; - - private int line; - - /* - * The line number of the current attribute. First set to the line of the - * attribute name and if there is a value, set to the line the value - * started on. - */ - // CPPONLY: private int attributeLine; - - private Interner interner; - - // CPPONLY: private boolean viewingXmlSource; - - // [NOCPP[ - - protected LocatorImpl ampersandLocation; - - public Tokenizer(TokenHandler tokenHandler, boolean newAttributesEachTime) { - this.tokenHandler = tokenHandler; - this.encodingDeclarationHandler = null; - this.newAttributesEachTime = newAttributesEachTime; - // ∳ is the longest valid char ref and - // the semicolon never gets appended to the buffer. - this.charRefBuf = new char[32]; - this.bmpChar = new char[1]; - this.astralChar = new char[2]; - this.tagName = null; - this.attributeName = null; - this.doctypeName = null; - this.publicIdentifier = null; - this.systemIdentifier = null; - this.attributes = null; - } - - // ]NOCPP] - - /** - * The constructor. - * - * @param tokenHandler - * the handler for receiving tokens - */ - public Tokenizer(TokenHandler tokenHandler - // CPPONLY: , boolean viewingXmlSource - ) { - this.tokenHandler = tokenHandler; - this.encodingDeclarationHandler = null; - // [NOCPP[ - this.newAttributesEachTime = false; - // ]NOCPP] - // ∳ is the longest valid char ref and - // the semicolon never gets appended to the buffer. - this.charRefBuf = new char[32]; - this.bmpChar = new char[1]; - this.astralChar = new char[2]; - this.tagName = null; - this.attributeName = null; - this.doctypeName = null; - this.publicIdentifier = null; - this.systemIdentifier = null; - // [NOCPP[ - this.attributes = null; - // ]NOCPP] - // CPPONLY: this.attributes = tokenHandler.HasBuilder() ? new HtmlAttributes(mappingLangToXmlLang) : null; - // CPPONLY: this.newAttributesEachTime = !tokenHandler.HasBuilder(); - // CPPONLY: this.viewingXmlSource = viewingXmlSource; - } - - public void setInterner(Interner interner) { - this.interner = interner; - } - - public void initLocation(String newPublicId, String newSystemId) { - this.systemId = newSystemId; - this.publicId = newPublicId; - - } - - // CPPONLY: boolean isViewingXmlSource() { - // CPPONLY: return viewingXmlSource; - // CPPONLY: } - - // [NOCPP[ - - /** - * Returns the mappingLangToXmlLang. - * - * @return the mappingLangToXmlLang - */ - public boolean isMappingLangToXmlLang() { - return mappingLangToXmlLang == AttributeName.HTML_LANG; - } - - /** - * Sets the mappingLangToXmlLang. - * - * @param mappingLangToXmlLang - * the mappingLangToXmlLang to set - */ - public void setMappingLangToXmlLang(boolean mappingLangToXmlLang) { - this.mappingLangToXmlLang = mappingLangToXmlLang ? AttributeName.HTML_LANG - : AttributeName.HTML; - } - - /** - * Sets the error handler. - * - * @see org.xml.sax.XMLReader#setErrorHandler(org.xml.sax.ErrorHandler) - */ - public void setErrorHandler(ErrorHandler eh) { - this.errorHandler = eh; - } - - public ErrorHandler getErrorHandler() { - return this.errorHandler; - } - - /** - * Sets the commentPolicy. - * - * @param commentPolicy - * the commentPolicy to set - */ - public void setCommentPolicy(XmlViolationPolicy commentPolicy) { - this.commentPolicy = commentPolicy; - } - - /** - * Sets the contentNonXmlCharPolicy. - * - * @param contentNonXmlCharPolicy - * the contentNonXmlCharPolicy to set - */ - public void setContentNonXmlCharPolicy( - XmlViolationPolicy contentNonXmlCharPolicy) { - if (contentNonXmlCharPolicy != XmlViolationPolicy.ALLOW) { - throw new IllegalArgumentException( - "Must use ErrorReportingTokenizer to set contentNonXmlCharPolicy to non-ALLOW."); - } - } - - /** - * Sets the contentSpacePolicy. - * - * @param contentSpacePolicy - * the contentSpacePolicy to set - */ - public void setContentSpacePolicy(XmlViolationPolicy contentSpacePolicy) { - this.contentSpacePolicy = contentSpacePolicy; - } - - /** - * Sets the xmlnsPolicy. - * - * @param xmlnsPolicy - * the xmlnsPolicy to set - */ - public void setXmlnsPolicy(XmlViolationPolicy xmlnsPolicy) { - if (xmlnsPolicy == XmlViolationPolicy.FATAL) { - throw new IllegalArgumentException("Can't use FATAL here."); - } - this.xmlnsPolicy = xmlnsPolicy; - } - - public void setNamePolicy(XmlViolationPolicy namePolicy) { - this.namePolicy = namePolicy; - } - - /** - * Sets the html4ModeCompatibleWithXhtml1Schemata. - * - * @param html4ModeCompatibleWithXhtml1Schemata - * the html4ModeCompatibleWithXhtml1Schemata to set - */ - public void setHtml4ModeCompatibleWithXhtml1Schemata( - boolean html4ModeCompatibleWithXhtml1Schemata) { - this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata; - } - - // ]NOCPP] - - // For the token handler to call - /** - * Sets the tokenizer state and the associated element name. This should - * only ever used to put the tokenizer into one of the states that have - * a special end tag expectation. - * - * @param specialTokenizerState - * the tokenizer state to set - * @param endTagExpectation - * the expected end tag for transitioning back to normal - */ - public void setStateAndEndTagExpectation(int specialTokenizerState, - @Local String endTagExpectation) { - this.stateSave = specialTokenizerState; - if (specialTokenizerState == Tokenizer.DATA) { - return; - } - @Auto char[] asArray = Portability.newCharArrayFromLocal(endTagExpectation); - this.endTagExpectation = ElementName.elementNameByBuffer(asArray, 0, - asArray.length, interner); - endTagExpectationToArray(); - } - - /** - * Sets the tokenizer state and the associated element name. This should - * only ever used to put the tokenizer into one of the states that have - * a special end tag expectation. - * - * @param specialTokenizerState - * the tokenizer state to set - * @param endTagExpectation - * the expected end tag for transitioning back to normal - */ - public void setStateAndEndTagExpectation(int specialTokenizerState, - ElementName endTagExpectation) { - this.stateSave = specialTokenizerState; - this.endTagExpectation = endTagExpectation; - endTagExpectationToArray(); - } - - private void endTagExpectationToArray() { - switch (endTagExpectation.getGroup()) { - case TreeBuilder.TITLE: - endTagExpectationAsArray = TITLE_ARR; - return; - case TreeBuilder.SCRIPT: - endTagExpectationAsArray = SCRIPT_ARR; - return; - case TreeBuilder.STYLE: - endTagExpectationAsArray = STYLE_ARR; - return; - case TreeBuilder.PLAINTEXT: - endTagExpectationAsArray = PLAINTEXT_ARR; - return; - case TreeBuilder.XMP: - endTagExpectationAsArray = XMP_ARR; - return; - case TreeBuilder.TEXTAREA: - endTagExpectationAsArray = TEXTAREA_ARR; - return; - case TreeBuilder.IFRAME: - endTagExpectationAsArray = IFRAME_ARR; - return; - case TreeBuilder.NOEMBED: - endTagExpectationAsArray = NOEMBED_ARR; - return; - case TreeBuilder.NOSCRIPT: - endTagExpectationAsArray = NOSCRIPT_ARR; - return; - case TreeBuilder.NOFRAMES: - endTagExpectationAsArray = NOFRAMES_ARR; - return; - default: - assert false: "Bad end tag expectation."; - return; - } - } - - /** - * For C++ use only. - */ - public void setLineNumber(int line) { - // CPPONLY: this.attributeLine = line; // XXX is this needed? - this.line = line; - } - - // start Locator impl - - /** - * @see org.xml.sax.Locator#getLineNumber() - */ - @Inline public int getLineNumber() { - return line; - } - - // [NOCPP[ - - /** - * @see org.xml.sax.Locator#getColumnNumber() - */ - @Inline public int getColumnNumber() { - return -1; - } - - /** - * @see org.xml.sax.Locator#getPublicId() - */ - public String getPublicId() { - return publicId; - } - - /** - * @see org.xml.sax.Locator#getSystemId() - */ - public String getSystemId() { - return systemId; - } - - // end Locator impl - - // end public API - - public void notifyAboutMetaBoundary() { - metaBoundaryPassed = true; - } - - void turnOnAdditionalHtml4Errors() { - html4 = true; - } - - // ]NOCPP] - - HtmlAttributes emptyAttributes() { - // [NOCPP[ - if (newAttributesEachTime) { - return new HtmlAttributes(mappingLangToXmlLang); - } else { - // ]NOCPP] - return HtmlAttributes.EMPTY_ATTRIBUTES; - // [NOCPP[ - } - // ]NOCPP] - } - - @Inline private void appendCharRefBuf(char c) { - // CPPONLY: assert charRefBufLen < charRefBuf.length: - // CPPONLY: "RELEASE: Attempted to overrun charRefBuf!"; - charRefBuf[charRefBufLen++] = c; - } - - private void emitOrAppendCharRefBuf(int returnState) throws SAXException { - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - appendCharRefBufToStrBuf(); - } else { - if (charRefBufLen > 0) { - tokenHandler.characters(charRefBuf, 0, charRefBufLen); - charRefBufLen = 0; - } - } - } - - @Inline private void clearStrBufAfterUse() { - strBufLen = 0; - } - - @Inline private void clearStrBufBeforeUse() { - assert strBufLen == 0: "strBufLen not reset after previous use!"; - strBufLen = 0; // no-op in the absence of bugs - } - - @Inline private void clearStrBufAfterOneHyphen() { - assert strBufLen == 1: "strBufLen length not one!"; - assert strBuf[0] == '-': "strBuf does not start with a hyphen!"; - strBufLen = 0; - } - - /** - * Appends to the buffer. - * - * @param c - * the UTF-16 code unit to append - */ - @Inline private void appendStrBuf(char c) { - // CPPONLY: assert strBufLen < strBuf.length: "Previous buffer length insufficient."; - // CPPONLY: if (strBufLen == strBuf.length) { - // CPPONLY: if (!EnsureBufferSpace(1)) { - // CPPONLY: assert false: "RELEASE: Unable to recover from buffer reallocation failure"; - // CPPONLY: } // TODO: Add telemetry when outer if fires but inner does not - // CPPONLY: } - strBuf[strBufLen++] = c; - } - - /** - * The buffer as a String. Currently only used for error reporting. - * - * <p> - * C++ memory note: The return value must be released. - * - * @return the buffer as a string - */ - protected String strBufToString() { - String str = Portability.newStringFromBuffer(strBuf, 0, strBufLen - // CPPONLY: , tokenHandler - ); - clearStrBufAfterUse(); - return str; - } - - /** - * Returns the buffer as a local name. The return value is released in - * emitDoctypeToken(). - * - * @return the buffer as local name - */ - private void strBufToDoctypeName() { - doctypeName = Portability.newLocalNameFromBuffer(strBuf, 0, strBufLen, - interner); - clearStrBufAfterUse(); - } - - /** - * Emits the buffer as character tokens. - * - * @throws SAXException - * if the token handler threw - */ - private void emitStrBuf() throws SAXException { - if (strBufLen > 0) { - tokenHandler.characters(strBuf, 0, strBufLen); - clearStrBufAfterUse(); - } - } - - @Inline private void appendSecondHyphenToBogusComment() throws SAXException { - // [NOCPP[ - switch (commentPolicy) { - case ALTER_INFOSET: - appendStrBuf(' '); - // FALLTHROUGH - case ALLOW: - warn("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment."); - // ]NOCPP] - appendStrBuf('-'); - // [NOCPP[ - break; - case FATAL: - fatal("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment."); - break; - } - // ]NOCPP] - } - - // [NOCPP[ - private void maybeAppendSpaceToBogusComment() throws SAXException { - switch (commentPolicy) { - case ALTER_INFOSET: - appendStrBuf(' '); - // FALLTHROUGH - case ALLOW: - warn("The document is not mappable to XML 1.0 due to a trailing hyphen in a comment."); - break; - case FATAL: - fatal("The document is not mappable to XML 1.0 due to a trailing hyphen in a comment."); - break; - } - } - - // ]NOCPP] - - @Inline private void adjustDoubleHyphenAndAppendToStrBufAndErr(char c) - throws SAXException { - errConsecutiveHyphens(); - // [NOCPP[ - switch (commentPolicy) { - case ALTER_INFOSET: - strBufLen--; - // WARNING!!! This expands the worst case of the buffer length - // given the length of input! - appendStrBuf(' '); - appendStrBuf('-'); - // FALLTHROUGH - case ALLOW: - warn("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment."); - // ]NOCPP] - appendStrBuf(c); - // [NOCPP[ - break; - case FATAL: - fatal("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment."); - break; - } - // ]NOCPP] - } - - private void appendStrBuf(@NoLength char[] buffer, int offset, int length) { - int newLen = strBufLen + length; - // CPPONLY: assert newLen <= strBuf.length: "Previous buffer length insufficient."; - // CPPONLY: if (strBuf.length < newLen) { - // CPPONLY: if (!EnsureBufferSpace(length)) { - // CPPONLY: assert false: "RELEASE: Unable to recover from buffer reallocation failure"; - // CPPONLY: } // TODO: Add telemetry when outer if fires but inner does not - // CPPONLY: } - System.arraycopy(buffer, offset, strBuf, strBufLen, length); - strBufLen = newLen; - } - - /** - * Append the contents of the char reference buffer to the main one. - */ - @Inline private void appendCharRefBufToStrBuf() { - appendStrBuf(charRefBuf, 0, charRefBufLen); - charRefBufLen = 0; - } - - /** - * Emits the current comment token. - * - * @param pos - * TODO - * - * @throws SAXException - */ - private void emitComment(int provisionalHyphens, int pos) - throws SAXException { - // [NOCPP[ - if (wantsComments) { - // ]NOCPP] - tokenHandler.comment(strBuf, 0, strBufLen - - provisionalHyphens); - // [NOCPP[ - } - // ]NOCPP] - clearStrBufAfterUse(); - cstart = pos + 1; - } - - /** - * Flushes coalesced character tokens. - * - * @param buf - * TODO - * @param pos - * TODO - * - * @throws SAXException - */ - protected void flushChars(@NoLength char[] buf, int pos) - throws SAXException { - if (pos > cstart) { - tokenHandler.characters(buf, cstart, pos - cstart); - } - cstart = Integer.MAX_VALUE; - } - - /** - * Reports an condition that would make the infoset incompatible with XML - * 1.0 as fatal. - * - * @param message - * the message - * @throws SAXException - * @throws SAXParseException - */ - public void fatal(String message) throws SAXException { - SAXParseException spe = new SAXParseException(message, this); - if (errorHandler != null) { - errorHandler.fatalError(spe); - } - throw spe; - } - - /** - * Reports a Parse Error. - * - * @param message - * the message - * @throws SAXException - */ - public void err(String message) throws SAXException { - if (errorHandler == null) { - return; - } - SAXParseException spe = new SAXParseException(message, this); - errorHandler.error(spe); - } - - public void errTreeBuilder(String message) throws SAXException { - ErrorHandler eh = null; - if (tokenHandler instanceof TreeBuilder<?>) { - TreeBuilder<?> treeBuilder = (TreeBuilder<?>) tokenHandler; - eh = treeBuilder.getErrorHandler(); - } - if (eh == null) { - eh = errorHandler; - } - if (eh == null) { - return; - } - SAXParseException spe = new SAXParseException(message, this); - eh.error(spe); - } - - /** - * Reports a warning - * - * @param message - * the message - * @throws SAXException - */ - public void warn(String message) throws SAXException { - if (errorHandler == null) { - return; - } - SAXParseException spe = new SAXParseException(message, this); - errorHandler.warning(spe); - } - - private void strBufToElementNameString() { - tagName = ElementName.elementNameByBuffer(strBuf, 0, strBufLen, - interner); - clearStrBufAfterUse(); - } - - private int emitCurrentTagToken(boolean selfClosing, int pos) - throws SAXException { - cstart = pos + 1; - maybeErrSlashInEndTag(selfClosing); - stateSave = Tokenizer.DATA; - HtmlAttributes attrs = (attributes == null ? HtmlAttributes.EMPTY_ATTRIBUTES - : attributes); - if (endTag) { - /* - * When an end tag token is emitted, the content model flag must be - * switched to the PCDATA state. - */ - maybeErrAttributesOnEndTag(attrs); - // CPPONLY: if (!viewingXmlSource) { - tokenHandler.endTag(tagName); - // CPPONLY: } - // CPPONLY: if (newAttributesEachTime) { - // CPPONLY: Portability.delete(attributes); - // CPPONLY: attributes = null; - // CPPONLY: } - } else { - // CPPONLY: if (viewingXmlSource) { - // CPPONLY: assert newAttributesEachTime; - // CPPONLY: Portability.delete(attributes); - // CPPONLY: attributes = null; - // CPPONLY: } else { - tokenHandler.startTag(tagName, attrs, selfClosing); - // CPPONLY: } - } - tagName.release(); - tagName = null; - if (newAttributesEachTime) { - attributes = null; - } else { - attributes.clear(mappingLangToXmlLang); - } - /* - * The token handler may have called setStateAndEndTagExpectation - * and changed stateSave since the start of this method. - */ - return stateSave; - } - - private void attributeNameComplete() throws SAXException { - attributeName = AttributeName.nameByBuffer(strBuf, 0, strBufLen - // [NOCPP[ - , namePolicy != XmlViolationPolicy.ALLOW - // ]NOCPP] - , interner); - clearStrBufAfterUse(); - - if (attributes == null) { - attributes = new HtmlAttributes(mappingLangToXmlLang); - } - - /* - * When the user agent leaves the attribute name state (and before - * emitting the tag token, if appropriate), the complete attribute's - * name must be compared to the other attributes on the same token; if - * there is already an attribute on the token with the exact same name, - * then this is a parse error and the new attribute must be dropped, - * along with the value that gets associated with it (if any). - */ - if (attributes.contains(attributeName)) { - errDuplicateAttribute(); - attributeName.release(); - attributeName = null; - } - } - - private void addAttributeWithoutValue() throws SAXException { - noteAttributeWithoutValue(); - - // [NOCPP[ - if (metaBoundaryPassed && AttributeName.CHARSET == attributeName - && ElementName.META == tagName) { - err("A \u201Ccharset\u201D attribute on a \u201Cmeta\u201D element found after the first 512 bytes."); - } - // ]NOCPP] - if (attributeName != null) { - // [NOCPP[ - if (html4) { - if (attributeName.isBoolean()) { - if (html4ModeCompatibleWithXhtml1Schemata) { - attributes.addAttribute(attributeName, - attributeName.getLocal(AttributeName.HTML), - xmlnsPolicy); - } else { - attributes.addAttribute(attributeName, "", xmlnsPolicy); - } - } else { - if (AttributeName.BORDER != attributeName) { - err("Attribute value omitted for a non-boolean attribute. (HTML4-only error.)"); - attributes.addAttribute(attributeName, "", xmlnsPolicy); - } - } - } else { - if (AttributeName.SRC == attributeName - || AttributeName.HREF == attributeName) { - warn("Attribute \u201C" - + attributeName.getLocal(AttributeName.HTML) - + "\u201D without an explicit value seen. The attribute may be dropped by IE7."); - } - // ]NOCPP] - attributes.addAttribute(attributeName, - Portability.newEmptyString() - // [NOCPP[ - , xmlnsPolicy - // ]NOCPP] - // CPPONLY: , attributeLine - ); - // [NOCPP[ - } - // ]NOCPP] - attributeName = null; // attributeName has been adopted by the - // |attributes| object - } else { - clearStrBufAfterUse(); - } - } - - private void addAttributeWithValue() throws SAXException { - // [NOCPP[ - if (metaBoundaryPassed && ElementName.META == tagName - && AttributeName.CHARSET == attributeName) { - err("A \u201Ccharset\u201D attribute on a \u201Cmeta\u201D element found after the first 512 bytes."); - } - // ]NOCPP] - if (attributeName != null) { - String val = strBufToString(); // Ownership transferred to - // HtmlAttributes - // CPPONLY: if (mViewSource) { - // CPPONLY: mViewSource.MaybeLinkifyAttributeValue(attributeName, val); - // CPPONLY: } - // [NOCPP[ - if (!endTag && html4 && html4ModeCompatibleWithXhtml1Schemata - && attributeName.isCaseFolded()) { - val = newAsciiLowerCaseStringFromString(val); - } - // ]NOCPP] - attributes.addAttribute(attributeName, val - // [NOCPP[ - , xmlnsPolicy - // ]NOCPP] - // CPPONLY: , attributeLine - ); - attributeName = null; // attributeName has been adopted by the - // |attributes| object - } else { - // We have a duplicate attribute. Explicitly discard its value. - clearStrBufAfterUse(); - } - } - - // [NOCPP[ - - private static String newAsciiLowerCaseStringFromString(String str) { - if (str == null) { - return null; - } - char[] buf = new char[str.length()]; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c >= 'A' && c <= 'Z') { - c += 0x20; - } - buf[i] = c; - } - return new String(buf); - } - - protected void startErrorReporting() throws SAXException { - - } - - // ]NOCPP] - - public void start() throws SAXException { - initializeWithoutStarting(); - tokenHandler.startTokenization(this); - // [NOCPP[ - startErrorReporting(); - // ]NOCPP] - } - - public boolean tokenizeBuffer(UTF16Buffer buffer) throws SAXException { - int state = stateSave; - int returnState = returnStateSave; - char c = '\u0000'; - shouldSuspend = false; - lastCR = false; - - int start = buffer.getStart(); - int end = buffer.getEnd(); - - // In C++, the caller of tokenizeBuffer needs to do this explicitly. - // [NOCPP[ - ensureBufferSpace(end - start); - // ]NOCPP] - - /** - * The index of the last <code>char</code> read from <code>buf</code>. - */ - int pos = start - 1; - - /** - * The index of the first <code>char</code> in <code>buf</code> that is - * part of a coalesced run of character tokens or - * <code>Integer.MAX_VALUE</code> if there is not a current run being - * coalesced. - */ - switch (state) { - case DATA: - case RCDATA: - case SCRIPT_DATA: - case PLAINTEXT: - case RAWTEXT: - case CDATA_SECTION: - case SCRIPT_DATA_ESCAPED: - case SCRIPT_DATA_ESCAPE_START: - case SCRIPT_DATA_ESCAPE_START_DASH: - case SCRIPT_DATA_ESCAPED_DASH: - case SCRIPT_DATA_ESCAPED_DASH_DASH: - case SCRIPT_DATA_DOUBLE_ESCAPE_START: - case SCRIPT_DATA_DOUBLE_ESCAPED: - case SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: - case SCRIPT_DATA_DOUBLE_ESCAPED_DASH: - case SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: - case SCRIPT_DATA_DOUBLE_ESCAPE_END: - cstart = start; - break; - default: - cstart = Integer.MAX_VALUE; - break; - } - - /** - * The number of <code>char</code>s in <code>buf</code> that have - * meaning. (The rest of the array is garbage and should not be - * examined.) - */ - // CPPONLY: if (mViewSource) { - // CPPONLY: mViewSource.SetBuffer(buffer); - // CPPONLY: pos = stateLoop(state, c, pos, buffer.getBuffer(), false, returnState, buffer.getEnd()); - // CPPONLY: mViewSource.DropBuffer((pos == buffer.getEnd()) ? pos : pos + 1); - // CPPONLY: } else { - // CPPONLY: pos = stateLoop(state, c, pos, buffer.getBuffer(), false, returnState, buffer.getEnd()); - // CPPONLY: } - // [NOCPP[ - pos = stateLoop(state, c, pos, buffer.getBuffer(), false, returnState, - end); - // ]NOCPP] - if (pos == end) { - // exiting due to end of buffer - buffer.setStart(pos); - } else { - buffer.setStart(pos + 1); - } - return lastCR; - } - - // [NOCPP[ - private void ensureBufferSpace(int inputLength) throws SAXException { - // Add 2 to account for emissions of LT_GT, LT_SOLIDUS and RSQB_RSQB. - // Adding to the general worst case instead of only the - // TreeBuilder-exposed worst case to avoid re-introducing a bug when - // unifying the tokenizer and tree builder buffers in the future. - int worstCase = strBufLen + inputLength + charRefBufLen + 2; - tokenHandler.ensureBufferSpace(worstCase); - if (commentPolicy == XmlViolationPolicy.ALTER_INFOSET) { - // When altering infoset, if the comment contents are consecutive - // hyphens, each hyphen generates a space, too. These buffer - // contents never get emitted as characters() to the tokenHandler, - // which is why this calculation happens after the call to - // ensureBufferSpace on tokenHandler. - worstCase *= 2; - } - if (strBuf == null) { - // Add an arbitrary small value to avoid immediate reallocation - // once there are a few characters in the buffer. - strBuf = new char[worstCase + 128]; - } else if (worstCase > strBuf.length) { - // HotSpot reportedly allocates memory with 8-byte accuracy, so - // there's no point in trying to do math here to avoid slop. - // Maybe we should add some small constant to worstCase here - // but not doing that without profiling. In C++ with jemalloc, - // the corresponding method should do math to round up here - // to avoid slop. - char[] newBuf = new char[worstCase]; - System.arraycopy(strBuf, 0, newBuf, 0, strBufLen); - strBuf = newBuf; - } - } - // ]NOCPP] - - @SuppressWarnings("unused") private int stateLoop(int state, char c, - int pos, @NoLength char[] buf, boolean reconsume, int returnState, - int endPos) throws SAXException { - /* - * Idioms used in this code: - * - * - * Consuming the next input character - * - * To consume the next input character, the code does this: if (++pos == - * endPos) { break stateloop; } c = checkChar(buf, pos); - * - * - * Staying in a state - * - * When there's a state that the tokenizer may stay in over multiple - * input characters, the state has a wrapper |for(;;)| loop and staying - * in the state continues the loop. - * - * - * Switching to another state - * - * To switch to another state, the code sets the state variable to the - * magic number of the new state. Then it either continues stateloop or - * breaks out of the state's own wrapper loop if the target state is - * right after the current state in source order. (This is a partial - * workaround for Java's lack of goto.) - * - * - * Reconsume support - * - * The spec sometimes says that an input character is reconsumed in - * another state. If a state can ever be entered so that an input - * character can be reconsumed in it, the state's code starts with an - * |if (reconsume)| that sets reconsume to false and skips over the - * normal code for consuming a new character. - * - * To reconsume the current character in another state, the code sets - * |reconsume| to true and then switches to the other state. - * - * - * Emitting character tokens - * - * This method emits character tokens lazily. Whenever a new range of - * character tokens starts, the field cstart must be set to the start - * index of the range. The flushChars() method must be called at the end - * of a range to flush it. - * - * - * U+0000 handling - * - * The various states have to handle the replacement of U+0000 with - * U+FFFD. However, if U+0000 would be reconsumed in another state, the - * replacement doesn't need to happen, because it's handled by the - * reconsuming state. - * - * - * LF handling - * - * Every state needs to increment the line number upon LF unless the LF - * gets reconsumed by another state which increments the line number. - * - * - * CR handling - * - * Every state needs to handle CR unless the CR gets reconsumed and is - * handled by the reconsuming state. The CR needs to be handled as if it - * were and LF, the lastCR field must be set to true and then this - * method must return. The IO driver will then swallow the next - * character if it is an LF to coalesce CRLF. - */ - stateloop: for (;;) { - switch (state) { - case DATA: - dataloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - switch (c) { - case '&': - /* - * U+0026 AMPERSAND (&) Switch to the character - * reference in data state. - */ - flushChars(buf, pos); - assert charRefBufLen == 0: "charRefBufLen not reset after previous use!"; - appendCharRefBuf(c); - setAdditionalAndRememberAmpersandLocation('\u0000'); - returnState = state; - state = transition(state, Tokenizer.CONSUME_CHARACTER_REFERENCE, reconsume, pos); - continue stateloop; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the tag - * open state. - */ - flushChars(buf, pos); - - state = transition(state, Tokenizer.TAG_OPEN, reconsume, pos); - break dataloop; // FALL THROUGH continue - // stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the input character as a - * character token. - * - * Stay in the data state. - */ - continue; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case TAG_OPEN: - tagopenloop: for (;;) { - /* - * The behavior of this state depends on the content - * model flag. - */ - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * If the content model flag is set to the PCDATA state - * Consume the next input character: - */ - if (c >= 'A' && c <= 'Z') { - /* - * U+0041 LATIN CAPITAL LETTER A through to U+005A - * LATIN CAPITAL LETTER Z Create a new start tag - * token, - */ - endTag = false; - /* - * set its tag name to the lowercase version of the - * input character (add 0x0020 to the character's - * code point), - */ - clearStrBufBeforeUse(); - appendStrBuf((char) (c + 0x20)); - /* then switch to the tag name state. */ - state = transition(state, Tokenizer.TAG_NAME, reconsume, pos); - /* - * (Don't emit the token yet; further details will - * be filled in before it is emitted.) - */ - break tagopenloop; - // continue stateloop; - } else if (c >= 'a' && c <= 'z') { - /* - * U+0061 LATIN SMALL LETTER A through to U+007A - * LATIN SMALL LETTER Z Create a new start tag - * token, - */ - endTag = false; - /* - * set its tag name to the input character, - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - /* then switch to the tag name state. */ - state = transition(state, Tokenizer.TAG_NAME, reconsume, pos); - /* - * (Don't emit the token yet; further details will - * be filled in before it is emitted.) - */ - break tagopenloop; - // continue stateloop; - } - switch (c) { - case '!': - /* - * U+0021 EXCLAMATION MARK (!) Switch to the - * markup declaration open state. - */ - state = transition(state, Tokenizer.MARKUP_DECLARATION_OPEN, reconsume, pos); - continue stateloop; - case '/': - /* - * U+002F SOLIDUS (/) Switch to the close tag - * open state. - */ - state = transition(state, Tokenizer.CLOSE_TAG_OPEN, reconsume, pos); - continue stateloop; - case '?': - // CPPONLY: if (viewingXmlSource) { - // CPPONLY: state = transition(state, - // CPPONLY: Tokenizer.PROCESSING_INSTRUCTION, - // CPPONLY: reconsume, - // CPPONLY: pos); - // CPPONLY: continue stateloop; - // CPPONLY: } - /* - * U+003F QUESTION MARK (?) Parse error. - */ - errProcessingInstruction(); - /* - * Switch to the bogus comment state. - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Parse error. - */ - errLtGt(); - /* - * Emit a U+003C LESS-THAN SIGN character token - * and a U+003E GREATER-THAN SIGN character - * token. - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 2); - /* Switch to the data state. */ - cstart = pos + 1; - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - /* - * Anything else Parse error. - */ - errBadCharAfterLt(c); - /* - * Emit a U+003C LESS-THAN SIGN character token - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - /* - * and reconsume the current input character in - * the data state. - */ - cstart = pos; - reconsume = true; - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - } - } - // FALL THROUGH DON'T REORDER - case TAG_NAME: - tagnameloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - strBufToElementNameString(); - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the before attribute name state. - */ - strBufToElementNameString(); - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - break tagnameloop; - // continue stateloop; - case '/': - /* - * U+002F SOLIDUS (/) Switch to the self-closing - * start tag state. - */ - strBufToElementNameString(); - state = transition(state, Tokenizer.SELF_CLOSING_START_TAG, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * tag token. - */ - strBufToElementNameString(); - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - if (c >= 'A' && c <= 'Z') { - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Append the - * lowercase version of the current input - * character (add 0x0020 to the character's - * code point) to the current tag token's - * tag name. - */ - c += 0x20; - } - /* - * Anything else Append the current input - * character to the current tag token's tag - * name. - */ - appendStrBuf(c); - /* - * Stay in the tag name state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_ATTRIBUTE_NAME: - beforeattributenameloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the before attribute name state. - */ - continue; - case '/': - /* - * U+002F SOLIDUS (/) Switch to the self-closing - * start tag state. - */ - state = transition(state, Tokenizer.SELF_CLOSING_START_TAG, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * tag token. - */ - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - case '\"': - case '\'': - case '<': - case '=': - /* - * U+0022 QUOTATION MARK (") U+0027 APOSTROPHE - * (') U+003C LESS-THAN SIGN (<) U+003D EQUALS - * SIGN (=) Parse error. - */ - errBadCharBeforeAttributeNameOrNull(c); - /* - * Treat it as per the "anything else" entry - * below. - */ - default: - /* - * Anything else Start a new attribute in the - * current tag token. - */ - if (c >= 'A' && c <= 'Z') { - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Set that - * attribute's name to the lowercase version - * of the current input character (add - * 0x0020 to the character's code point) - */ - c += 0x20; - } - // CPPONLY: attributeLine = line; - /* - * Set that attribute's name to the current - * input character, - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - /* - * and its value to the empty string. - */ - // Will do later. - /* - * Switch to the attribute name state. - */ - state = transition(state, Tokenizer.ATTRIBUTE_NAME, reconsume, pos); - break beforeattributenameloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case ATTRIBUTE_NAME: - attributenameloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - attributeNameComplete(); - state = transition(state, Tokenizer.AFTER_ATTRIBUTE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the after attribute name state. - */ - attributeNameComplete(); - state = transition(state, Tokenizer.AFTER_ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - case '/': - /* - * U+002F SOLIDUS (/) Switch to the self-closing - * start tag state. - */ - attributeNameComplete(); - addAttributeWithoutValue(); - state = transition(state, Tokenizer.SELF_CLOSING_START_TAG, reconsume, pos); - continue stateloop; - case '=': - /* - * U+003D EQUALS SIGN (=) Switch to the before - * attribute value state. - */ - attributeNameComplete(); - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_VALUE, reconsume, pos); - break attributenameloop; - // continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * tag token. - */ - attributeNameComplete(); - addAttributeWithoutValue(); - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - case '\"': - case '\'': - case '<': - /* - * U+0022 QUOTATION MARK (") U+0027 APOSTROPHE - * (') U+003C LESS-THAN SIGN (<) Parse error. - */ - errQuoteOrLtInAttributeNameOrNull(c); - /* - * Treat it as per the "anything else" entry - * below. - */ - default: - if (c >= 'A' && c <= 'Z') { - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Append the - * lowercase version of the current input - * character (add 0x0020 to the character's - * code point) to the current attribute's - * name. - */ - c += 0x20; - } - /* - * Anything else Append the current input - * character to the current attribute's name. - */ - appendStrBuf(c); - /* - * Stay in the attribute name state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_ATTRIBUTE_VALUE: - beforeattributevalueloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the before attribute value state. - */ - continue; - case '"': - /* - * U+0022 QUOTATION MARK (") Switch to the - * attribute value (double-quoted) state. - */ - // CPPONLY: attributeLine = line; - clearStrBufBeforeUse(); - state = transition(state, Tokenizer.ATTRIBUTE_VALUE_DOUBLE_QUOTED, reconsume, pos); - break beforeattributevalueloop; - // continue stateloop; - case '&': - /* - * U+0026 AMPERSAND (&) Switch to the attribute - * value (unquoted) state and reconsume this - * input character. - */ - // CPPONLY: attributeLine = line; - clearStrBufBeforeUse(); - reconsume = true; - state = transition(state, Tokenizer.ATTRIBUTE_VALUE_UNQUOTED, reconsume, pos); - noteUnquotedAttributeValue(); - continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Switch to the attribute - * value (single-quoted) state. - */ - // CPPONLY: attributeLine = line; - clearStrBufBeforeUse(); - state = transition(state, Tokenizer.ATTRIBUTE_VALUE_SINGLE_QUOTED, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Parse error. - */ - errAttributeValueMissing(); - /* - * Emit the current tag token. - */ - addAttributeWithoutValue(); - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - case '<': - case '=': - case '`': - /* - * U+003C LESS-THAN SIGN (<) U+003D EQUALS SIGN - * (=) U+0060 GRAVE ACCENT (`) - */ - errLtOrEqualsOrGraveInUnquotedAttributeOrNull(c); - /* - * Treat it as per the "anything else" entry - * below. - */ - default: - // [NOCPP[ - errHtml4NonNameInUnquotedAttribute(c); - // ]NOCPP] - /* - * Anything else Append the current input - * character to the current attribute's value. - */ - // CPPONLY: attributeLine = line; - clearStrBufBeforeUse(); - appendStrBuf(c); - /* - * Switch to the attribute value (unquoted) - * state. - */ - - state = transition(state, Tokenizer.ATTRIBUTE_VALUE_UNQUOTED, reconsume, pos); - noteUnquotedAttributeValue(); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case ATTRIBUTE_VALUE_DOUBLE_QUOTED: - attributevaluedoublequotedloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '"': - /* - * U+0022 QUOTATION MARK (") Switch to the after - * attribute value (quoted) state. - */ - addAttributeWithValue(); - - state = transition(state, Tokenizer.AFTER_ATTRIBUTE_VALUE_QUOTED, reconsume, pos); - break attributevaluedoublequotedloop; - // continue stateloop; - case '&': - /* - * U+0026 AMPERSAND (&) Switch to the character - * reference in attribute value state, with the - * additional allowed character being U+0022 - * QUOTATION MARK ("). - */ - assert charRefBufLen == 0: "charRefBufLen not reset after previous use!"; - appendCharRefBuf(c); - setAdditionalAndRememberAmpersandLocation('\"'); - returnState = state; - state = transition(state, Tokenizer.CONSUME_CHARACTER_REFERENCE, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the current input - * character to the current attribute's value. - */ - appendStrBuf(c); - /* - * Stay in the attribute value (double-quoted) - * state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case AFTER_ATTRIBUTE_VALUE_QUOTED: - afterattributevaluequotedloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the before attribute name state. - */ - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - case '/': - /* - * U+002F SOLIDUS (/) Switch to the self-closing - * start tag state. - */ - state = transition(state, Tokenizer.SELF_CLOSING_START_TAG, reconsume, pos); - break afterattributevaluequotedloop; - // continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * tag token. - */ - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - default: - /* - * Anything else Parse error. - */ - errNoSpaceBetweenAttributes(); - /* - * Reconsume the character in the before - * attribute name state. - */ - reconsume = true; - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case SELF_CLOSING_START_TAG: - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Set the self-closing - * flag of the current tag token. Emit the current - * tag token. - */ - // [NOCPP[ - errHtml4XmlVoidSyntax(); - // ]NOCPP] - state = transition(state, emitCurrentTagToken(true, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - default: - /* Anything else Parse error. */ - errSlashNotFollowedByGt(); - /* - * Reconsume the character in the before attribute - * name state. - */ - reconsume = true; - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - } - // XXX reorder point - case ATTRIBUTE_VALUE_UNQUOTED: - for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - addAttributeWithValue(); - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the before attribute name state. - */ - addAttributeWithValue(); - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - case '&': - /* - * U+0026 AMPERSAND (&) Switch to the character - * reference in attribute value state, with the - * additional allowed character being U+003E - * GREATER-THAN SIGN (>) - */ - assert charRefBufLen == 0: "charRefBufLen not reset after previous use!"; - appendCharRefBuf(c); - setAdditionalAndRememberAmpersandLocation('>'); - returnState = state; - state = transition(state, Tokenizer.CONSUME_CHARACTER_REFERENCE, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * tag token. - */ - addAttributeWithValue(); - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - case '<': - case '\"': - case '\'': - case '=': - case '`': - /* - * U+0022 QUOTATION MARK (") U+0027 APOSTROPHE - * (') U+003C LESS-THAN SIGN (<) U+003D EQUALS - * SIGN (=) U+0060 GRAVE ACCENT (`) Parse error. - */ - errUnquotedAttributeValOrNull(c); - /* - * Treat it as per the "anything else" entry - * below. - */ - // fall through - default: - // [NOCPP] - errHtml4NonNameInUnquotedAttribute(c); - // ]NOCPP] - /* - * Anything else Append the current input - * character to the current attribute's value. - */ - appendStrBuf(c); - /* - * Stay in the attribute value (unquoted) state. - */ - continue; - } - } - // XXX reorder point - case AFTER_ATTRIBUTE_NAME: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the after attribute name state. - */ - continue; - case '/': - /* - * U+002F SOLIDUS (/) Switch to the self-closing - * start tag state. - */ - addAttributeWithoutValue(); - state = transition(state, Tokenizer.SELF_CLOSING_START_TAG, reconsume, pos); - continue stateloop; - case '=': - /* - * U+003D EQUALS SIGN (=) Switch to the before - * attribute value state. - */ - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_VALUE, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * tag token. - */ - addAttributeWithoutValue(); - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - /* - * Switch to the data state. - */ - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - case '\"': - case '\'': - case '<': - errQuoteOrLtInAttributeNameOrNull(c); - /* - * Treat it as per the "anything else" entry - * below. - */ - default: - addAttributeWithoutValue(); - /* - * Anything else Start a new attribute in the - * current tag token. - */ - if (c >= 'A' && c <= 'Z') { - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Set that - * attribute's name to the lowercase version - * of the current input character (add - * 0x0020 to the character's code point) - */ - c += 0x20; - } - /* - * Set that attribute's name to the current - * input character, - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - /* - * and its value to the empty string. - */ - // Will do later. - /* - * Switch to the attribute name state. - */ - state = transition(state, Tokenizer.ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case MARKUP_DECLARATION_OPEN: - markupdeclarationopenloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * If the next two characters are both U+002D - * HYPHEN-MINUS characters (-), consume those two - * characters, create a comment token whose data is the - * empty string, and switch to the comment start state. - * - * Otherwise, if the next seven characters are an ASCII - * case-insensitive match for the word "DOCTYPE", then - * consume those characters and switch to the DOCTYPE - * state. - * - * Otherwise, if the insertion mode is - * "in foreign content" and the current node is not an - * element in the HTML namespace and the next seven - * characters are an case-sensitive match for the string - * "[CDATA[" (the five uppercase letters "CDATA" with a - * U+005B LEFT SQUARE BRACKET character before and - * after), then consume those characters and switch to - * the CDATA section state. - * - * Otherwise, is is a parse error. Switch to the bogus - * comment state. The next character that is consumed, - * if any, is the first character that will be in the - * comment. - */ - switch (c) { - case '-': - clearStrBufBeforeUse(); - appendStrBuf(c); - state = transition(state, Tokenizer.MARKUP_DECLARATION_HYPHEN, reconsume, pos); - break markupdeclarationopenloop; - // continue stateloop; - case 'd': - case 'D': - clearStrBufBeforeUse(); - appendStrBuf(c); - index = 0; - state = transition(state, Tokenizer.MARKUP_DECLARATION_OCTYPE, reconsume, pos); - continue stateloop; - case '[': - if (tokenHandler.cdataSectionAllowed()) { - clearStrBufBeforeUse(); - appendStrBuf(c); - index = 0; - state = transition(state, Tokenizer.CDATA_START, reconsume, pos); - continue stateloop; - } - // else fall through - default: - errBogusComment(); - clearStrBufBeforeUse(); - reconsume = true; - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case MARKUP_DECLARATION_HYPHEN: - markupdeclarationhyphenloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case '\u0000': - break stateloop; - case '-': - clearStrBufAfterOneHyphen(); - state = transition(state, Tokenizer.COMMENT_START, reconsume, pos); - break markupdeclarationhyphenloop; - // continue stateloop; - default: - errBogusComment(); - reconsume = true; - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case COMMENT_START: - commentstartloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Comment start state - * - * - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Switch to the comment - * start dash state. - */ - appendStrBuf(c); - state = transition(state, Tokenizer.COMMENT_START_DASH, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Parse error. - */ - errPrematureEndOfComment(); - /* Emit the comment token. */ - emitComment(0, pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - break stateloop; - case '\n': - appendStrBufLineFeed(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - break commentstartloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the input character to - * the comment token's data. - */ - appendStrBuf(c); - /* - * Switch to the comment state. - */ - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - break commentstartloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case COMMENT: - commentloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Comment state Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Switch to the comment - * end dash state - */ - appendStrBuf(c); - state = transition(state, Tokenizer.COMMENT_END_DASH, reconsume, pos); - break commentloop; - // continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the input character to - * the comment token's data. - */ - appendStrBuf(c); - /* - * Stay in the comment state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case COMMENT_END_DASH: - commentenddashloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Comment end dash state Consume the next input - * character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Switch to the comment - * end state - */ - appendStrBuf(c); - state = transition(state, Tokenizer.COMMENT_END, reconsume, pos); - break commentenddashloop; - // continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - break stateloop; - case '\n': - appendStrBufLineFeed(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append a U+002D HYPHEN-MINUS - * (-) character and the input character to the - * comment token's data. - */ - appendStrBuf(c); - /* - * Switch to the comment state. - */ - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case COMMENT_END: - commentendloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Comment end dash state Consume the next input - * character: - */ - switch (c) { - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the comment - * token. - */ - emitComment(2, pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '-': - /* U+002D HYPHEN-MINUS (-) Parse error. */ - /* - * Append a U+002D HYPHEN-MINUS (-) character to - * the comment token's data. - */ - adjustDoubleHyphenAndAppendToStrBufAndErr(c); - /* - * Stay in the comment end state. - */ - continue; - case '\r': - adjustDoubleHyphenAndAppendToStrBufCarriageReturn(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - break stateloop; - case '\n': - adjustDoubleHyphenAndAppendToStrBufLineFeed(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - case '!': - errHyphenHyphenBang(); - appendStrBuf(c); - state = transition(state, Tokenizer.COMMENT_END_BANG, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Append two U+002D HYPHEN-MINUS (-) characters - * and the input character to the comment - * token's data. - */ - adjustDoubleHyphenAndAppendToStrBufAndErr(c); - /* - * Switch to the comment state. - */ - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case COMMENT_END_BANG: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Comment end bang state - * - * Consume the next input character: - */ - switch (c) { - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the comment - * token. - */ - emitComment(3, pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '-': - /* - * Append two U+002D HYPHEN-MINUS (-) characters - * and a U+0021 EXCLAMATION MARK (!) character - * to the comment token's data. - */ - appendStrBuf(c); - /* - * Switch to the comment end dash state. - */ - state = transition(state, Tokenizer.COMMENT_END_DASH, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append two U+002D HYPHEN-MINUS - * (-) characters, a U+0021 EXCLAMATION MARK (!) - * character, and the input character to the - * comment token's data. Switch to the comment - * state. - */ - appendStrBuf(c); - /* - * Switch to the comment state. - */ - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case COMMENT_START_DASH: - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Comment start dash state - * - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Switch to the comment end - * state - */ - appendStrBuf(c); - state = transition(state, Tokenizer.COMMENT_END, reconsume, pos); - continue stateloop; - case '>': - errPrematureEndOfComment(); - /* Emit the comment token. */ - emitComment(1, pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - break stateloop; - case '\n': - appendStrBufLineFeed(); - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Append a U+002D HYPHEN-MINUS character (-) and - * the current input character to the comment - * token's data. - */ - appendStrBuf(c); - /* - * Switch to the comment state. - */ - state = transition(state, Tokenizer.COMMENT, reconsume, pos); - continue stateloop; - } - // XXX reorder point - case CDATA_START: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - if (index < 6) { // CDATA_LSQB.length - if (c == Tokenizer.CDATA_LSQB[index]) { - appendStrBuf(c); - } else { - errBogusComment(); - reconsume = true; - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - } - index++; - continue; - } else { - clearStrBufAfterUse(); - cstart = pos; // start coalescing - reconsume = true; - state = transition(state, Tokenizer.CDATA_SECTION, reconsume, pos); - break; // FALL THROUGH continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case CDATA_SECTION: - cdatasectionloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - switch (c) { - case ']': - flushChars(buf, pos); - state = transition(state, Tokenizer.CDATA_RSQB, reconsume, pos); - break cdatasectionloop; // FALL THROUGH - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - default: - continue; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case CDATA_RSQB: - cdatarsqb: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case ']': - state = transition(state, Tokenizer.CDATA_RSQB_RSQB, reconsume, pos); - break cdatarsqb; - default: - tokenHandler.characters(Tokenizer.RSQB_RSQB, 0, - 1); - cstart = pos; - reconsume = true; - state = transition(state, Tokenizer.CDATA_SECTION, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case CDATA_RSQB_RSQB: - cdatarsqbrsqb: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case ']': - // Saw a third ]. Emit one ] (logically the - // first one) and stay in this state to - // remember that the last two characters seen - // have been ]]. - tokenHandler.characters(Tokenizer.RSQB_RSQB, 0, 1); - continue; - case '>': - cstart = pos + 1; - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - tokenHandler.characters(Tokenizer.RSQB_RSQB, 0, 2); - cstart = pos; - reconsume = true; - state = transition(state, Tokenizer.CDATA_SECTION, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case ATTRIBUTE_VALUE_SINGLE_QUOTED: - attributevaluesinglequotedloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '\'': - /* - * U+0027 APOSTROPHE (') Switch to the after - * attribute value (quoted) state. - */ - addAttributeWithValue(); - - state = transition(state, Tokenizer.AFTER_ATTRIBUTE_VALUE_QUOTED, reconsume, pos); - continue stateloop; - case '&': - /* - * U+0026 AMPERSAND (&) Switch to the character - * reference in attribute value state, with the - * + additional allowed character being U+0027 - * APOSTROPHE ('). - */ - assert charRefBufLen == 0: "charRefBufLen not reset after previous use!"; - appendCharRefBuf(c); - setAdditionalAndRememberAmpersandLocation('\''); - returnState = state; - state = transition(state, Tokenizer.CONSUME_CHARACTER_REFERENCE, reconsume, pos); - break attributevaluesinglequotedloop; - // continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the current input - * character to the current attribute's value. - */ - appendStrBuf(c); - /* - * Stay in the attribute value (double-quoted) - * state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case CONSUME_CHARACTER_REFERENCE: - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - if (c == '\u0000') { - break stateloop; - } - /* - * Unlike the definition is the spec, this state does not - * return a value and never requires the caller to - * backtrack. This state takes care of emitting characters - * or appending to the current attribute value. It also - * takes care of that in the case when consuming the - * character reference fails. - */ - /* - * This section defines how to consume a character - * reference. This definition is used when parsing character - * references in text and in attributes. - * - * The behavior depends on the identity of the next - * character (the one immediately after the U+0026 AMPERSAND - * character): - */ - switch (c) { - case ' ': - case '\t': - case '\n': - case '\r': // we'll reconsume! - case '\u000C': - case '<': - case '&': - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - case '#': - /* - * U+0023 NUMBER SIGN (#) Consume the U+0023 NUMBER - * SIGN. - */ - appendCharRefBuf('#'); - state = transition(state, Tokenizer.CONSUME_NCR, reconsume, pos); - continue stateloop; - default: - if (c == additional) { - emitOrAppendCharRefBuf(returnState); - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - if (c >= 'a' && c <= 'z') { - firstCharKey = c - 'a' + 26; - } else if (c >= 'A' && c <= 'Z') { - firstCharKey = c - 'A'; - } else { - // No match - /* - * If no match can be made, then this is a parse - * error. - */ - errNoNamedCharacterMatch(); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - // Didn't fail yet - appendCharRefBuf(c); - state = transition(state, Tokenizer.CHARACTER_REFERENCE_HILO_LOOKUP, reconsume, pos); - // FALL THROUGH continue stateloop; - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case CHARACTER_REFERENCE_HILO_LOOKUP: - { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - if (c == '\u0000') { - break stateloop; - } - /* - * The data structure is as follows: - * - * HILO_ACCEL is a two-dimensional int array whose major - * index corresponds to the second character of the - * character reference (code point as index) and the - * minor index corresponds to the first character of the - * character reference (packed so that A-Z runs from 0 - * to 25 and a-z runs from 26 to 51). This layout makes - * it easier to use the sparseness of the data structure - * to omit parts of it: The second dimension of the - * table is null when no character reference starts with - * the character corresponding to that row. - * - * The int value HILO_ACCEL (by these indeces) is zero - * if there exists no character reference starting with - * that two-letter prefix. Otherwise, the value is an - * int that packs two shorts so that the higher short is - * the index of the highest character reference name - * with that prefix in NAMES and the lower short - * corresponds to the index of the lowest character - * reference name with that prefix. (It happens that the - * first two character reference names share their - * prefix so the packed int cannot be 0 by packing the - * two shorts.) - * - * NAMES is an array of byte arrays where each byte - * array encodes the name of a character references as - * ASCII. The names omit the first two letters of the - * name. (Since storing the first two letters would be - * redundant with the data contained in HILO_ACCEL.) The - * entries are lexically sorted. - * - * For a given index in NAMES, the same index in VALUES - * contains the corresponding expansion as an array of - * two UTF-16 code units (either the character and - * U+0000 or a suggogate pair). - */ - int hilo = 0; - if (c <= 'z') { - @Const @NoLength int[] row = NamedCharactersAccel.HILO_ACCEL[c]; - if (row != null) { - hilo = row[firstCharKey]; - } - } - if (hilo == 0) { - /* - * If no match can be made, then this is a parse - * error. - */ - errNoNamedCharacterMatch(); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - // Didn't fail yet - appendCharRefBuf(c); - lo = hilo & 0xFFFF; - hi = hilo >> 16; - entCol = -1; - candidate = -1; - charRefBufMark = 0; - state = transition(state, Tokenizer.CHARACTER_REFERENCE_TAIL, reconsume, pos); - // FALL THROUGH continue stateloop; - } - case CHARACTER_REFERENCE_TAIL: - outer: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - if (c == '\u0000') { - break stateloop; - } - entCol++; - /* - * Consume the maximum number of characters possible, - * with the consumed characters matching one of the - * identifiers in the first column of the named - * character references table (in a case-sensitive - * manner). - */ - loloop: for (;;) { - if (hi < lo) { - break outer; - } - if (entCol == NamedCharacters.NAMES[lo].length()) { - candidate = lo; - charRefBufMark = charRefBufLen; - lo++; - } else if (entCol > NamedCharacters.NAMES[lo].length()) { - break outer; - } else if (c > NamedCharacters.NAMES[lo].charAt(entCol)) { - lo++; - } else { - break loloop; - } - } - - hiloop: for (;;) { - if (hi < lo) { - break outer; - } - if (entCol == NamedCharacters.NAMES[hi].length()) { - break hiloop; - } - if (entCol > NamedCharacters.NAMES[hi].length()) { - break outer; - } else if (c < NamedCharacters.NAMES[hi].charAt(entCol)) { - hi--; - } else { - break hiloop; - } - } - - if (c == ';') { - // If we see a semicolon, there cannot be a - // longer match. Break the loop. However, before - // breaking, take the longest match so far as the - // candidate, if we are just about to complete a - // match. - if (entCol + 1 == NamedCharacters.NAMES[lo].length()) { - candidate = lo; - charRefBufMark = charRefBufLen; - } - break outer; - } - - if (hi < lo) { - break outer; - } - appendCharRefBuf(c); - continue; - } - - if (candidate == -1) { - // reconsume deals with CR, LF or nul - /* - * If no match can be made, then this is a parse error. - */ - errNoNamedCharacterMatch(); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } else { - // c can't be CR, LF or nul if we got here - @Const @CharacterName String candidateName = NamedCharacters.NAMES[candidate]; - if (candidateName.length() == 0 - || candidateName.charAt(candidateName.length() - 1) != ';') { - /* - * If the last character matched is not a U+003B - * SEMICOLON (;), there is a parse error. - */ - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - /* - * If the entity is being consumed as part of an - * attribute, and the last character matched is - * not a U+003B SEMICOLON (;), - */ - char ch; - if (charRefBufMark == charRefBufLen) { - ch = c; - } else { - ch = charRefBuf[charRefBufMark]; - } - if (ch == '=' || (ch >= '0' && ch <= '9') - || (ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z')) { - /* - * and the next character is either a U+003D - * EQUALS SIGN character (=) or in the range - * U+0030 DIGIT ZERO to U+0039 DIGIT NINE, - * U+0041 LATIN CAPITAL LETTER A to U+005A - * LATIN CAPITAL LETTER Z, or U+0061 LATIN - * SMALL LETTER A to U+007A LATIN SMALL - * LETTER Z, then, for historical reasons, - * all the characters that were matched - * after the U+0026 AMPERSAND (&) must be - * unconsumed, and nothing is returned. - */ - errNoNamedCharacterMatch(); - appendCharRefBufToStrBuf(); - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - } - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - errUnescapedAmpersandInterpretedAsCharacterReference(); - } else { - errNotSemicolonTerminated(); - } - } - - /* - * Otherwise, return a character token for the character - * corresponding to the entity name (as given by the - * second column of the named character references - * table). - */ - // CPPONLY: completedNamedCharacterReference(); - @Const @NoLength char[] val = NamedCharacters.VALUES[candidate]; - if ( - // [NOCPP[ - val.length == 1 - // ]NOCPP] - // CPPONLY: val[1] == 0 - ) { - emitOrAppendOne(val, returnState); - } else { - emitOrAppendTwo(val, returnState); - } - // this is so complicated! - if (charRefBufMark < charRefBufLen) { - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - appendStrBuf(charRefBuf, charRefBufMark, - charRefBufLen - charRefBufMark); - } else { - tokenHandler.characters(charRefBuf, charRefBufMark, - charRefBufLen - charRefBufMark); - } - } - // charRefBufLen will be zeroed below! - - // Check if we broke out early with c being the last - // character that matched as opposed to being the - // first one that didn't match. In the case of an - // early break, the next run on text should start - // *after* the current character and the current - // character shouldn't be reconsumed. - boolean earlyBreak = (c == ';' && charRefBufMark == charRefBufLen); - charRefBufLen = 0; - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = earlyBreak ? pos + 1 : pos; - } - reconsume = !earlyBreak; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - /* - * If the markup contains I'm ¬it; I tell you, the - * entity is parsed as "not", as in, I'm ¬it; I tell - * you. But if the markup was I'm ∉ I tell you, - * the entity would be parsed as "notin;", resulting in - * I'm ∉ I tell you. - */ - } - // XXX reorder point - case CONSUME_NCR: - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - value = 0; - seenDigits = false; - /* - * The behavior further depends on the character after the - * U+0023 NUMBER SIGN: - */ - switch (c) { - case 'x': - case 'X': - - /* - * U+0078 LATIN SMALL LETTER X U+0058 LATIN CAPITAL - * LETTER X Consume the X. - * - * Follow the steps below, but using the range of - * characters U+0030 DIGIT ZERO through to U+0039 - * DIGIT NINE, U+0061 LATIN SMALL LETTER A through - * to U+0066 LATIN SMALL LETTER F, and U+0041 LATIN - * CAPITAL LETTER A, through to U+0046 LATIN CAPITAL - * LETTER F (in other words, 0-9, A-F, a-f). - * - * When it comes to interpreting the number, - * interpret it as a hexadecimal number. - */ - appendCharRefBuf(c); - state = transition(state, Tokenizer.HEX_NCR_LOOP, reconsume, pos); - continue stateloop; - default: - /* - * Anything else Follow the steps below, but using - * the range of characters U+0030 DIGIT ZERO through - * to U+0039 DIGIT NINE (i.e. just 0-9). - * - * When it comes to interpreting the number, - * interpret it as a decimal number. - */ - reconsume = true; - state = transition(state, Tokenizer.DECIMAL_NRC_LOOP, reconsume, pos); - // FALL THROUGH continue stateloop; - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case DECIMAL_NRC_LOOP: - decimalloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume as many characters as match the range of - * characters given above. - */ - assert value >= 0: "value must not become negative."; - if (c >= '0' && c <= '9') { - seenDigits = true; - // Avoid overflow - if (value <= 0x10FFFF) { - value *= 10; - value += c - '0'; - } - continue; - } else if (c == ';') { - if (seenDigits) { - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos + 1; - } - state = transition(state, Tokenizer.HANDLE_NCR_VALUE, reconsume, pos); - // FALL THROUGH continue stateloop; - break decimalloop; - } else { - errNoDigitsInNCR(); - appendCharRefBuf(';'); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos + 1; - } - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - } else { - /* - * If no characters match the range, then don't - * consume any characters (and unconsume the U+0023 - * NUMBER SIGN character and, if appropriate, the X - * character). This is a parse error; nothing is - * returned. - * - * Otherwise, if the next character is a U+003B - * SEMICOLON, consume that too. If it isn't, there - * is a parse error. - */ - if (!seenDigits) { - errNoDigitsInNCR(); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } else { - errCharRefLacksSemicolon(); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, Tokenizer.HANDLE_NCR_VALUE, reconsume, pos); - // FALL THROUGH continue stateloop; - break decimalloop; - } - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case HANDLE_NCR_VALUE: - // WARNING previous state sets reconsume - // We are not going to emit the contents of charRefBuf. - charRefBufLen = 0; - // XXX inline this case if the method size can take it - handleNcrValue(returnState); - state = transition(state, returnState, reconsume, pos); - continue stateloop; - // XXX reorder point - case HEX_NCR_LOOP: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume as many characters as match the range of - * characters given above. - */ - assert value >= 0: "value must not become negative."; - if (c >= '0' && c <= '9') { - seenDigits = true; - // Avoid overflow - if (value <= 0x10FFFF) { - value *= 16; - value += c - '0'; - } - continue; - } else if (c >= 'A' && c <= 'F') { - seenDigits = true; - // Avoid overflow - if (value <= 0x10FFFF) { - value *= 16; - value += c - 'A' + 10; - } - continue; - } else if (c >= 'a' && c <= 'f') { - seenDigits = true; - // Avoid overflow - if (value <= 0x10FFFF) { - value *= 16; - value += c - 'a' + 10; - } - continue; - } else if (c == ';') { - if (seenDigits) { - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos + 1; - } - state = transition(state, Tokenizer.HANDLE_NCR_VALUE, reconsume, pos); - continue stateloop; - } else { - errNoDigitsInNCR(); - appendCharRefBuf(';'); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos + 1; - } - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - } else { - /* - * If no characters match the range, then don't - * consume any characters (and unconsume the U+0023 - * NUMBER SIGN character and, if appropriate, the X - * character). This is a parse error; nothing is - * returned. - * - * Otherwise, if the next character is a U+003B - * SEMICOLON, consume that too. If it isn't, there - * is a parse error. - */ - if (!seenDigits) { - errNoDigitsInNCR(); - emitOrAppendCharRefBuf(returnState); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } else { - errCharRefLacksSemicolon(); - if ((returnState & DATA_AND_RCDATA_MASK) == 0) { - cstart = pos; - } - reconsume = true; - state = transition(state, Tokenizer.HANDLE_NCR_VALUE, reconsume, pos); - continue stateloop; - } - } - } - // XXX reorder point - case PLAINTEXT: - plaintextloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - switch (c) { - case '\u0000': - emitPlaintextReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Stay in the - * RAWTEXT state. - */ - continue; - } - } - // XXX reorder point - case CLOSE_TAG_OPEN: - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Otherwise, if the content model flag is set to the PCDATA - * state, or if the next few characters do match that tag - * name, consume the next input character: - */ - switch (c) { - case '>': - /* U+003E GREATER-THAN SIGN (>) Parse error. */ - errLtSlashGt(); - /* - * Switch to the data state. - */ - cstart = pos + 1; - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - silentCarriageReturn(); - /* Anything else Parse error. */ - errGarbageAfterLtSlash(); - /* - * Switch to the bogus comment state. - */ - clearStrBufBeforeUse(); - appendStrBuf('\n'); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - /* Anything else Parse error. */ - errGarbageAfterLtSlash(); - /* - * Switch to the bogus comment state. - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - if (c >= 'A' && c <= 'Z') { - c += 0x20; - } - if (c >= 'a' && c <= 'z') { - /* - * U+0061 LATIN SMALL LETTER A through to U+007A - * LATIN SMALL LETTER Z Create a new end tag - * token, - */ - endTag = true; - /* - * set its tag name to the input character, - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - /* - * then switch to the tag name state. (Don't - * emit the token yet; further details will be - * filled in before it is emitted.) - */ - state = transition(state, Tokenizer.TAG_NAME, reconsume, pos); - continue stateloop; - } else { - /* Anything else Parse error. */ - errGarbageAfterLtSlash(); - /* - * Switch to the bogus comment state. - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case RCDATA: - rcdataloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - switch (c) { - case '&': - /* - * U+0026 AMPERSAND (&) Switch to the character - * reference in RCDATA state. - */ - flushChars(buf, pos); - assert charRefBufLen == 0: "charRefBufLen not reset after previous use!"; - appendCharRefBuf(c); - setAdditionalAndRememberAmpersandLocation('\u0000'); - returnState = state; - state = transition(state, Tokenizer.CONSUME_CHARACTER_REFERENCE, reconsume, pos); - continue stateloop; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the - * RCDATA less-than sign state. - */ - flushChars(buf, pos); - - returnState = state; - state = transition(state, Tokenizer.RAWTEXT_RCDATA_LESS_THAN_SIGN, reconsume, pos); - continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Emit the current input character as a - * character token. Stay in the RCDATA state. - */ - continue; - } - } - // XXX reorder point - case RAWTEXT: - rawtextloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - switch (c) { - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the - * RAWTEXT less-than sign state. - */ - flushChars(buf, pos); - - returnState = state; - state = transition(state, Tokenizer.RAWTEXT_RCDATA_LESS_THAN_SIGN, reconsume, pos); - break rawtextloop; - // FALL THRU continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Emit the current input character as a - * character token. Stay in the RAWTEXT state. - */ - continue; - } - } - // XXX fallthru don't reorder - case RAWTEXT_RCDATA_LESS_THAN_SIGN: - rawtextrcdatalessthansignloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case '/': - /* - * U+002F SOLIDUS (/) Set the temporary buffer - * to the empty string. Switch to the script - * data end tag open state. - */ - index = 0; - clearStrBufBeforeUse(); - state = transition(state, Tokenizer.NON_DATA_END_TAG_NAME, reconsume, pos); - break rawtextrcdatalessthansignloop; - // FALL THRU continue stateloop; - default: - /* - * Otherwise, emit a U+003C LESS-THAN SIGN - * character token - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - /* - * and reconsume the current input character in - * the data state. - */ - cstart = pos; - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - } - // XXX fall thru. don't reorder. - case NON_DATA_END_TAG_NAME: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * ASSERT! when entering this state, set index to 0 and - * call clearStrBufBeforeUse() assert (contentModelElement != - * null); Let's implement the above without lookahead. - * strBuf is the 'temporary buffer'. - */ - if (index < endTagExpectationAsArray.length) { - char e = endTagExpectationAsArray[index]; - char folded = c; - if (c >= 'A' && c <= 'Z') { - folded += 0x20; - } - if (folded != e) { - // [NOCPP[ - errHtml4LtSlashInRcdata(folded); - // ]NOCPP] - tokenHandler.characters(Tokenizer.LT_SOLIDUS, - 0, 2); - emitStrBuf(); - cstart = pos; - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - appendStrBuf(c); - index++; - continue; - } else { - endTag = true; - // XXX replace contentModelElement with different - // type - tagName = endTagExpectation; - switch (c) { - case '\r': - silentCarriageReturn(); - clearStrBufAfterUse(); // strBuf not used - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE - * FEED (LF) U+000C FORM FEED (FF) U+0020 - * SPACE If the current end tag token is an - * appropriate end tag token, then switch to - * the before attribute name state. - */ - clearStrBufAfterUse(); // strBuf not used - state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos); - continue stateloop; - case '/': - /* - * U+002F SOLIDUS (/) If the current end tag - * token is an appropriate end tag token, - * then switch to the self-closing start tag - * state. - */ - clearStrBufAfterUse(); // strBuf not used - state = transition(state, Tokenizer.SELF_CLOSING_START_TAG, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) If the - * current end tag token is an appropriate - * end tag token, then emit the current tag - * token and switch to the data state. - */ - clearStrBufAfterUse(); // strBuf not used - state = transition(state, emitCurrentTagToken(false, pos), reconsume, pos); - if (shouldSuspend) { - break stateloop; - } - continue stateloop; - default: - /* - * Emit a U+003C LESS-THAN SIGN character - * token, a U+002F SOLIDUS character token, - * a character token for each of the - * characters in the temporary buffer (in - * the order they were added to the buffer), - * and reconsume the current input character - * in the RAWTEXT state. - */ - // [NOCPP[ - errWarnLtSlashInRcdata(); - // ]NOCPP] - tokenHandler.characters( - Tokenizer.LT_SOLIDUS, 0, 2); - emitStrBuf(); - cstart = pos; // don't drop the - // character - reconsume = true; - state = transition(state, returnState, reconsume, pos); - continue stateloop; - } - } - } - // XXX reorder point - // BEGIN HOTSPOT WORKAROUND - case BOGUS_COMMENT: - boguscommentloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume every character up to and including the first - * U+003E GREATER-THAN SIGN character (>) or the end of - * the file (EOF), whichever comes first. Emit a comment - * token whose data is the concatenation of all the - * characters starting from and including the character - * that caused the state machine to switch into the - * bogus comment state, up to and including the - * character immediately before the last consumed - * character (i.e. up to the character just before the - * U+003E or EOF character). (If the comment was started - * by the end of the file (EOF), the token is empty.) - * - * Switch to the data state. - * - * If the end of the file was reached, reconsume the EOF - * character. - */ - switch (c) { - case '>': - emitComment(0, pos); - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '-': - appendStrBuf(c); - state = transition(state, Tokenizer.BOGUS_COMMENT_HYPHEN, reconsume, pos); - break boguscommentloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - appendStrBuf(c); - continue; - } - } - // FALLTHRU DON'T REORDER - case BOGUS_COMMENT_HYPHEN: - boguscommenthyphenloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case '>': - // [NOCPP[ - maybeAppendSpaceToBogusComment(); - // ]NOCPP] - emitComment(0, pos); - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '-': - appendSecondHyphenToBogusComment(); - continue boguscommenthyphenloop; - case '\r': - appendStrBufCarriageReturn(); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - break stateloop; - case '\n': - appendStrBufLineFeed(); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - appendStrBuf(c); - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case SCRIPT_DATA: - scriptdataloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - switch (c) { - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the - * script data less-than sign state. - */ - flushChars(buf, pos); - returnState = state; - state = transition(state, Tokenizer.SCRIPT_DATA_LESS_THAN_SIGN, reconsume, pos); - break scriptdataloop; // FALL THRU continue - // stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Stay in the - * script data state. - */ - continue; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_LESS_THAN_SIGN: - scriptdatalessthansignloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case '/': - /* - * U+002F SOLIDUS (/) Set the temporary buffer - * to the empty string. Switch to the script - * data end tag open state. - */ - index = 0; - clearStrBufBeforeUse(); - state = transition(state, Tokenizer.NON_DATA_END_TAG_NAME, reconsume, pos); - continue stateloop; - case '!': - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - cstart = pos; - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPE_START, reconsume, pos); - break scriptdatalessthansignloop; // FALL THRU - // continue - // stateloop; - default: - /* - * Otherwise, emit a U+003C LESS-THAN SIGN - * character token - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - /* - * and reconsume the current input character in - * the data state. - */ - cstart = pos; - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_ESCAPE_START: - scriptdataescapestartloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Switch to the - * script data escape start dash state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPE_START_DASH, reconsume, pos); - break scriptdataescapestartloop; // FALL THRU - // continue - // stateloop; - default: - /* - * Anything else Reconsume the current input - * character in the script data state. - */ - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_ESCAPE_START_DASH: - scriptdataescapestartdashloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Switch to the - * script data escaped dash dash state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED_DASH_DASH, reconsume, pos); - break scriptdataescapestartdashloop; - // continue stateloop; - default: - /* - * Anything else Reconsume the current input - * character in the script data state. - */ - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_ESCAPED_DASH_DASH: - scriptdataescapeddashdashloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Stay in the - * script data escaped dash dash state. - */ - continue; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the - * script data escaped less-than sign state. - */ - flushChars(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit a U+003E - * GREATER-THAN SIGN character token. Switch to - * the script data state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos); - continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - break scriptdataescapeddashdashloop; - case '\r': - emitCarriageReturn(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Switch to the - * script data escaped state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - break scriptdataescapeddashdashloop; - // continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_ESCAPED: - scriptdataescapedloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Switch to the - * script data escaped dash state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED_DASH, reconsume, pos); - break scriptdataescapedloop; // FALL THRU - // continue - // stateloop; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the - * script data escaped less-than sign state. - */ - flushChars(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN, reconsume, pos); - continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Stay in the - * script data escaped state. - */ - continue; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_ESCAPED_DASH: - scriptdataescapeddashloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Switch to the - * script data escaped dash dash state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED_DASH_DASH, reconsume, pos); - continue stateloop; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Switch to the - * script data escaped less-than sign state. - */ - flushChars(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN, reconsume, pos); - break scriptdataescapeddashloop; - // continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - continue stateloop; - case '\r': - emitCarriageReturn(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Switch to the - * script data escaped state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: - scriptdataescapedlessthanloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '/': - /* - * U+002F SOLIDUS (/) Set the temporary buffer - * to the empty string. Switch to the script - * data escaped end tag open state. - */ - index = 0; - clearStrBufBeforeUse(); - returnState = Tokenizer.SCRIPT_DATA_ESCAPED; - state = transition(state, Tokenizer.NON_DATA_END_TAG_NAME, reconsume, pos); - continue stateloop; - case 'S': - case 's': - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Emit a U+003C - * LESS-THAN SIGN character token and the - * current input character as a character token. - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - cstart = pos; - index = 1; - /* - * Set the temporary buffer to the empty string. - * Append the lowercase version of the current - * input character (add 0x0020 to the - * character's code point) to the temporary - * buffer. Switch to the script data double - * escape start state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPE_START, reconsume, pos); - break scriptdataescapedlessthanloop; - // continue stateloop; - default: - /* - * Anything else Emit a U+003C LESS-THAN SIGN - * character token and reconsume the current - * input character in the script data escaped - * state. - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - cstart = pos; - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_DOUBLE_ESCAPE_START: - scriptdatadoubleescapestartloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - assert index > 0; - if (index < 6) { // SCRIPT_ARR.length - char folded = c; - if (c >= 'A' && c <= 'Z') { - folded += 0x20; - } - if (folded != Tokenizer.SCRIPT_ARR[index]) { - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - continue stateloop; - } - index++; - continue; - } - switch (c) { - case '\r': - emitCarriageReturn(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - case ' ': - case '\t': - case '\u000C': - case '/': - case '>': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * U+002F SOLIDUS (/) U+003E GREATER-THAN SIGN - * (>) Emit the current input character as a - * character token. If the temporary buffer is - * the string "script", then switch to the - * script data double escaped state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - break scriptdatadoubleescapestartloop; - // continue stateloop; - default: - /* - * Anything else Reconsume the current input - * character in the script data escaped state. - */ - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_DOUBLE_ESCAPED: - scriptdatadoubleescapedloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Switch to the - * script data double escaped dash state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, reconsume, pos); - break scriptdatadoubleescapedloop; // FALL THRU - // continue - // stateloop; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Emit a U+003C - * LESS-THAN SIGN character token. Switch to the - * script data double escaped less-than sign - * state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, reconsume, pos); - continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - continue; - case '\r': - emitCarriageReturn(buf, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Stay in the - * script data double escaped state. - */ - continue; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_DOUBLE_ESCAPED_DASH: - scriptdatadoubleescapeddashloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Switch to the - * script data double escaped dash dash state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, reconsume, pos); - break scriptdatadoubleescapeddashloop; - // continue stateloop; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Emit a U+003C - * LESS-THAN SIGN character token. Switch to the - * script data double escaped less-than sign - * state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, reconsume, pos); - continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - case '\r': - emitCarriageReturn(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Switch to the - * script data double escaped state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: - scriptdatadoubleescapeddashdashloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '-': - /* - * U+002D HYPHEN-MINUS (-) Emit a U+002D - * HYPHEN-MINUS character token. Stay in the - * script data double escaped dash dash state. - */ - continue; - case '<': - /* - * U+003C LESS-THAN SIGN (<) Emit a U+003C - * LESS-THAN SIGN character token. Switch to the - * script data double escaped less-than sign - * state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, reconsume, pos); - break scriptdatadoubleescapeddashdashloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit a U+003E - * GREATER-THAN SIGN character token. Switch to - * the script data state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos); - continue stateloop; - case '\u0000': - emitReplacementCharacter(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - case '\r': - emitCarriageReturn(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - default: - /* - * Anything else Emit the current input - * character as a character token. Switch to the - * script data double escaped state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: - scriptdatadoubleescapedlessthanloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '/': - /* - * U+002F SOLIDUS (/) Emit a U+002F SOLIDUS - * character token. Set the temporary buffer to - * the empty string. Switch to the script data - * double escape end state. - */ - index = 0; - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPE_END, reconsume, pos); - break scriptdatadoubleescapedlessthanloop; - default: - /* - * Anything else Reconsume the current input - * character in the script data double escaped - * state. - */ - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER - case SCRIPT_DATA_DOUBLE_ESCAPE_END: - scriptdatadoubleescapeendloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - if (index < 6) { // SCRIPT_ARR.length - char folded = c; - if (c >= 'A' && c <= 'Z') { - folded += 0x20; - } - if (folded != Tokenizer.SCRIPT_ARR[index]) { - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - } - index++; - continue; - } - switch (c) { - case '\r': - emitCarriageReturn(buf, pos); - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - case ' ': - case '\t': - case '\u000C': - case '/': - case '>': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * U+002F SOLIDUS (/) U+003E GREATER-THAN SIGN - * (>) Emit the current input character as a - * character token. If the temporary buffer is - * the string "script", then switch to the - * script data escaped state. - */ - state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos); - continue stateloop; - default: - /* - * Reconsume the current input character in the - * script data double escaped state. - */ - reconsume = true; - state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos); - continue stateloop; - } - } - // XXX reorder point - case MARKUP_DECLARATION_OCTYPE: - markupdeclarationdoctypeloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - if (index < 6) { // OCTYPE.length - char folded = c; - if (c >= 'A' && c <= 'Z') { - folded += 0x20; - } - if (folded == Tokenizer.OCTYPE[index]) { - appendStrBuf(c); - } else { - errBogusComment(); - reconsume = true; - state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos); - continue stateloop; - } - index++; - continue; - } else { - reconsume = true; - state = transition(state, Tokenizer.DOCTYPE, reconsume, pos); - break markupdeclarationdoctypeloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case DOCTYPE: - doctypeloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - initDoctypeFields(); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - state = transition(state, Tokenizer.BEFORE_DOCTYPE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the before DOCTYPE name state. - */ - state = transition(state, Tokenizer.BEFORE_DOCTYPE_NAME, reconsume, pos); - break doctypeloop; - // continue stateloop; - default: - /* - * Anything else Parse error. - */ - errMissingSpaceBeforeDoctypeName(); - /* - * Reconsume the current character in the before - * DOCTYPE name state. - */ - reconsume = true; - state = transition(state, Tokenizer.BEFORE_DOCTYPE_NAME, reconsume, pos); - break doctypeloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_DOCTYPE_NAME: - beforedoctypenameloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the before DOCTYPE name state. - */ - continue; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Parse error. - */ - errNamelessDoctype(); - /* - * Create a new DOCTYPE token. Set its - * force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit the token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - if (c >= 'A' && c <= 'Z') { - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Create a - * new DOCTYPE token. Set the token's name - * to the lowercase version of the input - * character (add 0x0020 to the character's - * code point). - */ - c += 0x20; - } - /* Anything else Create a new DOCTYPE token. */ - /* - * Set the token's name name to the current - * input character. - */ - clearStrBufBeforeUse(); - appendStrBuf(c); - /* - * Switch to the DOCTYPE name state. - */ - state = transition(state, Tokenizer.DOCTYPE_NAME, reconsume, pos); - break beforedoctypenameloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case DOCTYPE_NAME: - doctypenameloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - strBufToDoctypeName(); - state = transition(state, Tokenizer.AFTER_DOCTYPE_NAME, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the after DOCTYPE name state. - */ - strBufToDoctypeName(); - state = transition(state, Tokenizer.AFTER_DOCTYPE_NAME, reconsume, pos); - break doctypenameloop; - // continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * DOCTYPE token. - */ - strBufToDoctypeName(); - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * U+0041 LATIN CAPITAL LETTER A through to - * U+005A LATIN CAPITAL LETTER Z Append the - * lowercase version of the input character (add - * 0x0020 to the character's code point) to the - * current DOCTYPE token's name. - */ - if (c >= 'A' && c <= 'Z') { - c += 0x0020; - } - /* - * Anything else Append the current input - * character to the current DOCTYPE token's - * name. - */ - appendStrBuf(c); - /* - * Stay in the DOCTYPE name state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case AFTER_DOCTYPE_NAME: - afterdoctypenameloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the after DOCTYPE name state. - */ - continue; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case 'p': - case 'P': - index = 0; - state = transition(state, Tokenizer.DOCTYPE_UBLIC, reconsume, pos); - break afterdoctypenameloop; - // continue stateloop; - case 's': - case 'S': - index = 0; - state = transition(state, Tokenizer.DOCTYPE_YSTEM, reconsume, pos); - continue stateloop; - default: - /* - * Otherwise, this is the parse error. - */ - bogusDoctype(); - - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case DOCTYPE_UBLIC: - doctypeublicloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * If the six characters starting from the current input - * character are an ASCII case-insensitive match for the - * word "PUBLIC", then consume those characters and - * switch to the before DOCTYPE public identifier state. - */ - if (index < 5) { // UBLIC.length - char folded = c; - if (c >= 'A' && c <= 'Z') { - folded += 0x20; - } - if (folded != Tokenizer.UBLIC[index]) { - bogusDoctype(); - // forceQuirks = true; - reconsume = true; - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - index++; - continue; - } else { - reconsume = true; - state = transition(state, Tokenizer.AFTER_DOCTYPE_PUBLIC_KEYWORD, reconsume, pos); - break doctypeublicloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case AFTER_DOCTYPE_PUBLIC_KEYWORD: - afterdoctypepublickeywordloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - state = transition(state, Tokenizer.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the before DOCTYPE public - * identifier state. - */ - state = transition(state, Tokenizer.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER, reconsume, pos); - break afterdoctypepublickeywordloop; - // FALL THROUGH continue stateloop - case '"': - /* - * U+0022 QUOTATION MARK (") Parse Error. - */ - errNoSpaceBetweenDoctypePublicKeywordAndQuote(); - /* - * Set the DOCTYPE token's public identifier to - * the empty string (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE public identifier - * (double-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED, reconsume, pos); - continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Parse Error. - */ - errNoSpaceBetweenDoctypePublicKeywordAndQuote(); - /* - * Set the DOCTYPE token's public identifier to - * the empty string (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE public identifier - * (single-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED, reconsume, pos); - continue stateloop; - case '>': - /* U+003E GREATER-THAN SIGN (>) Parse error. */ - errExpectedPublicId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - bogusDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: - beforedoctypepublicidentifierloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the before DOCTYPE public identifier - * state. - */ - continue; - case '"': - /* - * U+0022 QUOTATION MARK (") Set the DOCTYPE - * token's public identifier to the empty string - * (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE public identifier - * (double-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED, reconsume, pos); - break beforedoctypepublicidentifierloop; - // continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Set the DOCTYPE token's - * public identifier to the empty string (not - * missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE public identifier - * (single-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED, reconsume, pos); - continue stateloop; - case '>': - /* U+003E GREATER-THAN SIGN (>) Parse error. */ - errExpectedPublicId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - bogusDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: - doctypepublicidentifierdoublequotedloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '"': - /* - * U+0022 QUOTATION MARK (") Switch to the after - * DOCTYPE public identifier state. - */ - publicIdentifier = strBufToString(); - state = transition(state, Tokenizer.AFTER_DOCTYPE_PUBLIC_IDENTIFIER, reconsume, pos); - break doctypepublicidentifierdoublequotedloop; - // continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Parse error. - */ - errGtInPublicId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - publicIdentifier = strBufToString(); - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the current input - * character to the current DOCTYPE token's - * public identifier. - */ - appendStrBuf(c); - /* - * Stay in the DOCTYPE public identifier - * (double-quoted) state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case AFTER_DOCTYPE_PUBLIC_IDENTIFIER: - afterdoctypepublicidentifierloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - state = transition(state, Tokenizer.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the between DOCTYPE public and - * system identifiers state. - */ - state = transition(state, Tokenizer.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS, reconsume, pos); - break afterdoctypepublicidentifierloop; - // continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '"': - /* - * U+0022 QUOTATION MARK (") Parse error. - */ - errNoSpaceBetweenPublicAndSystemIds(); - /* - * Set the DOCTYPE token's system identifier to - * the empty string (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE system identifier - * (double-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED, reconsume, pos); - continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Parse error. - */ - errNoSpaceBetweenPublicAndSystemIds(); - /* - * Set the DOCTYPE token's system identifier to - * the empty string (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE system identifier - * (single-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED, reconsume, pos); - continue stateloop; - default: - bogusDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: - betweendoctypepublicandsystemidentifiersloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the between DOCTYPE public and system - * identifiers state. - */ - continue; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '"': - /* - * U+0022 QUOTATION MARK (") Set the DOCTYPE - * token's system identifier to the empty string - * (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE system identifier - * (double-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED, reconsume, pos); - break betweendoctypepublicandsystemidentifiersloop; - // continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Set the DOCTYPE token's - * system identifier to the empty string (not - * missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE system identifier - * (single-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED, reconsume, pos); - continue stateloop; - default: - bogusDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: - doctypesystemidentifierdoublequotedloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '"': - /* - * U+0022 QUOTATION MARK (") Switch to the after - * DOCTYPE system identifier state. - */ - systemIdentifier = strBufToString(); - state = transition(state, Tokenizer.AFTER_DOCTYPE_SYSTEM_IDENTIFIER, reconsume, pos); - continue stateloop; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Parse error. - */ - errGtInSystemId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - systemIdentifier = strBufToString(); - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the current input - * character to the current DOCTYPE token's - * system identifier. - */ - appendStrBuf(c); - /* - * Stay in the DOCTYPE system identifier - * (double-quoted) state. - */ - continue; - } - } - // FALLTHRU DON'T REORDER - case AFTER_DOCTYPE_SYSTEM_IDENTIFIER: - afterdoctypesystemidentifierloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the after DOCTYPE system identifier state. - */ - continue; - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit the current - * DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - /* - * Switch to the bogus DOCTYPE state. (This does - * not set the DOCTYPE token's force-quirks flag - * to on.) - */ - bogusDoctypeWithoutQuirks(); - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - break afterdoctypesystemidentifierloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case BOGUS_DOCTYPE: - for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '>': - /* - * U+003E GREATER-THAN SIGN (>) Emit that - * DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - default: - /* - * Anything else Stay in the bogus DOCTYPE - * state. - */ - continue; - } - } - // XXX reorder point - case DOCTYPE_YSTEM: - doctypeystemloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Otherwise, if the six characters starting from the - * current input character are an ASCII case-insensitive - * match for the word "SYSTEM", then consume those - * characters and switch to the before DOCTYPE system - * identifier state. - */ - if (index < 5) { // YSTEM.length - char folded = c; - if (c >= 'A' && c <= 'Z') { - folded += 0x20; - } - if (folded != Tokenizer.YSTEM[index]) { - bogusDoctype(); - reconsume = true; - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - index++; - continue stateloop; - } else { - reconsume = true; - state = transition(state, Tokenizer.AFTER_DOCTYPE_SYSTEM_KEYWORD, reconsume, pos); - break doctypeystemloop; - // continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case AFTER_DOCTYPE_SYSTEM_KEYWORD: - afterdoctypesystemkeywordloop: for (;;) { - if (reconsume) { - reconsume = false; - } else { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - } - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - state = transition(state, Tokenizer.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER, reconsume, pos); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE - * Switch to the before DOCTYPE public - * identifier state. - */ - state = transition(state, Tokenizer.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER, reconsume, pos); - break afterdoctypesystemkeywordloop; - // FALL THROUGH continue stateloop - case '"': - /* - * U+0022 QUOTATION MARK (") Parse Error. - */ - errNoSpaceBetweenDoctypeSystemKeywordAndQuote(); - /* - * Set the DOCTYPE token's system identifier to - * the empty string (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE public identifier - * (double-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED, reconsume, pos); - continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Parse Error. - */ - errNoSpaceBetweenDoctypeSystemKeywordAndQuote(); - /* - * Set the DOCTYPE token's public identifier to - * the empty string (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE public identifier - * (single-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED, reconsume, pos); - continue stateloop; - case '>': - /* U+003E GREATER-THAN SIGN (>) Parse error. */ - errExpectedPublicId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - bogusDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: - beforedoctypesystemidentifierloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\r': - silentCarriageReturn(); - break stateloop; - case '\n': - silentLineFeed(); - // fall thru - case ' ': - case '\t': - case '\u000C': - /* - * U+0009 CHARACTER TABULATION U+000A LINE FEED - * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay - * in the before DOCTYPE system identifier - * state. - */ - continue; - case '"': - /* - * U+0022 QUOTATION MARK (") Set the DOCTYPE - * token's system identifier to the empty string - * (not missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE system identifier - * (double-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED, reconsume, pos); - continue stateloop; - case '\'': - /* - * U+0027 APOSTROPHE (') Set the DOCTYPE token's - * system identifier to the empty string (not - * missing), - */ - clearStrBufBeforeUse(); - /* - * then switch to the DOCTYPE system identifier - * (single-quoted) state. - */ - state = transition(state, Tokenizer.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED, reconsume, pos); - break beforedoctypesystemidentifierloop; - // continue stateloop; - case '>': - /* U+003E GREATER-THAN SIGN (>) Parse error. */ - errExpectedSystemId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - default: - bogusDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - // done by bogusDoctype(); - /* - * Switch to the bogus DOCTYPE state. - */ - state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos); - continue stateloop; - } - } - // FALLTHRU DON'T REORDER - case DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\'': - /* - * U+0027 APOSTROPHE (') Switch to the after - * DOCTYPE system identifier state. - */ - systemIdentifier = strBufToString(); - state = transition(state, Tokenizer.AFTER_DOCTYPE_SYSTEM_IDENTIFIER, reconsume, pos); - continue stateloop; - case '>': - errGtInSystemId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - systemIdentifier = strBufToString(); - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the current input - * character to the current DOCTYPE token's - * system identifier. - */ - appendStrBuf(c); - /* - * Stay in the DOCTYPE system identifier - * (double-quoted) state. - */ - continue; - } - } - // XXX reorder point - case DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: - for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - /* - * Consume the next input character: - */ - switch (c) { - case '\'': - /* - * U+0027 APOSTROPHE (') Switch to the after - * DOCTYPE public identifier state. - */ - publicIdentifier = strBufToString(); - state = transition(state, Tokenizer.AFTER_DOCTYPE_PUBLIC_IDENTIFIER, reconsume, pos); - continue stateloop; - case '>': - errGtInPublicId(); - /* - * Set the DOCTYPE token's force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - publicIdentifier = strBufToString(); - emitDoctypeToken(pos); - /* - * Switch to the data state. - */ - state = transition(state, Tokenizer.DATA, reconsume, pos); - continue stateloop; - case '\r': - appendStrBufCarriageReturn(); - break stateloop; - case '\n': - appendStrBufLineFeed(); - continue; - case '\u0000': - c = '\uFFFD'; - // fall thru - default: - /* - * Anything else Append the current input - * character to the current DOCTYPE token's - * public identifier. - */ - appendStrBuf(c); - /* - * Stay in the DOCTYPE public identifier - * (single-quoted) state. - */ - continue; - } - } - // XXX reorder point - case PROCESSING_INSTRUCTION: - processinginstructionloop: for (;;) { - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case '?': - state = transition( - state, - Tokenizer.PROCESSING_INSTRUCTION_QUESTION_MARK, - reconsume, pos); - break processinginstructionloop; - // continue stateloop; - default: - continue; - } - } - case PROCESSING_INSTRUCTION_QUESTION_MARK: - if (++pos == endPos) { - break stateloop; - } - c = checkChar(buf, pos); - switch (c) { - case '>': - state = transition(state, Tokenizer.DATA, - reconsume, pos); - continue stateloop; - default: - state = transition(state, - Tokenizer.PROCESSING_INSTRUCTION, - reconsume, pos); - continue stateloop; - } - // END HOTSPOT WORKAROUND - } - } - flushChars(buf, pos); - /* - * if (prevCR && pos != endPos) { // why is this needed? pos--; col--; } - */ - // Save locals - stateSave = state; - returnStateSave = returnState; - return pos; - } - - // HOTSPOT WORKAROUND INSERTION POINT - - // [NOCPP[ - - protected int transition(int from, int to, boolean reconsume, int pos) throws SAXException { - return to; - } - - // ]NOCPP] - - private void initDoctypeFields() { - // Discard the characters "DOCTYPE" accumulated as a potential bogus - // comment into strBuf. - clearStrBufAfterUse(); - doctypeName = ""; - if (systemIdentifier != null) { - Portability.releaseString(systemIdentifier); - systemIdentifier = null; - } - if (publicIdentifier != null) { - Portability.releaseString(publicIdentifier); - publicIdentifier = null; - } - forceQuirks = false; - } - - @Inline private void adjustDoubleHyphenAndAppendToStrBufCarriageReturn() - throws SAXException { - silentCarriageReturn(); - adjustDoubleHyphenAndAppendToStrBufAndErr('\n'); - } - - @Inline private void adjustDoubleHyphenAndAppendToStrBufLineFeed() - throws SAXException { - silentLineFeed(); - adjustDoubleHyphenAndAppendToStrBufAndErr('\n'); - } - - @Inline private void appendStrBufLineFeed() { - silentLineFeed(); - appendStrBuf('\n'); - } - - @Inline private void appendStrBufCarriageReturn() { - silentCarriageReturn(); - appendStrBuf('\n'); - } - - @Inline protected void silentCarriageReturn() { - ++line; - lastCR = true; - } - - @Inline protected void silentLineFeed() { - ++line; - } - - private void emitCarriageReturn(@NoLength char[] buf, int pos) - throws SAXException { - silentCarriageReturn(); - flushChars(buf, pos); - tokenHandler.characters(Tokenizer.LF, 0, 1); - cstart = Integer.MAX_VALUE; - } - - private void emitReplacementCharacter(@NoLength char[] buf, int pos) - throws SAXException { - flushChars(buf, pos); - tokenHandler.zeroOriginatingReplacementCharacter(); - cstart = pos + 1; - } - - private void emitPlaintextReplacementCharacter(@NoLength char[] buf, int pos) - throws SAXException { - flushChars(buf, pos); - tokenHandler.characters(REPLACEMENT_CHARACTER, 0, 1); - cstart = pos + 1; - } - - private void setAdditionalAndRememberAmpersandLocation(char add) { - additional = add; - // [NOCPP[ - ampersandLocation = new LocatorImpl(this); - // ]NOCPP] - } - - private void bogusDoctype() throws SAXException { - errBogusDoctype(); - forceQuirks = true; - } - - private void bogusDoctypeWithoutQuirks() throws SAXException { - errBogusDoctype(); - forceQuirks = false; - } - - private void handleNcrValue(int returnState) throws SAXException { - /* - * If one or more characters match the range, then take them all and - * interpret the string of characters as a number (either hexadecimal or - * decimal as appropriate). - */ - if (value <= 0xFFFF) { - if (value >= 0x80 && value <= 0x9f) { - /* - * If that number is one of the numbers in the first column of - * the following table, then this is a parse error. - */ - errNcrInC1Range(); - /* - * Find the row with that number in the first column, and return - * a character token for the Unicode character given in the - * second column of that row. - */ - @NoLength char[] val = NamedCharacters.WINDOWS_1252[value - 0x80]; - emitOrAppendOne(val, returnState); - // [NOCPP[ - } else if (value == 0xC - && contentSpacePolicy != XmlViolationPolicy.ALLOW) { - if (contentSpacePolicy == XmlViolationPolicy.ALTER_INFOSET) { - emitOrAppendOne(Tokenizer.SPACE, returnState); - } else if (contentSpacePolicy == XmlViolationPolicy.FATAL) { - fatal("A character reference expanded to a form feed which is not legal XML 1.0 white space."); - } - // ]NOCPP] - } else if (value == 0x0) { - errNcrZero(); - emitOrAppendOne(Tokenizer.REPLACEMENT_CHARACTER, returnState); - } else if ((value & 0xF800) == 0xD800) { - errNcrSurrogate(); - emitOrAppendOne(Tokenizer.REPLACEMENT_CHARACTER, returnState); - } else { - /* - * Otherwise, return a character token for the Unicode character - * whose code point is that number. - */ - char ch = (char) value; - // [NOCPP[ - if (value == 0x0D) { - errNcrCr(); - } else if ((value <= 0x0008) || (value == 0x000B) - || (value >= 0x000E && value <= 0x001F)) { - ch = errNcrControlChar(ch); - } else if (value >= 0xFDD0 && value <= 0xFDEF) { - errNcrUnassigned(); - } else if ((value & 0xFFFE) == 0xFFFE) { - ch = errNcrNonCharacter(ch); - } else if (value >= 0x007F && value <= 0x009F) { - errNcrControlChar(); - } else { - maybeWarnPrivateUse(ch); - } - // ]NOCPP] - bmpChar[0] = ch; - emitOrAppendOne(bmpChar, returnState); - } - } else if (value <= 0x10FFFF) { - // [NOCPP[ - maybeWarnPrivateUseAstral(); - if ((value & 0xFFFE) == 0xFFFE) { - errAstralNonCharacter(value); - } - // ]NOCPP] - astralChar[0] = (char) (Tokenizer.LEAD_OFFSET + (value >> 10)); - astralChar[1] = (char) (0xDC00 + (value & 0x3FF)); - emitOrAppendTwo(astralChar, returnState); - } else { - errNcrOutOfRange(); - emitOrAppendOne(Tokenizer.REPLACEMENT_CHARACTER, returnState); - } - } - - public void eof() throws SAXException { - int state = stateSave; - int returnState = returnStateSave; - - eofloop: for (;;) { - switch (state) { - case SCRIPT_DATA_LESS_THAN_SIGN: - case SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: - /* - * Otherwise, emit a U+003C LESS-THAN SIGN character token - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - /* - * and reconsume the current input character in the data - * state. - */ - break eofloop; - case TAG_OPEN: - /* - * The behavior of this state depends on the content model - * flag. - */ - /* - * Anything else Parse error. - */ - errEofAfterLt(); - /* - * Emit a U+003C LESS-THAN SIGN character token - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - /* - * and reconsume the current input character in the data - * state. - */ - break eofloop; - case RAWTEXT_RCDATA_LESS_THAN_SIGN: - /* - * Emit a U+003C LESS-THAN SIGN character token - */ - tokenHandler.characters(Tokenizer.LT_GT, 0, 1); - /* - * and reconsume the current input character in the RCDATA - * state. - */ - break eofloop; - case NON_DATA_END_TAG_NAME: - /* - * Emit a U+003C LESS-THAN SIGN character token, a U+002F - * SOLIDUS character token, - */ - tokenHandler.characters(Tokenizer.LT_SOLIDUS, 0, 2); - /* - * a character token for each of the characters in the - * temporary buffer (in the order they were added to the - * buffer), - */ - emitStrBuf(); - /* - * and reconsume the current input character in the RCDATA - * state. - */ - break eofloop; - case CLOSE_TAG_OPEN: - /* EOF Parse error. */ - errEofAfterLt(); - /* - * Emit a U+003C LESS-THAN SIGN character token and a U+002F - * SOLIDUS character token. - */ - tokenHandler.characters(Tokenizer.LT_SOLIDUS, 0, 2); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case TAG_NAME: - /* - * EOF Parse error. - */ - errEofInTagName(); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case BEFORE_ATTRIBUTE_NAME: - case AFTER_ATTRIBUTE_VALUE_QUOTED: - case SELF_CLOSING_START_TAG: - /* EOF Parse error. */ - errEofWithoutGt(); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case ATTRIBUTE_NAME: - /* - * EOF Parse error. - */ - errEofInAttributeName(); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case AFTER_ATTRIBUTE_NAME: - case BEFORE_ATTRIBUTE_VALUE: - /* EOF Parse error. */ - errEofWithoutGt(); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case ATTRIBUTE_VALUE_DOUBLE_QUOTED: - case ATTRIBUTE_VALUE_SINGLE_QUOTED: - case ATTRIBUTE_VALUE_UNQUOTED: - /* EOF Parse error. */ - errEofInAttributeValue(); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case BOGUS_COMMENT: - emitComment(0, 0); - break eofloop; - case BOGUS_COMMENT_HYPHEN: - // [NOCPP[ - maybeAppendSpaceToBogusComment(); - // ]NOCPP] - emitComment(0, 0); - break eofloop; - case MARKUP_DECLARATION_OPEN: - errBogusComment(); - emitComment(0, 0); - break eofloop; - case MARKUP_DECLARATION_HYPHEN: - errBogusComment(); - emitComment(0, 0); - break eofloop; - case MARKUP_DECLARATION_OCTYPE: - if (index < 6) { - errBogusComment(); - emitComment(0, 0); - } else { - /* EOF Parse error. */ - errEofInDoctype(); - /* - * Create a new DOCTYPE token. Set its force-quirks flag - * to on. - */ - doctypeName = ""; - if (systemIdentifier != null) { - Portability.releaseString(systemIdentifier); - systemIdentifier = null; - } - if (publicIdentifier != null) { - Portability.releaseString(publicIdentifier); - publicIdentifier = null; - } - forceQuirks = true; - /* - * Emit the token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - } - break eofloop; - case COMMENT_START: - case COMMENT: - /* - * EOF Parse error. - */ - errEofInComment(); - /* Emit the comment token. */ - emitComment(0, 0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case COMMENT_END: - errEofInComment(); - /* Emit the comment token. */ - emitComment(2, 0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case COMMENT_END_DASH: - case COMMENT_START_DASH: - errEofInComment(); - /* Emit the comment token. */ - emitComment(1, 0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case COMMENT_END_BANG: - errEofInComment(); - /* Emit the comment token. */ - emitComment(3, 0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case DOCTYPE: - case BEFORE_DOCTYPE_NAME: - errEofInDoctype(); - /* - * Create a new DOCTYPE token. Set its force-quirks flag to - * on. - */ - forceQuirks = true; - /* - * Emit the token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case DOCTYPE_NAME: - errEofInDoctype(); - strBufToDoctypeName(); - /* - * Set the DOCTYPE token's force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case DOCTYPE_UBLIC: - case DOCTYPE_YSTEM: - case AFTER_DOCTYPE_NAME: - case AFTER_DOCTYPE_PUBLIC_KEYWORD: - case AFTER_DOCTYPE_SYSTEM_KEYWORD: - case BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: - errEofInDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: - case DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: - /* EOF Parse error. */ - errEofInPublicId(); - /* - * Set the DOCTYPE token's force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - publicIdentifier = strBufToString(); - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case AFTER_DOCTYPE_PUBLIC_IDENTIFIER: - case BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: - case BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: - errEofInDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: - case DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: - /* EOF Parse error. */ - errEofInSystemId(); - /* - * Set the DOCTYPE token's force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - systemIdentifier = strBufToString(); - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case AFTER_DOCTYPE_SYSTEM_IDENTIFIER: - errEofInDoctype(); - /* - * Set the DOCTYPE token's force-quirks flag to on. - */ - forceQuirks = true; - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case BOGUS_DOCTYPE: - /* - * Emit that DOCTYPE token. - */ - emitDoctypeToken(0); - /* - * Reconsume the EOF character in the data state. - */ - break eofloop; - case CONSUME_CHARACTER_REFERENCE: - /* - * Unlike the definition is the spec, this state does not - * return a value and never requires the caller to - * backtrack. This state takes care of emitting characters - * or appending to the current attribute value. It also - * takes care of that in the case when consuming the entity - * fails. - */ - /* - * This section defines how to consume an entity. This - * definition is used when parsing entities in text and in - * attributes. - * - * The behavior depends on the identity of the next - * character (the one immediately after the U+0026 AMPERSAND - * character): - */ - - emitOrAppendCharRefBuf(returnState); - state = returnState; - continue; - case CHARACTER_REFERENCE_HILO_LOOKUP: - errNoNamedCharacterMatch(); - emitOrAppendCharRefBuf(returnState); - state = returnState; - continue; - case CHARACTER_REFERENCE_TAIL: - outer: for (;;) { - char c = '\u0000'; - entCol++; - /* - * Consume the maximum number of characters possible, - * with the consumed characters matching one of the - * identifiers in the first column of the named - * character references table (in a case-sensitive - * manner). - */ - hiloop: for (;;) { - if (hi == -1) { - break hiloop; - } - if (entCol == NamedCharacters.NAMES[hi].length()) { - break hiloop; - } - if (entCol > NamedCharacters.NAMES[hi].length()) { - break outer; - } else if (c < NamedCharacters.NAMES[hi].charAt(entCol)) { - hi--; - } else { - break hiloop; - } - } - - loloop: for (;;) { - if (hi < lo) { - break outer; - } - if (entCol == NamedCharacters.NAMES[lo].length()) { - candidate = lo; - charRefBufMark = charRefBufLen; - lo++; - } else if (entCol > NamedCharacters.NAMES[lo].length()) { - break outer; - } else if (c > NamedCharacters.NAMES[lo].charAt(entCol)) { - lo++; - } else { - break loloop; - } - } - if (hi < lo) { - break outer; - } - continue; - } - - if (candidate == -1) { - /* - * If no match can be made, then this is a parse error. - */ - errNoNamedCharacterMatch(); - emitOrAppendCharRefBuf(returnState); - state = returnState; - continue eofloop; - } else { - @Const @CharacterName String candidateName = NamedCharacters.NAMES[candidate]; - if (candidateName.length() == 0 - || candidateName.charAt(candidateName.length() - 1) != ';') { - /* - * If the last character matched is not a U+003B - * SEMICOLON (;), there is a parse error. - */ - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - /* - * If the entity is being consumed as part of an - * attribute, and the last character matched is - * not a U+003B SEMICOLON (;), - */ - char ch; - if (charRefBufMark == charRefBufLen) { - ch = '\u0000'; - } else { - ch = charRefBuf[charRefBufMark]; - } - if ((ch >= '0' && ch <= '9') - || (ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z')) { - /* - * and the next character is in the range - * U+0030 DIGIT ZERO to U+0039 DIGIT NINE, - * U+0041 LATIN CAPITAL LETTER A to U+005A - * LATIN CAPITAL LETTER Z, or U+0061 LATIN - * SMALL LETTER A to U+007A LATIN SMALL - * LETTER Z, then, for historical reasons, - * all the characters that were matched - * after the U+0026 AMPERSAND (&) must be - * unconsumed, and nothing is returned. - */ - errNoNamedCharacterMatch(); - appendCharRefBufToStrBuf(); - state = returnState; - continue eofloop; - } - } - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - errUnescapedAmpersandInterpretedAsCharacterReference(); - } else { - errNotSemicolonTerminated(); - } - } - - /* - * Otherwise, return a character token for the character - * corresponding to the entity name (as given by the - * second column of the named character references - * table). - */ - @Const @NoLength char[] val = NamedCharacters.VALUES[candidate]; - if ( - // [NOCPP[ - val.length == 1 - // ]NOCPP] - // CPPONLY: val[1] == 0 - ) { - emitOrAppendOne(val, returnState); - } else { - emitOrAppendTwo(val, returnState); - } - // this is so complicated! - if (charRefBufMark < charRefBufLen) { - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - appendStrBuf(charRefBuf, charRefBufMark, - charRefBufLen - charRefBufMark); - } else { - tokenHandler.characters(charRefBuf, charRefBufMark, - charRefBufLen - charRefBufMark); - } - } - charRefBufLen = 0; - state = returnState; - continue eofloop; - /* - * If the markup contains I'm ¬it; I tell you, the - * entity is parsed as "not", as in, I'm ¬it; I tell - * you. But if the markup was I'm ∉ I tell you, - * the entity would be parsed as "notin;", resulting in - * I'm ∉ I tell you. - */ - } - case CONSUME_NCR: - case DECIMAL_NRC_LOOP: - case HEX_NCR_LOOP: - /* - * If no characters match the range, then don't consume any - * characters (and unconsume the U+0023 NUMBER SIGN - * character and, if appropriate, the X character). This is - * a parse error; nothing is returned. - * - * Otherwise, if the next character is a U+003B SEMICOLON, - * consume that too. If it isn't, there is a parse error. - */ - if (!seenDigits) { - errNoDigitsInNCR(); - emitOrAppendCharRefBuf(returnState); - state = returnState; - continue; - } else { - errCharRefLacksSemicolon(); - } - // WARNING previous state sets reconsume - handleNcrValue(returnState); - state = returnState; - continue; - case CDATA_RSQB: - tokenHandler.characters(Tokenizer.RSQB_RSQB, 0, 1); - break eofloop; - case CDATA_RSQB_RSQB: - tokenHandler.characters(Tokenizer.RSQB_RSQB, 0, 2); - break eofloop; - case DATA: - default: - break eofloop; - } - } - // case DATA: - /* - * EOF Emit an end-of-file token. - */ - tokenHandler.eof(); - return; - } - - private void emitDoctypeToken(int pos) throws SAXException { - cstart = pos + 1; - tokenHandler.doctype(doctypeName, publicIdentifier, systemIdentifier, - forceQuirks); - // It is OK and sufficient to release these here, since - // there's no way out of the doctype states than through paths - // that call this method. - doctypeName = null; - Portability.releaseString(publicIdentifier); - publicIdentifier = null; - Portability.releaseString(systemIdentifier); - systemIdentifier = null; - } - - @Inline protected char checkChar(@NoLength char[] buf, int pos) - throws SAXException { - return buf[pos]; - } - - public boolean internalEncodingDeclaration(String internalCharset) - throws SAXException { - if (encodingDeclarationHandler != null) { - return encodingDeclarationHandler.internalEncodingDeclaration(internalCharset); - } - return false; - } - - /** - * @param val - * @throws SAXException - */ - private void emitOrAppendTwo(@Const @NoLength char[] val, int returnState) - throws SAXException { - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - appendStrBuf(val[0]); - appendStrBuf(val[1]); - } else { - tokenHandler.characters(val, 0, 2); - } - } - - private void emitOrAppendOne(@Const @NoLength char[] val, int returnState) - throws SAXException { - if ((returnState & DATA_AND_RCDATA_MASK) != 0) { - appendStrBuf(val[0]); - } else { - tokenHandler.characters(val, 0, 1); - } - } - - public void end() throws SAXException { - strBuf = null; - doctypeName = null; - if (systemIdentifier != null) { - Portability.releaseString(systemIdentifier); - systemIdentifier = null; - } - if (publicIdentifier != null) { - Portability.releaseString(publicIdentifier); - publicIdentifier = null; - } - if (tagName != null) { - tagName.release(); - tagName = null; - } - if (attributeName != null) { - attributeName.release(); - attributeName = null; - } - tokenHandler.endTokenization(); - if (attributes != null) { - // [NOCPP[ - attributes = null; - // ]NOCPP] - // CPPONLY: attributes.clear(mappingLangToXmlLang); - } - } - - public void requestSuspension() { - shouldSuspend = true; - } - - // [NOCPP[ - - public void becomeConfident() { - confident = true; - } - - /** - * Returns the nextCharOnNewLine. - * - * @return the nextCharOnNewLine - */ - public boolean isNextCharOnNewLine() { - return false; - } - - public boolean isPrevCR() { - return lastCR; - } - - /** - * Returns the line. - * - * @return the line - */ - public int getLine() { - return -1; - } - - /** - * Returns the col. - * - * @return the col - */ - public int getCol() { - return -1; - } - - // ]NOCPP] - - public boolean isInDataState() { - return (stateSave == DATA); - } - - public void resetToDataState() { - clearStrBufAfterUse(); - charRefBufLen = 0; - stateSave = Tokenizer.DATA; - // line = 1; XXX line numbers - lastCR = false; - index = 0; - forceQuirks = false; - additional = '\u0000'; - entCol = -1; - firstCharKey = -1; - lo = 0; - hi = 0; // will always be overwritten before use anyway - candidate = -1; - charRefBufMark = 0; - value = 0; - seenDigits = false; - endTag = false; - shouldSuspend = false; - initDoctypeFields(); - if (tagName != null) { - tagName.release(); - tagName = null; - } - if (attributeName != null) { - attributeName.release(); - attributeName = null; - } - if (newAttributesEachTime) { - if (attributes != null) { - Portability.delete(attributes); - attributes = null; - } - } - } - - public void loadState(Tokenizer other) throws SAXException { - strBufLen = other.strBufLen; - if (strBufLen > strBuf.length) { - strBuf = new char[strBufLen]; - } - System.arraycopy(other.strBuf, 0, strBuf, 0, strBufLen); - - charRefBufLen = other.charRefBufLen; - System.arraycopy(other.charRefBuf, 0, charRefBuf, 0, charRefBufLen); - - stateSave = other.stateSave; - returnStateSave = other.returnStateSave; - endTagExpectation = other.endTagExpectation; - endTagExpectationAsArray = other.endTagExpectationAsArray; - // line = 1; XXX line numbers - lastCR = other.lastCR; - index = other.index; - forceQuirks = other.forceQuirks; - additional = other.additional; - entCol = other.entCol; - firstCharKey = other.firstCharKey; - lo = other.lo; - hi = other.hi; - candidate = other.candidate; - charRefBufMark = other.charRefBufMark; - value = other.value; - seenDigits = other.seenDigits; - endTag = other.endTag; - shouldSuspend = false; - - if (other.doctypeName == null) { - doctypeName = null; - } else { - doctypeName = Portability.newLocalFromLocal(other.doctypeName, - interner); - } - - Portability.releaseString(systemIdentifier); - if (other.systemIdentifier == null) { - systemIdentifier = null; - } else { - systemIdentifier = Portability.newStringFromString(other.systemIdentifier); - } - - Portability.releaseString(publicIdentifier); - if (other.publicIdentifier == null) { - publicIdentifier = null; - } else { - publicIdentifier = Portability.newStringFromString(other.publicIdentifier); - } - - if (tagName != null) { - tagName.release(); - } - if (other.tagName == null) { - tagName = null; - } else { - tagName = other.tagName.cloneElementName(interner); - } - - if (attributeName != null) { - attributeName.release(); - } - if (other.attributeName == null) { - attributeName = null; - } else { - attributeName = other.attributeName.cloneAttributeName(interner); - } - - Portability.delete(attributes); - if (other.attributes == null) { - attributes = null; - } else { - attributes = other.attributes.cloneAttributes(interner); - } - } - - public void initializeWithoutStarting() throws SAXException { - confident = false; - strBuf = null; - line = 1; - // CPPONLY: attributeLine = 1; - // [NOCPP[ - html4 = false; - metaBoundaryPassed = false; - wantsComments = tokenHandler.wantsComments(); - if (!newAttributesEachTime) { - attributes = new HtmlAttributes(mappingLangToXmlLang); - } - // ]NOCPP] - resetToDataState(); - } - - protected void errGarbageAfterLtSlash() throws SAXException { - } - - protected void errLtSlashGt() throws SAXException { - } - - protected void errWarnLtSlashInRcdata() throws SAXException { - } - - protected void errHtml4LtSlashInRcdata(char folded) throws SAXException { - } - - protected void errCharRefLacksSemicolon() throws SAXException { - } - - protected void errNoDigitsInNCR() throws SAXException { - } - - protected void errGtInSystemId() throws SAXException { - } - - protected void errGtInPublicId() throws SAXException { - } - - protected void errNamelessDoctype() throws SAXException { - } - - protected void errConsecutiveHyphens() throws SAXException { - } - - protected void errPrematureEndOfComment() throws SAXException { - } - - protected void errBogusComment() throws SAXException { - } - - protected void errUnquotedAttributeValOrNull(char c) throws SAXException { - } - - protected void errSlashNotFollowedByGt() throws SAXException { - } - - protected void errHtml4XmlVoidSyntax() throws SAXException { - } - - protected void errNoSpaceBetweenAttributes() throws SAXException { - } - - protected void errHtml4NonNameInUnquotedAttribute(char c) - throws SAXException { - } - - protected void errLtOrEqualsOrGraveInUnquotedAttributeOrNull(char c) - throws SAXException { - } - - protected void errAttributeValueMissing() throws SAXException { - } - - protected void errBadCharBeforeAttributeNameOrNull(char c) - throws SAXException { - } - - protected void errEqualsSignBeforeAttributeName() throws SAXException { - } - - protected void errBadCharAfterLt(char c) throws SAXException { - } - - protected void errLtGt() throws SAXException { - } - - protected void errProcessingInstruction() throws SAXException { - } - - protected void errUnescapedAmpersandInterpretedAsCharacterReference() - throws SAXException { - } - - protected void errNotSemicolonTerminated() throws SAXException { - } - - protected void errNoNamedCharacterMatch() throws SAXException { - } - - protected void errQuoteBeforeAttributeName(char c) throws SAXException { - } - - protected void errQuoteOrLtInAttributeNameOrNull(char c) - throws SAXException { - } - - protected void errExpectedPublicId() throws SAXException { - } - - protected void errBogusDoctype() throws SAXException { - } - - protected void maybeWarnPrivateUseAstral() throws SAXException { - } - - protected void maybeWarnPrivateUse(char ch) throws SAXException { - } - - protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) - throws SAXException { - } - - protected void maybeErrSlashInEndTag(boolean selfClosing) - throws SAXException { - } - - protected char errNcrNonCharacter(char ch) throws SAXException { - return ch; - } - - protected void errAstralNonCharacter(int ch) throws SAXException { - } - - protected void errNcrSurrogate() throws SAXException { - } - - protected char errNcrControlChar(char ch) throws SAXException { - return ch; - } - - protected void errNcrCr() throws SAXException { - } - - protected void errNcrInC1Range() throws SAXException { - } - - protected void errEofInPublicId() throws SAXException { - } - - protected void errEofInComment() throws SAXException { - } - - protected void errEofInDoctype() throws SAXException { - } - - protected void errEofInAttributeValue() throws SAXException { - } - - protected void errEofInAttributeName() throws SAXException { - } - - protected void errEofWithoutGt() throws SAXException { - } - - protected void errEofInTagName() throws SAXException { - } - - protected void errEofInEndTag() throws SAXException { - } - - protected void errEofAfterLt() throws SAXException { - } - - protected void errNcrOutOfRange() throws SAXException { - } - - protected void errNcrUnassigned() throws SAXException { - } - - protected void errDuplicateAttribute() throws SAXException { - } - - protected void errEofInSystemId() throws SAXException { - } - - protected void errExpectedSystemId() throws SAXException { - } - - protected void errMissingSpaceBeforeDoctypeName() throws SAXException { - } - - protected void errHyphenHyphenBang() throws SAXException { - } - - protected void errNcrControlChar() throws SAXException { - } - - protected void errNcrZero() throws SAXException { - } - - protected void errNoSpaceBetweenDoctypeSystemKeywordAndQuote() - throws SAXException { - } - - protected void errNoSpaceBetweenPublicAndSystemIds() throws SAXException { - } - - protected void errNoSpaceBetweenDoctypePublicKeywordAndQuote() - throws SAXException { - } - - protected void noteAttributeWithoutValue() throws SAXException { - } - - protected void noteUnquotedAttributeValue() throws SAXException { - } - - /** - * Sets the encodingDeclarationHandler. - * - * @param encodingDeclarationHandler - * the encodingDeclarationHandler to set - */ - public void setEncodingDeclarationHandler( - EncodingDeclarationHandler encodingDeclarationHandler) { - this.encodingDeclarationHandler = encodingDeclarationHandler; - } - - void destructor() { - // The translator will write refcount tracing stuff here - Portability.delete(attributes); - attributes = null; - } - - // [NOCPP[ - - /** - * Sets an offset to be added to the position reported to - * <code>TransitionHandler</code>. - * - * @param offset the offset - */ - public void setTransitionBaseOffset(int offset) { - - } - - // ]NOCPP] - -} diff --git a/parser/html/javasrc/TreeBuilder.java b/parser/html/javasrc/TreeBuilder.java deleted file mode 100644 index 5e83d1847..000000000 --- a/parser/html/javasrc/TreeBuilder.java +++ /dev/null @@ -1,6558 +0,0 @@ -/* - * Copyright (c) 2007 Henri Sivonen - * Copyright (c) 2007-2015 Mozilla Foundation - * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla - * Foundation, and Opera Software ASA. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * The comments following this one that use the same comment syntax as this - * comment are quotes from the WHATWG HTML 5 spec as of 27 June 2007 - * amended as of June 28 2007. - * That document came with this statement: - * "© Copyright 2004-2007 Apple Computer, Inc., Mozilla Foundation, and - * Opera Software ASA. You are granted a license to use, reproduce and - * create derivative works of this document." - */ - -package nu.validator.htmlparser.impl; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import org.xml.sax.ErrorHandler; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -import nu.validator.htmlparser.annotation.Auto; -import nu.validator.htmlparser.annotation.Const; -import nu.validator.htmlparser.annotation.IdType; -import nu.validator.htmlparser.annotation.Inline; -import nu.validator.htmlparser.annotation.Literal; -import nu.validator.htmlparser.annotation.Local; -import nu.validator.htmlparser.annotation.NoLength; -import nu.validator.htmlparser.annotation.NsUri; -import nu.validator.htmlparser.common.DoctypeExpectation; -import nu.validator.htmlparser.common.DocumentMode; -import nu.validator.htmlparser.common.DocumentModeHandler; -import nu.validator.htmlparser.common.Interner; -import nu.validator.htmlparser.common.TokenHandler; -import nu.validator.htmlparser.common.XmlViolationPolicy; - -public abstract class TreeBuilder<T> implements TokenHandler, - TreeBuilderState<T> { - - /** - * Array version of U+FFFD. - */ - private static final @NoLength char[] REPLACEMENT_CHARACTER = { '\uFFFD' }; - - // Start dispatch groups - - final static int OTHER = 0; - - final static int A = 1; - - final static int BASE = 2; - - final static int BODY = 3; - - final static int BR = 4; - - final static int BUTTON = 5; - - final static int CAPTION = 6; - - final static int COL = 7; - - final static int COLGROUP = 8; - - final static int FORM = 9; - - final static int FRAME = 10; - - final static int FRAMESET = 11; - - final static int IMAGE = 12; - - final static int INPUT = 13; - - final static int ISINDEX = 14; - - final static int LI = 15; - - final static int LINK_OR_BASEFONT_OR_BGSOUND = 16; - - final static int MATH = 17; - - final static int META = 18; - - final static int SVG = 19; - - final static int HEAD = 20; - - final static int HR = 22; - - final static int HTML = 23; - - final static int NOBR = 24; - - final static int NOFRAMES = 25; - - final static int NOSCRIPT = 26; - - final static int OPTGROUP = 27; - - final static int OPTION = 28; - - final static int P = 29; - - final static int PLAINTEXT = 30; - - final static int SCRIPT = 31; - - final static int SELECT = 32; - - final static int STYLE = 33; - - final static int TABLE = 34; - - final static int TEXTAREA = 35; - - final static int TITLE = 36; - - final static int TR = 37; - - final static int XMP = 38; - - final static int TBODY_OR_THEAD_OR_TFOOT = 39; - - final static int TD_OR_TH = 40; - - final static int DD_OR_DT = 41; - - final static int H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 = 42; - - final static int MARQUEE_OR_APPLET = 43; - - final static int PRE_OR_LISTING = 44; - - final static int B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U = 45; - - final static int UL_OR_OL_OR_DL = 46; - - final static int IFRAME = 47; - - final static int EMBED = 48; - - final static int AREA_OR_WBR = 49; - - final static int DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU = 50; - - final static int ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY = 51; - - final static int RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR = 52; - - final static int RB_OR_RTC = 53; - - final static int PARAM_OR_SOURCE_OR_TRACK = 55; - - final static int MGLYPH_OR_MALIGNMARK = 56; - - final static int MI_MO_MN_MS_MTEXT = 57; - - final static int ANNOTATION_XML = 58; - - final static int FOREIGNOBJECT_OR_DESC = 59; - - final static int NOEMBED = 60; - - final static int FIELDSET = 61; - - final static int OUTPUT = 62; - - final static int OBJECT = 63; - - final static int FONT = 64; - - final static int KEYGEN = 65; - - final static int MENUITEM = 66; - - final static int TEMPLATE = 67; - - final static int IMG = 68; - - final static int RT_OR_RP = 69; - - // start insertion modes - - private static final int IN_ROW = 0; - - private static final int IN_TABLE_BODY = 1; - - private static final int IN_TABLE = 2; - - private static final int IN_CAPTION = 3; - - private static final int IN_CELL = 4; - - private static final int FRAMESET_OK = 5; - - private static final int IN_BODY = 6; - - private static final int IN_HEAD = 7; - - private static final int IN_HEAD_NOSCRIPT = 8; - - // no fall-through - - private static final int IN_COLUMN_GROUP = 9; - - // no fall-through - - private static final int IN_SELECT_IN_TABLE = 10; - - private static final int IN_SELECT = 11; - - // no fall-through - - private static final int AFTER_BODY = 12; - - // no fall-through - - private static final int IN_FRAMESET = 13; - - private static final int AFTER_FRAMESET = 14; - - // no fall-through - - private static final int INITIAL = 15; - - // could add fall-through - - private static final int BEFORE_HTML = 16; - - // could add fall-through - - private static final int BEFORE_HEAD = 17; - - // no fall-through - - private static final int AFTER_HEAD = 18; - - // no fall-through - - private static final int AFTER_AFTER_BODY = 19; - - // no fall-through - - private static final int AFTER_AFTER_FRAMESET = 20; - - // no fall-through - - private static final int TEXT = 21; - - private static final int IN_TEMPLATE = 22; - - // start charset states - - private static final int CHARSET_INITIAL = 0; - - private static final int CHARSET_C = 1; - - private static final int CHARSET_H = 2; - - private static final int CHARSET_A = 3; - - private static final int CHARSET_R = 4; - - private static final int CHARSET_S = 5; - - private static final int CHARSET_E = 6; - - private static final int CHARSET_T = 7; - - private static final int CHARSET_EQUALS = 8; - - private static final int CHARSET_SINGLE_QUOTED = 9; - - private static final int CHARSET_DOUBLE_QUOTED = 10; - - private static final int CHARSET_UNQUOTED = 11; - - // end pseudo enums - - // [NOCPP[ - - private final static String[] HTML4_PUBLIC_IDS = { - "-//W3C//DTD HTML 4.0 Frameset//EN", - "-//W3C//DTD HTML 4.0 Transitional//EN", - "-//W3C//DTD HTML 4.0//EN", "-//W3C//DTD HTML 4.01 Frameset//EN", - "-//W3C//DTD HTML 4.01 Transitional//EN", - "-//W3C//DTD HTML 4.01//EN" }; - - // ]NOCPP] - - @Literal private final static String[] QUIRKY_PUBLIC_IDS = { - "+//silmaril//dtd html pro v0r11 19970101//", - "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", - "-//as//dtd html 3.0 aswedit + extensions//", - "-//ietf//dtd html 2.0 level 1//", - "-//ietf//dtd html 2.0 level 2//", - "-//ietf//dtd html 2.0 strict level 1//", - "-//ietf//dtd html 2.0 strict level 2//", - "-//ietf//dtd html 2.0 strict//", - "-//ietf//dtd html 2.0//", - "-//ietf//dtd html 2.1e//", - "-//ietf//dtd html 3.0//", - "-//ietf//dtd html 3.2 final//", - "-//ietf//dtd html 3.2//", - "-//ietf//dtd html 3//", - "-//ietf//dtd html level 0//", - "-//ietf//dtd html level 1//", - "-//ietf//dtd html level 2//", - "-//ietf//dtd html level 3//", - "-//ietf//dtd html strict level 0//", - "-//ietf//dtd html strict level 1//", - "-//ietf//dtd html strict level 2//", - "-//ietf//dtd html strict level 3//", - "-//ietf//dtd html strict//", - "-//ietf//dtd html//", - "-//metrius//dtd metrius presentational//", - "-//microsoft//dtd internet explorer 2.0 html strict//", - "-//microsoft//dtd internet explorer 2.0 html//", - "-//microsoft//dtd internet explorer 2.0 tables//", - "-//microsoft//dtd internet explorer 3.0 html strict//", - "-//microsoft//dtd internet explorer 3.0 html//", - "-//microsoft//dtd internet explorer 3.0 tables//", - "-//netscape comm. corp.//dtd html//", - "-//netscape comm. corp.//dtd strict html//", - "-//o'reilly and associates//dtd html 2.0//", - "-//o'reilly and associates//dtd html extended 1.0//", - "-//o'reilly and associates//dtd html extended relaxed 1.0//", - "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", - "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", - "-//spyglass//dtd html 2.0 extended//", - "-//sq//dtd html 2.0 hotmetal + extensions//", - "-//sun microsystems corp.//dtd hotjava html//", - "-//sun microsystems corp.//dtd hotjava strict html//", - "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", - "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", - "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", - "-//w3c//dtd html 4.0 transitional//", - "-//w3c//dtd html experimental 19960712//", - "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", - "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", - "-//webtechs//dtd mozilla html//" }; - - private static final int NOT_FOUND_ON_STACK = Integer.MAX_VALUE; - - // [NOCPP[ - - private static final @Local String HTML_LOCAL = "html"; - - // ]NOCPP] - - private int mode = INITIAL; - - private int originalMode = INITIAL; - - /** - * Used only when moving back to IN_BODY. - */ - private boolean framesetOk = true; - - protected Tokenizer tokenizer; - - // [NOCPP[ - - protected ErrorHandler errorHandler; - - private DocumentModeHandler documentModeHandler; - - private DoctypeExpectation doctypeExpectation = DoctypeExpectation.HTML; - - private LocatorImpl firstCommentLocation; - - // ]NOCPP] - - private boolean scriptingEnabled = false; - - private boolean needToDropLF; - - // [NOCPP[ - - private boolean wantingComments; - - // ]NOCPP] - - private boolean fragment; - - private @Local String contextName; - - private @NsUri String contextNamespace; - - private T contextNode; - - /** - * Stack of template insertion modes - */ - private @Auto int[] templateModeStack; - - /** - * Current template mode stack pointer. - */ - private int templateModePtr = -1; - - private @Auto StackNode<T>[] stack; - - private int currentPtr = -1; - - private @Auto StackNode<T>[] listOfActiveFormattingElements; - - private int listPtr = -1; - - private T formPointer; - - private T headPointer; - - /** - * Used to work around Gecko limitations. Not used in Java. - */ - private T deepTreeSurrogateParent; - - protected @Auto char[] charBuffer; - - protected int charBufferLen = 0; - - private boolean quirks = false; - - private boolean isSrcdocDocument = false; - - // [NOCPP[ - - private boolean reportingDoctype = true; - - private XmlViolationPolicy namePolicy = XmlViolationPolicy.ALTER_INFOSET; - - private final Map<String, LocatorImpl> idLocations = new HashMap<String, LocatorImpl>(); - - private boolean html4; - - // ]NOCPP] - - protected TreeBuilder() { - fragment = false; - } - - /** - * Reports an condition that would make the infoset incompatible with XML - * 1.0 as fatal. - * - * @throws SAXException - * @throws SAXParseException - */ - protected void fatal() throws SAXException { - } - - // [NOCPP[ - - protected final void fatal(Exception e) throws SAXException { - SAXParseException spe = new SAXParseException(e.getMessage(), - tokenizer, e); - if (errorHandler != null) { - errorHandler.fatalError(spe); - } - throw spe; - } - - final void fatal(String s) throws SAXException { - SAXParseException spe = new SAXParseException(s, tokenizer); - if (errorHandler != null) { - errorHandler.fatalError(spe); - } - throw spe; - } - - /** - * Reports a Parse Error. - * - * @param message - * the message - * @throws SAXException - */ - final void err(String message) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck(message); - } - - /** - * Reports a Parse Error without checking if an error handler is present. - * - * @param message - * the message - * @throws SAXException - */ - final void errNoCheck(String message) throws SAXException { - SAXParseException spe = new SAXParseException(message, tokenizer); - errorHandler.error(spe); - } - - private void errListUnclosedStartTags(int eltPos) throws SAXException { - if (currentPtr != -1) { - for (int i = currentPtr; i > eltPos; i--) { - reportUnclosedElementNameAndLocation(i); - } - } - } - - /** - * Reports the name and location of an unclosed element. - * - * @throws SAXException - */ - private final void reportUnclosedElementNameAndLocation(int pos) throws SAXException { - StackNode<T> node = stack[pos]; - if (node.isOptionalEndTag()) { - return; - } - TaintableLocatorImpl locator = node.getLocator(); - if (locator.isTainted()) { - return; - } - locator.markTainted(); - SAXParseException spe = new SAXParseException( - "Unclosed element \u201C" + node.popName + "\u201D.", locator); - errorHandler.error(spe); - } - - /** - * Reports a warning - * - * @param message - * the message - * @throws SAXException - */ - final void warn(String message) throws SAXException { - if (errorHandler == null) { - return; - } - SAXParseException spe = new SAXParseException(message, tokenizer); - errorHandler.warning(spe); - } - - /** - * Reports a warning with an explicit locator - * - * @param message - * the message - * @throws SAXException - */ - final void warn(String message, Locator locator) throws SAXException { - if (errorHandler == null) { - return; - } - SAXParseException spe = new SAXParseException(message, locator); - errorHandler.warning(spe); - } - - // ]NOCPP] - - @SuppressWarnings("unchecked") public final void startTokenization(Tokenizer self) throws SAXException { - tokenizer = self; - stack = new StackNode[64]; - templateModeStack = new int[64]; - listOfActiveFormattingElements = new StackNode[64]; - needToDropLF = false; - originalMode = INITIAL; - templateModePtr = -1; - currentPtr = -1; - listPtr = -1; - formPointer = null; - headPointer = null; - deepTreeSurrogateParent = null; - // [NOCPP[ - html4 = false; - idLocations.clear(); - wantingComments = wantsComments(); - firstCommentLocation = null; - // ]NOCPP] - start(fragment); - charBufferLen = 0; - charBuffer = null; - framesetOk = true; - if (fragment) { - T elt; - if (contextNode != null) { - elt = contextNode; - } else { - elt = createHtmlElementSetAsRoot(tokenizer.emptyAttributes()); - } - // When the context node is not in the HTML namespace, contrary - // to the spec, the first node on the stack is not set to "html" - // in the HTML namespace. Instead, it is set to a node that has - // the characteristics of the appropriate "adjusted current node". - // This way, there is no need to perform "adjusted current node" - // checks during tree construction. Instead, it's sufficient to - // just look at the current node. However, this also means that it - // is not safe to treat "html" in the HTML namespace as a sentinel - // that ends stack popping. Instead, stack popping loops that are - // meant not to pop the first element on the stack need to check - // for currentPos becoming zero. - if (contextNamespace == "http://www.w3.org/2000/svg") { - ElementName elementName = ElementName.SVG; - if ("title" == contextName || "desc" == contextName - || "foreignObject" == contextName) { - // These elements are all alike and we don't care about - // the exact name. - elementName = ElementName.FOREIGNOBJECT; - } - // This is the SVG variant of the StackNode constructor. - StackNode<T> node = new StackNode<T>(elementName, - elementName.camelCaseName, elt - // [NOCPP[ - , errorHandler == null ? null - : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - currentPtr++; - stack[currentPtr] = node; - tokenizer.setStateAndEndTagExpectation(Tokenizer.DATA, - contextName); - // The frameset-ok flag is set even though <frameset> never - // ends up being allowed as HTML frameset in the fragment case. - mode = FRAMESET_OK; - } else if (contextNamespace == "http://www.w3.org/1998/Math/MathML") { - ElementName elementName = ElementName.MATH; - if ("mi" == contextName || "mo" == contextName - || "mn" == contextName || "ms" == contextName - || "mtext" == contextName) { - // These elements are all alike and we don't care about - // the exact name. - elementName = ElementName.MTEXT; - } else if ("annotation-xml" == contextName) { - elementName = ElementName.ANNOTATION_XML; - // Blink does not check the encoding attribute of the - // annotation-xml element innerHTML is being set on. - // Let's do the same at least until - // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26783 - // is resolved. - } - // This is the MathML variant of the StackNode constructor. - StackNode<T> node = new StackNode<T>(elementName, elt, - elementName.name, false - // [NOCPP[ - , errorHandler == null ? null - : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - currentPtr++; - stack[currentPtr] = node; - tokenizer.setStateAndEndTagExpectation(Tokenizer.DATA, - contextName); - // The frameset-ok flag is set even though <frameset> never - // ends up being allowed as HTML frameset in the fragment case. - mode = FRAMESET_OK; - } else { // html - StackNode<T> node = new StackNode<T>(ElementName.HTML, elt - // [NOCPP[ - , errorHandler == null ? null - : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - currentPtr++; - stack[currentPtr] = node; - if ("template" == contextName) { - pushTemplateMode(IN_TEMPLATE); - } - resetTheInsertionMode(); - formPointer = getFormPointerForContext(contextNode); - if ("title" == contextName || "textarea" == contextName) { - tokenizer.setStateAndEndTagExpectation(Tokenizer.RCDATA, - contextName); - } else if ("style" == contextName || "xmp" == contextName - || "iframe" == contextName || "noembed" == contextName - || "noframes" == contextName - || (scriptingEnabled && "noscript" == contextName)) { - tokenizer.setStateAndEndTagExpectation(Tokenizer.RAWTEXT, - contextName); - } else if ("plaintext" == contextName) { - tokenizer.setStateAndEndTagExpectation(Tokenizer.PLAINTEXT, - contextName); - } else if ("script" == contextName) { - tokenizer.setStateAndEndTagExpectation( - Tokenizer.SCRIPT_DATA, contextName); - } else { - tokenizer.setStateAndEndTagExpectation(Tokenizer.DATA, - contextName); - } - } - contextName = null; - contextNode = null; - } else { - mode = INITIAL; - // If we are viewing XML source, put a foreign element permanently - // on the stack so that cdataSectionAllowed() returns true. - // CPPONLY: if (tokenizer.isViewingXmlSource()) { - // CPPONLY: T elt = createElement("http://www.w3.org/2000/svg", - // CPPONLY: "svg", - // CPPONLY: tokenizer.emptyAttributes(), null); - // CPPONLY: StackNode<T> node = new StackNode<T>(ElementName.SVG, - // CPPONLY: "svg", - // CPPONLY: elt); - // CPPONLY: currentPtr++; - // CPPONLY: stack[currentPtr] = node; - // CPPONLY: } - } - } - - public final void doctype(@Local String name, String publicIdentifier, - String systemIdentifier, boolean forceQuirks) throws SAXException { - needToDropLF = false; - if (!isInForeign() && mode == INITIAL) { - // [NOCPP[ - if (reportingDoctype) { - // ]NOCPP] - String emptyString = Portability.newEmptyString(); - appendDoctypeToDocument(name == null ? "" : name, - publicIdentifier == null ? emptyString - : publicIdentifier, - systemIdentifier == null ? emptyString - : systemIdentifier); - Portability.releaseString(emptyString); - // [NOCPP[ - } - switch (doctypeExpectation) { - case HTML: - // ]NOCPP] - if (isQuirky(name, publicIdentifier, systemIdentifier, - forceQuirks)) { - errQuirkyDoctype(); - documentModeInternal(DocumentMode.QUIRKS_MODE, - publicIdentifier, systemIdentifier, false); - } else if (isAlmostStandards(publicIdentifier, - systemIdentifier)) { - // [NOCPP[ - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - // ]NOCPP] - errAlmostStandardsDoctype(); - documentModeInternal( - DocumentMode.ALMOST_STANDARDS_MODE, - publicIdentifier, systemIdentifier, false); - } else { - // [NOCPP[ - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - if ((Portability.literalEqualsString( - "-//W3C//DTD HTML 4.0//EN", publicIdentifier) && (systemIdentifier == null || Portability.literalEqualsString( - "http://www.w3.org/TR/REC-html40/strict.dtd", - systemIdentifier))) - || (Portability.literalEqualsString( - "-//W3C//DTD HTML 4.01//EN", - publicIdentifier) && (systemIdentifier == null || Portability.literalEqualsString( - "http://www.w3.org/TR/html4/strict.dtd", - systemIdentifier))) - || (Portability.literalEqualsString( - "-//W3C//DTD XHTML 1.0 Strict//EN", - publicIdentifier) && Portability.literalEqualsString( - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", - systemIdentifier)) - || (Portability.literalEqualsString( - "-//W3C//DTD XHTML 1.1//EN", - publicIdentifier) && Portability.literalEqualsString( - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd", - systemIdentifier)) - - ) { - warn("Obsolete doctype. Expected \u201C<!DOCTYPE html>\u201D."); - } else if (!((systemIdentifier == null || Portability.literalEqualsString( - "about:legacy-compat", systemIdentifier)) && publicIdentifier == null)) { - err("Legacy doctype. Expected \u201C<!DOCTYPE html>\u201D."); - } - // ]NOCPP] - documentModeInternal(DocumentMode.STANDARDS_MODE, - publicIdentifier, systemIdentifier, false); - } - // [NOCPP[ - break; - case HTML401_STRICT: - html4 = true; - tokenizer.turnOnAdditionalHtml4Errors(); - if (isQuirky(name, publicIdentifier, systemIdentifier, - forceQuirks)) { - err("Quirky doctype. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - documentModeInternal(DocumentMode.QUIRKS_MODE, - publicIdentifier, systemIdentifier, true); - } else if (isAlmostStandards(publicIdentifier, - systemIdentifier)) { - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - err("Almost standards mode doctype. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - documentModeInternal( - DocumentMode.ALMOST_STANDARDS_MODE, - publicIdentifier, systemIdentifier, true); - } else { - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - if ("-//W3C//DTD HTML 4.01//EN".equals(publicIdentifier)) { - if (!"http://www.w3.org/TR/html4/strict.dtd".equals(systemIdentifier)) { - warn("The doctype did not contain the system identifier prescribed by the HTML 4.01 specification. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - } - } else { - err("The doctype was not the HTML 4.01 Strict doctype. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - } - documentModeInternal(DocumentMode.STANDARDS_MODE, - publicIdentifier, systemIdentifier, true); - } - break; - case HTML401_TRANSITIONAL: - html4 = true; - tokenizer.turnOnAdditionalHtml4Errors(); - if (isQuirky(name, publicIdentifier, systemIdentifier, - forceQuirks)) { - err("Quirky doctype. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - documentModeInternal(DocumentMode.QUIRKS_MODE, - publicIdentifier, systemIdentifier, true); - } else if (isAlmostStandards(publicIdentifier, - systemIdentifier)) { - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - if ("-//W3C//DTD HTML 4.01 Transitional//EN".equals(publicIdentifier) - && systemIdentifier != null) { - if (!"http://www.w3.org/TR/html4/loose.dtd".equals(systemIdentifier)) { - warn("The doctype did not contain the system identifier prescribed by the HTML 4.01 specification. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - } - } else { - err("The doctype was not a non-quirky HTML 4.01 Transitional doctype. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - } - documentModeInternal( - DocumentMode.ALMOST_STANDARDS_MODE, - publicIdentifier, systemIdentifier, true); - } else { - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - err("The doctype was not the HTML 4.01 Transitional doctype. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - documentModeInternal(DocumentMode.STANDARDS_MODE, - publicIdentifier, systemIdentifier, true); - } - break; - case AUTO: - html4 = isHtml4Doctype(publicIdentifier); - if (html4) { - tokenizer.turnOnAdditionalHtml4Errors(); - } - if (isQuirky(name, publicIdentifier, systemIdentifier, - forceQuirks)) { - err("Quirky doctype. Expected e.g. \u201C<!DOCTYPE html>\u201D."); - documentModeInternal(DocumentMode.QUIRKS_MODE, - publicIdentifier, systemIdentifier, html4); - } else if (isAlmostStandards(publicIdentifier, - systemIdentifier)) { - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - if ("-//W3C//DTD HTML 4.01 Transitional//EN".equals(publicIdentifier)) { - if (!"http://www.w3.org/TR/html4/loose.dtd".equals(systemIdentifier)) { - warn("The doctype did not contain the system identifier prescribed by the HTML 4.01 specification. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - } - } else { - err("Almost standards mode doctype. Expected e.g. \u201C<!DOCTYPE html>\u201D."); - } - documentModeInternal( - DocumentMode.ALMOST_STANDARDS_MODE, - publicIdentifier, systemIdentifier, html4); - } else { - if (firstCommentLocation != null) { - warn("Comments seen before doctype. Internet Explorer will go into the quirks mode.", - firstCommentLocation); - } - if ("-//W3C//DTD HTML 4.01//EN".equals(publicIdentifier)) { - if (!"http://www.w3.org/TR/html4/strict.dtd".equals(systemIdentifier)) { - warn("The doctype did not contain the system identifier prescribed by the HTML 4.01 specification. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - } - } else if ("-//W3C//DTD XHTML 1.0 Strict//EN".equals(publicIdentifier)) { - if (!"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".equals(systemIdentifier)) { - warn("The doctype did not contain the system identifier prescribed by the XHTML 1.0 specification. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\u201D."); - } - } else if ("//W3C//DTD XHTML 1.1//EN".equals(publicIdentifier)) { - if (!"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd".equals(systemIdentifier)) { - warn("The doctype did not contain the system identifier prescribed by the XHTML 1.1 specification. Expected \u201C<!DOCTYPE HTML PUBLIC \"//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\u201D."); - } - } else if (!((systemIdentifier == null || Portability.literalEqualsString( - "about:legacy-compat", systemIdentifier)) && publicIdentifier == null)) { - err("Unexpected doctype. Expected, e.g., \u201C<!DOCTYPE html>\u201D."); - } - documentModeInternal(DocumentMode.STANDARDS_MODE, - publicIdentifier, systemIdentifier, html4); - } - break; - case NO_DOCTYPE_ERRORS: - if (isQuirky(name, publicIdentifier, systemIdentifier, - forceQuirks)) { - documentModeInternal(DocumentMode.QUIRKS_MODE, - publicIdentifier, systemIdentifier, false); - } else if (isAlmostStandards(publicIdentifier, - systemIdentifier)) { - documentModeInternal( - DocumentMode.ALMOST_STANDARDS_MODE, - publicIdentifier, systemIdentifier, false); - } else { - documentModeInternal(DocumentMode.STANDARDS_MODE, - publicIdentifier, systemIdentifier, false); - } - break; - } - // ]NOCPP] - - /* - * - * Then, switch to the root element mode of the tree construction - * stage. - */ - mode = BEFORE_HTML; - return; - } - /* - * A DOCTYPE token Parse error. - */ - errStrayDoctype(); - /* - * Ignore the token. - */ - return; - } - - // [NOCPP[ - - private boolean isHtml4Doctype(String publicIdentifier) { - if (publicIdentifier != null - && (Arrays.binarySearch(TreeBuilder.HTML4_PUBLIC_IDS, - publicIdentifier) > -1)) { - return true; - } - return false; - } - - // ]NOCPP] - - public final void comment(@NoLength char[] buf, int start, int length) - throws SAXException { - needToDropLF = false; - // [NOCPP[ - if (firstCommentLocation == null) { - firstCommentLocation = new LocatorImpl(tokenizer); - } - if (!wantingComments) { - return; - } - // ]NOCPP] - if (!isInForeign()) { - switch (mode) { - case INITIAL: - case BEFORE_HTML: - case AFTER_AFTER_BODY: - case AFTER_AFTER_FRAMESET: - /* - * A comment token Append a Comment node to the Document - * object with the data attribute set to the data given in - * the comment token. - */ - appendCommentToDocument(buf, start, length); - return; - case AFTER_BODY: - /* - * A comment token Append a Comment node to the first - * element in the stack of open elements (the html element), - * with the data attribute set to the data given in the - * comment token. - */ - flushCharacters(); - appendComment(stack[0].node, buf, start, length); - return; - default: - break; - } - } - /* - * A comment token Append a Comment node to the current node with the - * data attribute set to the data given in the comment token. - */ - flushCharacters(); - appendComment(stack[currentPtr].node, buf, start, length); - return; - } - - /** - * @see nu.validator.htmlparser.common.TokenHandler#characters(char[], int, - * int) - */ - public final void characters(@Const @NoLength char[] buf, int start, int length) - throws SAXException { - // Note: Can't attach error messages to EOF in C++ yet - - // CPPONLY: if (tokenizer.isViewingXmlSource()) { - // CPPONLY: return; - // CPPONLY: } - if (needToDropLF) { - needToDropLF = false; - if (buf[start] == '\n') { - start++; - length--; - if (length == 0) { - return; - } - } - } - - // optimize the most common case - switch (mode) { - case IN_BODY: - case IN_CELL: - case IN_CAPTION: - if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) { - reconstructTheActiveFormattingElements(); - } - // fall through - case TEXT: - accumulateCharacters(buf, start, length); - return; - case IN_TABLE: - case IN_TABLE_BODY: - case IN_ROW: - accumulateCharactersForced(buf, start, length); - return; - default: - int end = start + length; - charactersloop: for (int i = start; i < end; i++) { - switch (buf[i]) { - case ' ': - case '\t': - case '\n': - case '\r': - case '\u000C': - /* - * A character token that is one of one of U+0009 - * CHARACTER TABULATION, U+000A LINE FEED (LF), - * U+000C FORM FEED (FF), or U+0020 SPACE - */ - switch (mode) { - case INITIAL: - case BEFORE_HTML: - case BEFORE_HEAD: - /* - * Ignore the token. - */ - start = i + 1; - continue; - case IN_HEAD: - case IN_HEAD_NOSCRIPT: - case AFTER_HEAD: - case IN_COLUMN_GROUP: - case IN_FRAMESET: - case AFTER_FRAMESET: - /* - * Append the character to the current node. - */ - continue; - case FRAMESET_OK: - case IN_TEMPLATE: - case IN_BODY: - case IN_CELL: - case IN_CAPTION: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - - /* - * Reconstruct the active formatting - * elements, if any. - */ - if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) { - flushCharacters(); - reconstructTheActiveFormattingElements(); - } - /* - * Append the token's character to the - * current node. - */ - break charactersloop; - case IN_SELECT: - case IN_SELECT_IN_TABLE: - break charactersloop; - case IN_TABLE: - case IN_TABLE_BODY: - case IN_ROW: - accumulateCharactersForced(buf, i, 1); - start = i + 1; - continue; - case AFTER_BODY: - case AFTER_AFTER_BODY: - case AFTER_AFTER_FRAMESET: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * Reconstruct the active formatting - * elements, if any. - */ - flushCharacters(); - reconstructTheActiveFormattingElements(); - /* - * Append the token's character to the - * current node. - */ - continue; - } - default: - /* - * A character token that is not one of one of - * U+0009 CHARACTER TABULATION, U+000A LINE FEED - * (LF), U+000C FORM FEED (FF), or U+0020 SPACE - */ - switch (mode) { - case INITIAL: - /* - * Parse error. - */ - // [NOCPP[ - switch (doctypeExpectation) { - case AUTO: - err("Non-space characters found without seeing a doctype first. Expected e.g. \u201C<!DOCTYPE html>\u201D."); - break; - case HTML: - // XXX figure out a way to report this in the Gecko View Source case - err("Non-space characters found without seeing a doctype first. Expected \u201C<!DOCTYPE html>\u201D."); - break; - case HTML401_STRICT: - err("Non-space characters found without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - break; - case HTML401_TRANSITIONAL: - err("Non-space characters found without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - break; - case NO_DOCTYPE_ERRORS: - } - // ]NOCPP] - /* - * - * Set the document to quirks mode. - */ - documentModeInternal( - DocumentMode.QUIRKS_MODE, null, - null, false); - /* - * Then, switch to the root element mode of - * the tree construction stage - */ - mode = BEFORE_HTML; - /* - * and reprocess the current token. - */ - i--; - continue; - case BEFORE_HTML: - /* - * Create an HTMLElement node with the tag - * name html, in the HTML namespace. Append - * it to the Document object. - */ - // No need to flush characters here, - // because there's nothing to flush. - appendHtmlElementToDocumentAndPush(); - /* Switch to the main mode */ - mode = BEFORE_HEAD; - /* - * reprocess the current token. - */ - i--; - continue; - case BEFORE_HEAD: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * /Act as if a start tag token with the tag - * name "head" and no attributes had been - * seen, - */ - flushCharacters(); - appendToCurrentNodeAndPushHeadElement(HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_HEAD; - /* - * then reprocess the current token. - * - * This will result in an empty head element - * being generated, with the current token - * being reprocessed in the "after head" - * insertion mode. - */ - i--; - continue; - case IN_HEAD: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * Act as if an end tag token with the tag - * name "head" had been seen, - */ - flushCharacters(); - pop(); - mode = AFTER_HEAD; - /* - * and reprocess the current token. - */ - i--; - continue; - case IN_HEAD_NOSCRIPT: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * Parse error. Act as if an end tag with - * the tag name "noscript" had been seen - */ - errNonSpaceInNoscriptInHead(); - flushCharacters(); - pop(); - mode = IN_HEAD; - /* - * and reprocess the current token. - */ - i--; - continue; - case AFTER_HEAD: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * Act as if a start tag token with the tag - * name "body" and no attributes had been - * seen, - */ - flushCharacters(); - appendToCurrentNodeAndPushBodyElement(); - mode = FRAMESET_OK; - /* - * and then reprocess the current token. - */ - i--; - continue; - case FRAMESET_OK: - framesetOk = false; - mode = IN_BODY; - i--; - continue; - case IN_TEMPLATE: - case IN_BODY: - case IN_CELL: - case IN_CAPTION: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * Reconstruct the active formatting - * elements, if any. - */ - if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) { - flushCharacters(); - reconstructTheActiveFormattingElements(); - } - /* - * Append the token's character to the - * current node. - */ - break charactersloop; - case IN_TABLE: - case IN_TABLE_BODY: - case IN_ROW: - accumulateCharactersForced(buf, i, 1); - start = i + 1; - continue; - case IN_COLUMN_GROUP: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - start = i; - } - /* - * Act as if an end tag with the tag name - * "colgroup" had been seen, and then, if - * that token wasn't ignored, reprocess the - * current token. - */ - if (currentPtr == 0 || stack[currentPtr].getGroup() == - TreeBuilder.TEMPLATE) { - errNonSpaceInColgroupInFragment(); - start = i + 1; - continue; - } - flushCharacters(); - pop(); - mode = IN_TABLE; - i--; - continue; - case IN_SELECT: - case IN_SELECT_IN_TABLE: - break charactersloop; - case AFTER_BODY: - errNonSpaceAfterBody(); - fatal(); - mode = framesetOk ? FRAMESET_OK : IN_BODY; - i--; - continue; - case IN_FRAMESET: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - // start index is adjusted below. - } - /* - * Parse error. - */ - errNonSpaceInFrameset(); - /* - * Ignore the token. - */ - start = i + 1; - continue; - case AFTER_FRAMESET: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - // start index is adjusted below. - } - /* - * Parse error. - */ - errNonSpaceAfterFrameset(); - /* - * Ignore the token. - */ - start = i + 1; - continue; - case AFTER_AFTER_BODY: - /* - * Parse error. - */ - errNonSpaceInTrailer(); - /* - * Switch back to the main mode and - * reprocess the token. - */ - mode = framesetOk ? FRAMESET_OK : IN_BODY; - i--; - continue; - case AFTER_AFTER_FRAMESET: - if (start < i) { - accumulateCharacters(buf, start, i - - start); - // start index is adjusted below. - } - /* - * Parse error. - */ - errNonSpaceInTrailer(); - /* - * Ignore the token. - */ - start = i + 1; - continue; - } - } - } - if (start < end) { - accumulateCharacters(buf, start, end - start); - } - } - } - - /** - * @see nu.validator.htmlparser.common.TokenHandler#zeroOriginatingReplacementCharacter() - */ - public void zeroOriginatingReplacementCharacter() throws SAXException { - if (mode == TEXT) { - accumulateCharacters(REPLACEMENT_CHARACTER, 0, 1); - return; - } - if (currentPtr >= 0) { - if (isSpecialParentInForeign(stack[currentPtr])) { - return; - } - accumulateCharacters(REPLACEMENT_CHARACTER, 0, 1); - } - } - - public final void eof() throws SAXException { - flushCharacters(); - // Note: Can't attach error messages to EOF in C++ yet - eofloop: for (;;) { - switch (mode) { - case INITIAL: - /* - * Parse error. - */ - // [NOCPP[ - switch (doctypeExpectation) { - case AUTO: - err("End of file seen without seeing a doctype first. Expected e.g. \u201C<!DOCTYPE html>\u201D."); - break; - case HTML: - err("End of file seen without seeing a doctype first. Expected \u201C<!DOCTYPE html>\u201D."); - break; - case HTML401_STRICT: - err("End of file seen without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - break; - case HTML401_TRANSITIONAL: - err("End of file seen without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - break; - case NO_DOCTYPE_ERRORS: - } - // ]NOCPP] - /* - * - * Set the document to quirks mode. - */ - documentModeInternal(DocumentMode.QUIRKS_MODE, null, null, - false); - /* - * Then, switch to the root element mode of the tree - * construction stage - */ - mode = BEFORE_HTML; - /* - * and reprocess the current token. - */ - continue; - case BEFORE_HTML: - /* - * Create an HTMLElement node with the tag name html, in the - * HTML namespace. Append it to the Document object. - */ - appendHtmlElementToDocumentAndPush(); - // XXX application cache manifest - /* Switch to the main mode */ - mode = BEFORE_HEAD; - /* - * reprocess the current token. - */ - continue; - case BEFORE_HEAD: - appendToCurrentNodeAndPushHeadElement(HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_HEAD; - continue; - case IN_HEAD: - // [NOCPP[ - if (errorHandler != null && currentPtr > 1) { - errEofWithUnclosedElements(); - } - // ]NOCPP] - while (currentPtr > 0) { - popOnEof(); - } - mode = AFTER_HEAD; - continue; - case IN_HEAD_NOSCRIPT: - // [NOCPP[ - errEofWithUnclosedElements(); - // ]NOCPP] - while (currentPtr > 1) { - popOnEof(); - } - mode = IN_HEAD; - continue; - case AFTER_HEAD: - appendToCurrentNodeAndPushBodyElement(); - mode = IN_BODY; - continue; - case IN_TABLE_BODY: - case IN_ROW: - case IN_TABLE: - case IN_SELECT_IN_TABLE: - case IN_SELECT: - case IN_COLUMN_GROUP: - case FRAMESET_OK: - case IN_CAPTION: - case IN_CELL: - case IN_BODY: - // [NOCPP[ - // i > 0 to stop in time in the foreign fragment case. - openelementloop: for (int i = currentPtr; i > 0; i--) { - int group = stack[i].getGroup(); - switch (group) { - case DD_OR_DT: - case LI: - case P: - case TBODY_OR_THEAD_OR_TFOOT: - case TD_OR_TH: - case BODY: - case HTML: - break; - default: - errEofWithUnclosedElements(); - break openelementloop; - } - } - // ]NOCPP] - - if (isTemplateModeStackEmpty()) { - break eofloop; - } - - // fall through to IN_TEMPLATE - case IN_TEMPLATE: - int eltPos = findLast("template"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment; - break eofloop; - } - if (errorHandler != null) { - errUnclosedElements(eltPos, "template"); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - popTemplateMode(); - resetTheInsertionMode(); - - // Reprocess token. - continue; - case TEXT: - // [NOCPP[ - if (errorHandler != null) { - errNoCheck("End of file seen when expecting text or an end tag."); - errListUnclosedStartTags(0); - } - // ]NOCPP] - // XXX mark script as already executed - if (originalMode == AFTER_HEAD) { - popOnEof(); - } - popOnEof(); - mode = originalMode; - continue; - case IN_FRAMESET: - // [NOCPP[ - if (errorHandler != null && currentPtr > 0) { - errEofWithUnclosedElements(); - } - // ]NOCPP] - break eofloop; - case AFTER_BODY: - case AFTER_FRAMESET: - case AFTER_AFTER_BODY: - case AFTER_AFTER_FRAMESET: - default: - // [NOCPP[ - if (currentPtr == 0) { // This silliness is here to poison - // buggy compiler optimizations in - // GWT - System.currentTimeMillis(); - } - // ]NOCPP] - break eofloop; - } - } - while (currentPtr > 0) { - popOnEof(); - } - if (!fragment) { - popOnEof(); - } - /* Stop parsing. */ - } - - /** - * @see nu.validator.htmlparser.common.TokenHandler#endTokenization() - */ - public final void endTokenization() throws SAXException { - formPointer = null; - headPointer = null; - deepTreeSurrogateParent = null; - templateModeStack = null; - if (stack != null) { - while (currentPtr > -1) { - stack[currentPtr].release(); - currentPtr--; - } - stack = null; - } - if (listOfActiveFormattingElements != null) { - while (listPtr > -1) { - if (listOfActiveFormattingElements[listPtr] != null) { - listOfActiveFormattingElements[listPtr].release(); - } - listPtr--; - } - listOfActiveFormattingElements = null; - } - // [NOCPP[ - idLocations.clear(); - // ]NOCPP] - charBuffer = null; - end(); - } - - public final void startTag(ElementName elementName, - HtmlAttributes attributes, boolean selfClosing) throws SAXException { - flushCharacters(); - - // [NOCPP[ - if (errorHandler != null) { - // ID uniqueness - @IdType String id = attributes.getId(); - if (id != null) { - LocatorImpl oldLoc = idLocations.get(id); - if (oldLoc != null) { - err("Duplicate ID \u201C" + id + "\u201D."); - errorHandler.warning(new SAXParseException( - "The first occurrence of ID \u201C" + id - + "\u201D was here.", oldLoc)); - } else { - idLocations.put(id, new LocatorImpl(tokenizer)); - } - } - } - // ]NOCPP] - - int eltPos; - needToDropLF = false; - starttagloop: for (;;) { - int group = elementName.getGroup(); - @Local String name = elementName.name; - if (isInForeign()) { - StackNode<T> currentNode = stack[currentPtr]; - @NsUri String currNs = currentNode.ns; - if (!(currentNode.isHtmlIntegrationPoint() || (currNs == "http://www.w3.org/1998/Math/MathML" && ((currentNode.getGroup() == MI_MO_MN_MS_MTEXT && group != MGLYPH_OR_MALIGNMARK) || (currentNode.getGroup() == ANNOTATION_XML && group == SVG))))) { - switch (group) { - case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U: - case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU: - case BODY: - case BR: - case RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR: - case DD_OR_DT: - case UL_OR_OL_OR_DL: - case EMBED: - case IMG: - case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: - case HEAD: - case HR: - case LI: - case META: - case NOBR: - case P: - case PRE_OR_LISTING: - case TABLE: - case FONT: - // re-check FONT to deal with the special case - if (!(group == FONT && !(attributes.contains(AttributeName.COLOR) - || attributes.contains(AttributeName.FACE) || attributes.contains(AttributeName.SIZE)))) { - errHtmlStartTagInForeignContext(name); - if (!fragment) { - while (!isSpecialParentInForeign(stack[currentPtr])) { - pop(); - } - continue starttagloop; - } // else fall thru - } - // else fall thru - default: - if ("http://www.w3.org/2000/svg" == currNs) { - attributes.adjustForSvg(); - if (selfClosing) { - appendVoidElementToCurrentMayFosterSVG( - elementName, attributes); - selfClosing = false; - } else { - appendToCurrentNodeAndPushElementMayFosterSVG( - elementName, attributes); - } - attributes = null; // CPP - break starttagloop; - } else { - attributes.adjustForMath(); - if (selfClosing) { - appendVoidElementToCurrentMayFosterMathML( - elementName, attributes); - selfClosing = false; - } else { - appendToCurrentNodeAndPushElementMayFosterMathML( - elementName, attributes); - } - attributes = null; // CPP - break starttagloop; - } - } // switch - } // foreignObject / annotation-xml - } - switch (mode) { - case IN_TEMPLATE: - switch (group) { - case COL: - popTemplateMode(); - pushTemplateMode(IN_COLUMN_GROUP); - mode = IN_COLUMN_GROUP; - // Reprocess token. - continue; - case CAPTION: - case COLGROUP: - case TBODY_OR_THEAD_OR_TFOOT: - popTemplateMode(); - pushTemplateMode(IN_TABLE); - mode = IN_TABLE; - // Reprocess token. - continue; - case TR: - popTemplateMode(); - pushTemplateMode(IN_TABLE_BODY); - mode = IN_TABLE_BODY; - // Reprocess token. - continue; - case TD_OR_TH: - popTemplateMode(); - pushTemplateMode(IN_ROW); - mode = IN_ROW; - // Reprocess token. - continue; - case META: - checkMetaCharset(attributes); - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case TITLE: - startTagTitleInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case BASE: - case LINK_OR_BASEFONT_OR_BGSOUND: - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case SCRIPT: - startTagScriptInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case NOFRAMES: - case STYLE: - startTagGenericRawText(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case TEMPLATE: - startTagTemplateInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - default: - popTemplateMode(); - pushTemplateMode(IN_BODY); - mode = IN_BODY; - // Reprocess token. - continue; - } - case IN_ROW: - switch (group) { - case TD_OR_TH: - clearStackBackTo(findLastOrRoot(TreeBuilder.TR)); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_CELL; - insertMarker(); - attributes = null; // CPP - break starttagloop; - case CAPTION: - case COL: - case COLGROUP: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - eltPos = findLastOrRoot(TreeBuilder.TR); - if (eltPos == 0) { - assert fragment || isTemplateContents(); - errNoTableRowToClose(); - break starttagloop; - } - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE_BODY; - continue; - default: - // fall through to IN_TABLE - } - case IN_TABLE_BODY: - switch (group) { - case TR: - clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot()); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_ROW; - attributes = null; // CPP - break starttagloop; - case TD_OR_TH: - errStartTagInTableBody(name); - clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot()); - appendToCurrentNodeAndPushElement( - ElementName.TR, - HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_ROW; - continue; - case CAPTION: - case COL: - case COLGROUP: - case TBODY_OR_THEAD_OR_TFOOT: - eltPos = findLastInTableScopeOrRootTemplateTbodyTheadTfoot(); - if (eltPos == 0 || stack[eltPos].getGroup() == TEMPLATE) { - assert fragment || isTemplateContents(); - errStrayStartTag(name); - break starttagloop; - } else { - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE; - continue; - } - default: - // fall through to IN_TABLE - } - case IN_TABLE: - intableloop: for (;;) { - switch (group) { - case CAPTION: - clearStackBackTo(findLastOrRoot(TreeBuilder.TABLE)); - insertMarker(); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_CAPTION; - attributes = null; // CPP - break starttagloop; - case COLGROUP: - clearStackBackTo(findLastOrRoot(TreeBuilder.TABLE)); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_COLUMN_GROUP; - attributes = null; // CPP - break starttagloop; - case COL: - clearStackBackTo(findLastOrRoot(TreeBuilder.TABLE)); - appendToCurrentNodeAndPushElement( - ElementName.COLGROUP, - HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_COLUMN_GROUP; - continue starttagloop; - case TBODY_OR_THEAD_OR_TFOOT: - clearStackBackTo(findLastOrRoot(TreeBuilder.TABLE)); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_TABLE_BODY; - attributes = null; // CPP - break starttagloop; - case TR: - case TD_OR_TH: - clearStackBackTo(findLastOrRoot(TreeBuilder.TABLE)); - appendToCurrentNodeAndPushElement( - ElementName.TBODY, - HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_TABLE_BODY; - continue starttagloop; - case TEMPLATE: - // fall through to IN_HEAD - break intableloop; - case TABLE: - errTableSeenWhileTableOpen(); - eltPos = findLastInTableScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment || isTemplateContents(); - break starttagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent("table")) { - errNoCheckUnclosedElementsOnStack(); - } - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - continue starttagloop; - case SCRIPT: - // XXX need to manage much more stuff - // here if - // supporting - // document.write() - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.SCRIPT_DATA, elementName); - attributes = null; // CPP - break starttagloop; - case STYLE: - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RAWTEXT, elementName); - attributes = null; // CPP - break starttagloop; - case INPUT: - errStartTagInTable(name); - if (!Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "hidden", - attributes.getValue(AttributeName.TYPE))) { - break intableloop; - } - appendVoidElementToCurrent( - name, attributes, - formPointer); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case FORM: - if (formPointer != null || isTemplateContents()) { - errFormWhenFormOpen(); - break starttagloop; - } else { - errStartTagInTable(name); - appendVoidFormToCurrent(attributes); - attributes = null; // CPP - break starttagloop; - } - default: - errStartTagInTable(name); - // fall through to IN_BODY - break intableloop; - } - } - case IN_CAPTION: - switch (group) { - case CAPTION: - case COL: - case COLGROUP: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - case TD_OR_TH: - errStrayStartTag(name); - eltPos = findLastInTableScope("caption"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - break starttagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && currentPtr != eltPos) { - errNoCheckUnclosedElementsOnStack(); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - mode = IN_TABLE; - continue; - default: - // fall through to IN_BODY - } - case IN_CELL: - switch (group) { - case CAPTION: - case COL: - case COLGROUP: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - case TD_OR_TH: - eltPos = findLastInTableScopeTdTh(); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errNoCellToClose(); - break starttagloop; - } else { - closeTheCell(eltPos); - continue; - } - default: - // fall through to IN_BODY - } - case FRAMESET_OK: - switch (group) { - case FRAMESET: - if (mode == FRAMESET_OK) { - if (currentPtr == 0 || stack[1].getGroup() != BODY) { - assert fragment || isTemplateContents(); - errStrayStartTag(name); - break starttagloop; - } else { - errFramesetStart(); - detachFromParent(stack[1].node); - while (currentPtr > 0) { - pop(); - } - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_FRAMESET; - attributes = null; // CPP - break starttagloop; - } - } else { - errStrayStartTag(name); - break starttagloop; - } - // NOT falling through! - case PRE_OR_LISTING: - case LI: - case DD_OR_DT: - case BUTTON: - case MARQUEE_OR_APPLET: - case OBJECT: - case TABLE: - case AREA_OR_WBR: - case BR: - case EMBED: - case IMG: - case INPUT: - case KEYGEN: - case HR: - case TEXTAREA: - case XMP: - case IFRAME: - case SELECT: - if (mode == FRAMESET_OK - && !(group == INPUT && Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "hidden", - attributes.getValue(AttributeName.TYPE)))) { - framesetOk = false; - mode = IN_BODY; - } - // fall through to IN_BODY - default: - // fall through to IN_BODY - } - case IN_BODY: - inbodyloop: for (;;) { - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case BASE: - case LINK_OR_BASEFONT_OR_BGSOUND: - case META: - case STYLE: - case SCRIPT: - case TITLE: - case TEMPLATE: - // Fall through to IN_HEAD - break inbodyloop; - case BODY: - if (currentPtr == 0 || stack[1].getGroup() != BODY || isTemplateContents()) { - assert fragment || isTemplateContents(); - errStrayStartTag(name); - break starttagloop; - } - errFooSeenWhenFooOpen(name); - framesetOk = false; - if (mode == FRAMESET_OK) { - mode = IN_BODY; - } - if (addAttributesToBody(attributes)) { - attributes = null; // CPP - } - break starttagloop; - case P: - case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU: - case UL_OR_OL_OR_DL: - case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: - implicitlyCloseP(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: - implicitlyCloseP(); - if (stack[currentPtr].getGroup() == H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) { - errHeadingWhenHeadingOpen(); - pop(); - } - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case FIELDSET: - implicitlyCloseP(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes, formPointer); - attributes = null; // CPP - break starttagloop; - case PRE_OR_LISTING: - implicitlyCloseP(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - needToDropLF = true; - attributes = null; // CPP - break starttagloop; - case FORM: - if (formPointer != null && !isTemplateContents()) { - errFormWhenFormOpen(); - break starttagloop; - } else { - implicitlyCloseP(); - appendToCurrentNodeAndPushFormElementMayFoster(attributes); - attributes = null; // CPP - break starttagloop; - } - case LI: - case DD_OR_DT: - eltPos = currentPtr; - for (;;) { - StackNode<T> node = stack[eltPos]; // weak - // ref - if (node.getGroup() == group) { // LI or - // DD_OR_DT - generateImpliedEndTagsExceptFor(node.name); - if (errorHandler != null - && eltPos != currentPtr) { - errUnclosedElementsImplied(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - break; - } else if (eltPos == 0 || (node.isSpecial() - && (node.ns != "http://www.w3.org/1999/xhtml" - || (node.name != "p" - && node.name != "address" - && node.name != "div")))) { - break; - } - eltPos--; - } - implicitlyCloseP(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case PLAINTEXT: - implicitlyCloseP(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - tokenizer.setStateAndEndTagExpectation( - Tokenizer.PLAINTEXT, elementName); - attributes = null; // CPP - break starttagloop; - case A: - int activeAPos = findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker("a"); - if (activeAPos != -1) { - errFooSeenWhenFooOpen(name); - StackNode<T> activeA = listOfActiveFormattingElements[activeAPos]; - activeA.retain(); - adoptionAgencyEndTag("a"); - removeFromStack(activeA); - activeAPos = findInListOfActiveFormattingElements(activeA); - if (activeAPos != -1) { - removeFromListOfActiveFormattingElements(activeAPos); - } - activeA.release(); - } - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushFormattingElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U: - case FONT: - reconstructTheActiveFormattingElements(); - maybeForgetEarlierDuplicateFormattingElement(elementName.name, attributes); - appendToCurrentNodeAndPushFormattingElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case NOBR: - reconstructTheActiveFormattingElements(); - if (TreeBuilder.NOT_FOUND_ON_STACK != findLastInScope("nobr")) { - errFooSeenWhenFooOpen(name); - adoptionAgencyEndTag("nobr"); - reconstructTheActiveFormattingElements(); - } - appendToCurrentNodeAndPushFormattingElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case BUTTON: - eltPos = findLastInScope(name); - if (eltPos != TreeBuilder.NOT_FOUND_ON_STACK) { - errFooSeenWhenFooOpen(name); - generateImpliedEndTags(); - if (errorHandler != null - && !isCurrent(name)) { - errUnclosedElementsImplied(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - continue starttagloop; - } else { - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes, formPointer); - attributes = null; // CPP - break starttagloop; - } - case OBJECT: - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes, formPointer); - insertMarker(); - attributes = null; // CPP - break starttagloop; - case MARQUEE_OR_APPLET: - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - insertMarker(); - attributes = null; // CPP - break starttagloop; - case TABLE: - // The only quirk. Blame Hixie and - // Acid2. - if (!quirks) { - implicitlyCloseP(); - } - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - mode = IN_TABLE; - attributes = null; // CPP - break starttagloop; - case BR: - case EMBED: - case AREA_OR_WBR: - reconstructTheActiveFormattingElements(); - // FALL THROUGH to PARAM_OR_SOURCE_OR_TRACK - // CPPONLY: case MENUITEM: - case PARAM_OR_SOURCE_OR_TRACK: - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case HR: - implicitlyCloseP(); - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case IMAGE: - errImage(); - elementName = ElementName.IMG; - continue starttagloop; - case IMG: - case KEYGEN: - case INPUT: - reconstructTheActiveFormattingElements(); - appendVoidElementToCurrentMayFoster( - name, attributes, - formPointer); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case ISINDEX: - errIsindex(); - if (formPointer != null && !isTemplateContents()) { - break starttagloop; - } - implicitlyCloseP(); - HtmlAttributes formAttrs = new HtmlAttributes(0); - int actionIndex = attributes.getIndex(AttributeName.ACTION); - if (actionIndex > -1) { - formAttrs.addAttribute( - AttributeName.ACTION, - attributes.getValueNoBoundsCheck(actionIndex) - // [NOCPP[ - , XmlViolationPolicy.ALLOW - // ]NOCPP] - // CPPONLY: , attributes.getLineNoBoundsCheck(actionIndex) - ); - } - appendToCurrentNodeAndPushFormElementMayFoster(formAttrs); - appendVoidElementToCurrentMayFoster( - ElementName.HR, - HtmlAttributes.EMPTY_ATTRIBUTES); - appendToCurrentNodeAndPushElementMayFoster( - ElementName.LABEL, - HtmlAttributes.EMPTY_ATTRIBUTES); - int promptIndex = attributes.getIndex(AttributeName.PROMPT); - if (promptIndex > -1) { - @Auto char[] prompt = Portability.newCharArrayFromString(attributes.getValueNoBoundsCheck(promptIndex)); - appendCharacters(stack[currentPtr].node, - prompt, 0, prompt.length); - } else { - appendIsindexPrompt(stack[currentPtr].node); - } - HtmlAttributes inputAttributes = new HtmlAttributes( - 0); - inputAttributes.addAttribute( - AttributeName.NAME, - Portability.newStringFromLiteral("isindex") - // [NOCPP[ - , XmlViolationPolicy.ALLOW - // ]NOCPP] - // CPPONLY: , tokenizer.getLineNumber() - ); - for (int i = 0; i < attributes.getLength(); i++) { - AttributeName attributeQName = attributes.getAttributeNameNoBoundsCheck(i); - if (AttributeName.NAME == attributeQName - || AttributeName.PROMPT == attributeQName) { - attributes.releaseValue(i); - } else if (AttributeName.ACTION != attributeQName) { - inputAttributes.addAttribute( - attributeQName, - attributes.getValueNoBoundsCheck(i) - // [NOCPP[ - , XmlViolationPolicy.ALLOW - // ]NOCPP] - // CPPONLY: , attributes.getLineNoBoundsCheck(i) - ); - } - } - attributes.clearWithoutReleasingContents(); - appendVoidElementToCurrentMayFoster( - "input", - inputAttributes, formPointer); - pop(); // label - appendVoidElementToCurrentMayFoster( - ElementName.HR, - HtmlAttributes.EMPTY_ATTRIBUTES); - pop(); // form - - if (!isTemplateContents()) { - formPointer = null; - } - - selfClosing = false; - // Portability.delete(formAttrs); - // Portability.delete(inputAttributes); - // Don't delete attributes, they are deleted - // later - break starttagloop; - case TEXTAREA: - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes, formPointer); - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RCDATA, elementName); - originalMode = mode; - mode = TEXT; - needToDropLF = true; - attributes = null; // CPP - break starttagloop; - case XMP: - implicitlyCloseP(); - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RAWTEXT, elementName); - attributes = null; // CPP - break starttagloop; - case NOSCRIPT: - if (!scriptingEnabled) { - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - } else { - // fall through - } - case NOFRAMES: - case IFRAME: - case NOEMBED: - startTagGenericRawText(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case SELECT: - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes, formPointer); - switch (mode) { - case IN_TABLE: - case IN_CAPTION: - case IN_COLUMN_GROUP: - case IN_TABLE_BODY: - case IN_ROW: - case IN_CELL: - mode = IN_SELECT_IN_TABLE; - break; - default: - mode = IN_SELECT; - break; - } - attributes = null; // CPP - break starttagloop; - case OPTGROUP: - case OPTION: - if (isCurrent("option")) { - pop(); - } - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case RB_OR_RTC: - eltPos = findLastInScope("ruby"); - if (eltPos != NOT_FOUND_ON_STACK) { - generateImpliedEndTags(); - } - if (eltPos != currentPtr) { - if (eltPos == NOT_FOUND_ON_STACK) { - errStartTagSeenWithoutRuby(name); - } else { - errUnclosedChildrenInRuby(); - } - } - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case RT_OR_RP: - eltPos = findLastInScope("ruby"); - if (eltPos != NOT_FOUND_ON_STACK) { - generateImpliedEndTagsExceptFor("rtc"); - } - if (eltPos != currentPtr) { - if (!isCurrent("rtc")) { - if (eltPos == NOT_FOUND_ON_STACK) { - errStartTagSeenWithoutRuby(name); - } else { - errUnclosedChildrenInRuby(); - } - } - } - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case MATH: - reconstructTheActiveFormattingElements(); - attributes.adjustForMath(); - if (selfClosing) { - appendVoidElementToCurrentMayFosterMathML( - elementName, attributes); - selfClosing = false; - } else { - appendToCurrentNodeAndPushElementMayFosterMathML( - elementName, attributes); - } - attributes = null; // CPP - break starttagloop; - case SVG: - reconstructTheActiveFormattingElements(); - attributes.adjustForSvg(); - if (selfClosing) { - appendVoidElementToCurrentMayFosterSVG( - elementName, - attributes); - selfClosing = false; - } else { - appendToCurrentNodeAndPushElementMayFosterSVG( - elementName, attributes); - } - attributes = null; // CPP - break starttagloop; - case CAPTION: - case COL: - case COLGROUP: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - case TD_OR_TH: - case FRAME: - case FRAMESET: - case HEAD: - errStrayStartTag(name); - break starttagloop; - case OUTPUT: - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes, formPointer); - attributes = null; // CPP - break starttagloop; - default: - reconstructTheActiveFormattingElements(); - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - } - } - case IN_HEAD: - inheadloop: for (;;) { - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case BASE: - case LINK_OR_BASEFONT_OR_BGSOUND: - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case META: - // Fall through to IN_HEAD_NOSCRIPT - break inheadloop; - case TITLE: - startTagTitleInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case NOSCRIPT: - if (scriptingEnabled) { - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RAWTEXT, elementName); - } else { - appendToCurrentNodeAndPushElementMayFoster( - elementName, - attributes); - mode = IN_HEAD_NOSCRIPT; - } - attributes = null; // CPP - break starttagloop; - case SCRIPT: - startTagScriptInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case STYLE: - case NOFRAMES: - startTagGenericRawText(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case HEAD: - /* Parse error. */ - errFooSeenWhenFooOpen(name); - /* Ignore the token. */ - break starttagloop; - case TEMPLATE: - startTagTemplateInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - default: - pop(); - mode = AFTER_HEAD; - continue starttagloop; - } - } - case IN_HEAD_NOSCRIPT: - switch (group) { - case HTML: - // XXX did Hixie really mean to omit "base" - // here? - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case LINK_OR_BASEFONT_OR_BGSOUND: - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case META: - checkMetaCharset(attributes); - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case STYLE: - case NOFRAMES: - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RAWTEXT, elementName); - attributes = null; // CPP - break starttagloop; - case HEAD: - errFooSeenWhenFooOpen(name); - break starttagloop; - case NOSCRIPT: - errFooSeenWhenFooOpen(name); - break starttagloop; - default: - errBadStartTagInHead(name); - pop(); - mode = IN_HEAD; - continue; - } - case IN_COLUMN_GROUP: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case COL: - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - case TEMPLATE: - startTagTemplateInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - default: - if (currentPtr == 0 || stack[currentPtr].getGroup() == TEMPLATE) { - assert fragment || isTemplateContents(); - errGarbageInColgroup(); - break starttagloop; - } - pop(); - mode = IN_TABLE; - continue; - } - case IN_SELECT_IN_TABLE: - switch (group) { - case CAPTION: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - case TD_OR_TH: - case TABLE: - errStartTagWithSelectOpen(name); - eltPos = findLastInTableScope("select"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment; - break starttagloop; // http://www.w3.org/Bugs/Public/show_bug.cgi?id=8375 - } - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - continue; - default: - // fall through to IN_SELECT - } - case IN_SELECT: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case OPTION: - if (isCurrent("option")) { - pop(); - } - appendToCurrentNodeAndPushElement( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case OPTGROUP: - if (isCurrent("option")) { - pop(); - } - if (isCurrent("optgroup")) { - pop(); - } - appendToCurrentNodeAndPushElement( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case SELECT: - errStartSelectWhereEndSelectExpected(); - eltPos = findLastInTableScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment; - errNoSelectInTableScope(); - break starttagloop; - } else { - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - break starttagloop; - } - case INPUT: - case TEXTAREA: - case KEYGEN: - errStartTagWithSelectOpen(name); - eltPos = findLastInTableScope("select"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment; - break starttagloop; - } - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - continue; - case SCRIPT: - startTagScriptInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - case TEMPLATE: - startTagTemplateInHead(elementName, attributes); - attributes = null; // CPP - break starttagloop; - default: - errStrayStartTag(name); - break starttagloop; - } - case AFTER_BODY: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - default: - errStrayStartTag(name); - mode = framesetOk ? FRAMESET_OK : IN_BODY; - continue; - } - case IN_FRAMESET: - switch (group) { - case FRAMESET: - appendToCurrentNodeAndPushElement( - elementName, - attributes); - attributes = null; // CPP - break starttagloop; - case FRAME: - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - attributes = null; // CPP - break starttagloop; - default: - // fall through to AFTER_FRAMESET - } - case AFTER_FRAMESET: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case NOFRAMES: - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RAWTEXT, elementName); - attributes = null; // CPP - break starttagloop; - default: - errStrayStartTag(name); - break starttagloop; - } - case INITIAL: - /* - * Parse error. - */ - // [NOCPP[ - switch (doctypeExpectation) { - case AUTO: - err("Start tag seen without seeing a doctype first. Expected e.g. \u201C<!DOCTYPE html>\u201D."); - break; - case HTML: - // ]NOCPP] - errStartTagWithoutDoctype(); - // [NOCPP[ - break; - case HTML401_STRICT: - err("Start tag seen without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - break; - case HTML401_TRANSITIONAL: - err("Start tag seen without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - break; - case NO_DOCTYPE_ERRORS: - } - // ]NOCPP] - /* - * - * Set the document to quirks mode. - */ - documentModeInternal(DocumentMode.QUIRKS_MODE, null, null, - false); - /* - * Then, switch to the root element mode of the tree - * construction stage - */ - mode = BEFORE_HTML; - /* - * and reprocess the current token. - */ - continue; - case BEFORE_HTML: - switch (group) { - case HTML: - // optimize error check and streaming SAX by - // hoisting - // "html" handling here. - if (attributes == HtmlAttributes.EMPTY_ATTRIBUTES) { - // This has the right magic side effect - // that - // it - // makes attributes in SAX Tree mutable. - appendHtmlElementToDocumentAndPush(); - } else { - appendHtmlElementToDocumentAndPush(attributes); - } - // XXX application cache should fire here - mode = BEFORE_HEAD; - attributes = null; // CPP - break starttagloop; - default: - /* - * Create an HTMLElement node with the tag name - * html, in the HTML namespace. Append it to the - * Document object. - */ - appendHtmlElementToDocumentAndPush(); - /* Switch to the main mode */ - mode = BEFORE_HEAD; - /* - * reprocess the current token. - */ - continue; - } - case BEFORE_HEAD: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case HEAD: - /* - * A start tag whose tag name is "head" - * - * Create an element for the token. - * - * Set the head element pointer to this new element - * node. - * - * Append the new element to the current node and - * push it onto the stack of open elements. - */ - appendToCurrentNodeAndPushHeadElement(attributes); - /* - * Change the insertion mode to "in head". - */ - mode = IN_HEAD; - attributes = null; // CPP - break starttagloop; - default: - /* - * Any other start tag token - * - * Act as if a start tag token with the tag name - * "head" and no attributes had been seen, - */ - appendToCurrentNodeAndPushHeadElement(HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_HEAD; - /* - * then reprocess the current token. - * - * This will result in an empty head element being - * generated, with the current token being - * reprocessed in the "after head" insertion mode. - */ - continue; - } - case AFTER_HEAD: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case BODY: - if (attributes.getLength() == 0) { - // This has the right magic side effect - // that - // it - // makes attributes in SAX Tree mutable. - appendToCurrentNodeAndPushBodyElement(); - } else { - appendToCurrentNodeAndPushBodyElement(attributes); - } - framesetOk = false; - mode = IN_BODY; - attributes = null; // CPP - break starttagloop; - case FRAMESET: - appendToCurrentNodeAndPushElement( - elementName, - attributes); - mode = IN_FRAMESET; - attributes = null; // CPP - break starttagloop; - case TEMPLATE: - errFooBetweenHeadAndBody(name); - pushHeadPointerOntoStack(); - StackNode<T> headOnStack = stack[currentPtr]; - startTagTemplateInHead(elementName, attributes); - removeFromStack(headOnStack); - attributes = null; // CPP - break starttagloop; - case BASE: - case LINK_OR_BASEFONT_OR_BGSOUND: - errFooBetweenHeadAndBody(name); - pushHeadPointerOntoStack(); - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - pop(); // head - attributes = null; // CPP - break starttagloop; - case META: - errFooBetweenHeadAndBody(name); - checkMetaCharset(attributes); - pushHeadPointerOntoStack(); - appendVoidElementToCurrentMayFoster( - elementName, - attributes); - selfClosing = false; - pop(); // head - attributes = null; // CPP - break starttagloop; - case SCRIPT: - errFooBetweenHeadAndBody(name); - pushHeadPointerOntoStack(); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.SCRIPT_DATA, elementName); - attributes = null; // CPP - break starttagloop; - case STYLE: - case NOFRAMES: - errFooBetweenHeadAndBody(name); - pushHeadPointerOntoStack(); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RAWTEXT, elementName); - attributes = null; // CPP - break starttagloop; - case TITLE: - errFooBetweenHeadAndBody(name); - pushHeadPointerOntoStack(); - appendToCurrentNodeAndPushElement( - elementName, - attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation( - Tokenizer.RCDATA, elementName); - attributes = null; // CPP - break starttagloop; - case HEAD: - errStrayStartTag(name); - break starttagloop; - default: - appendToCurrentNodeAndPushBodyElement(); - mode = FRAMESET_OK; - continue; - } - case AFTER_AFTER_BODY: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - default: - errStrayStartTag(name); - fatal(); - mode = framesetOk ? FRAMESET_OK : IN_BODY; - continue; - } - case AFTER_AFTER_FRAMESET: - switch (group) { - case HTML: - errStrayStartTag(name); - if (!fragment && !isTemplateContents()) { - addAttributesToHtml(attributes); - attributes = null; // CPP - } - break starttagloop; - case NOFRAMES: - startTagGenericRawText(elementName, attributes); - attributes = null; // CPP - break starttagloop; - default: - errStrayStartTag(name); - break starttagloop; - } - case TEXT: - assert false; - break starttagloop; // Avoid infinite loop if the assertion - // fails - } - } - if (selfClosing) { - errSelfClosing(); - } - // CPPONLY: if (mBuilder == null && attributes != HtmlAttributes.EMPTY_ATTRIBUTES) { - // CPPONLY: Portability.delete(attributes); - // CPPONLY: } - } - - private void startTagTitleInHead(ElementName elementName, HtmlAttributes attributes) throws SAXException { - appendToCurrentNodeAndPushElementMayFoster(elementName, attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation(Tokenizer.RCDATA, elementName); - } - - private void startTagGenericRawText(ElementName elementName, HtmlAttributes attributes) throws SAXException { - appendToCurrentNodeAndPushElementMayFoster(elementName, attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation(Tokenizer.RAWTEXT, elementName); - } - - private void startTagScriptInHead(ElementName elementName, HtmlAttributes attributes) throws SAXException { - // XXX need to manage much more stuff here if supporting document.write() - appendToCurrentNodeAndPushElementMayFoster(elementName, attributes); - originalMode = mode; - mode = TEXT; - tokenizer.setStateAndEndTagExpectation(Tokenizer.SCRIPT_DATA, elementName); - } - - private void startTagTemplateInHead(ElementName elementName, HtmlAttributes attributes) throws SAXException { - appendToCurrentNodeAndPushElement(elementName, attributes); - insertMarker(); - framesetOk = false; - originalMode = mode; - mode = IN_TEMPLATE; - pushTemplateMode(IN_TEMPLATE); - } - - private boolean isTemplateContents() { - return TreeBuilder.NOT_FOUND_ON_STACK != findLast("template"); - } - - private boolean isTemplateModeStackEmpty() { - return templateModePtr == -1; - } - - private boolean isSpecialParentInForeign(StackNode<T> stackNode) { - @NsUri String ns = stackNode.ns; - return ("http://www.w3.org/1999/xhtml" == ns) - || (stackNode.isHtmlIntegrationPoint()) - || (("http://www.w3.org/1998/Math/MathML" == ns) && (stackNode.getGroup() == MI_MO_MN_MS_MTEXT)); - } - - /** - * - * <p> - * C++ memory note: The return value must be released. - * - * @return - * @throws SAXException - * @throws StopSniffingException - */ - public static String extractCharsetFromContent(String attributeValue - // CPPONLY: , TreeBuilder tb - ) { - // This is a bit ugly. Converting the string to char array in order to - // make the portability layer smaller. - int charsetState = CHARSET_INITIAL; - int start = -1; - int end = -1; - @Auto char[] buffer = Portability.newCharArrayFromString(attributeValue); - - charsetloop: for (int i = 0; i < buffer.length; i++) { - char c = buffer[i]; - switch (charsetState) { - case CHARSET_INITIAL: - switch (c) { - case 'c': - case 'C': - charsetState = CHARSET_C; - continue; - default: - continue; - } - case CHARSET_C: - switch (c) { - case 'h': - case 'H': - charsetState = CHARSET_H; - continue; - default: - charsetState = CHARSET_INITIAL; - continue; - } - case CHARSET_H: - switch (c) { - case 'a': - case 'A': - charsetState = CHARSET_A; - continue; - default: - charsetState = CHARSET_INITIAL; - continue; - } - case CHARSET_A: - switch (c) { - case 'r': - case 'R': - charsetState = CHARSET_R; - continue; - default: - charsetState = CHARSET_INITIAL; - continue; - } - case CHARSET_R: - switch (c) { - case 's': - case 'S': - charsetState = CHARSET_S; - continue; - default: - charsetState = CHARSET_INITIAL; - continue; - } - case CHARSET_S: - switch (c) { - case 'e': - case 'E': - charsetState = CHARSET_E; - continue; - default: - charsetState = CHARSET_INITIAL; - continue; - } - case CHARSET_E: - switch (c) { - case 't': - case 'T': - charsetState = CHARSET_T; - continue; - default: - charsetState = CHARSET_INITIAL; - continue; - } - case CHARSET_T: - switch (c) { - case '\t': - case '\n': - case '\u000C': - case '\r': - case ' ': - continue; - case '=': - charsetState = CHARSET_EQUALS; - continue; - default: - return null; - } - case CHARSET_EQUALS: - switch (c) { - case '\t': - case '\n': - case '\u000C': - case '\r': - case ' ': - continue; - case '\'': - start = i + 1; - charsetState = CHARSET_SINGLE_QUOTED; - continue; - case '\"': - start = i + 1; - charsetState = CHARSET_DOUBLE_QUOTED; - continue; - default: - start = i; - charsetState = CHARSET_UNQUOTED; - continue; - } - case CHARSET_SINGLE_QUOTED: - switch (c) { - case '\'': - end = i; - break charsetloop; - default: - continue; - } - case CHARSET_DOUBLE_QUOTED: - switch (c) { - case '\"': - end = i; - break charsetloop; - default: - continue; - } - case CHARSET_UNQUOTED: - switch (c) { - case '\t': - case '\n': - case '\u000C': - case '\r': - case ' ': - case ';': - end = i; - break charsetloop; - default: - continue; - } - } - } - String charset = null; - if (start != -1) { - if (end == -1) { - end = buffer.length; - } - charset = Portability.newStringFromBuffer(buffer, start, end - - start - // CPPONLY: , tb - ); - } - return charset; - } - - private void checkMetaCharset(HtmlAttributes attributes) - throws SAXException { - String charset = attributes.getValue(AttributeName.CHARSET); - if (charset != null) { - if (tokenizer.internalEncodingDeclaration(charset)) { - requestSuspension(); - return; - } - return; - } - if (!Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "content-type", - attributes.getValue(AttributeName.HTTP_EQUIV))) { - return; - } - String content = attributes.getValue(AttributeName.CONTENT); - if (content != null) { - String extract = TreeBuilder.extractCharsetFromContent(content - // CPPONLY: , this - ); - // remember not to return early without releasing the string - if (extract != null) { - if (tokenizer.internalEncodingDeclaration(extract)) { - requestSuspension(); - } - } - Portability.releaseString(extract); - } - } - - public final void endTag(ElementName elementName) throws SAXException { - flushCharacters(); - needToDropLF = false; - int eltPos; - int group = elementName.getGroup(); - @Local String name = elementName.name; - endtagloop: for (;;) { - if (isInForeign()) { - if (stack[currentPtr].name != name) { - if (currentPtr == 0) { - errStrayEndTag(name); - } else { - errEndTagDidNotMatchCurrentOpenElement(name, stack[currentPtr].popName); - } - } - eltPos = currentPtr; - for (;;) { - if (eltPos == 0) { - assert fragment: "We can get this close to the root of the stack in foreign content only in the fragment case."; - break endtagloop; - } - if (stack[eltPos].name == name) { - while (currentPtr >= eltPos) { - pop(); - } - break endtagloop; - } - if (stack[--eltPos].ns == "http://www.w3.org/1999/xhtml") { - break; - } - } - } - switch (mode) { - case IN_TEMPLATE: - switch (group) { - case TEMPLATE: - // fall through to IN_HEAD - break; - default: - errStrayEndTag(name); - break endtagloop; - } - case IN_ROW: - switch (group) { - case TR: - eltPos = findLastOrRoot(TreeBuilder.TR); - if (eltPos == 0) { - assert fragment || isTemplateContents(); - errNoTableRowToClose(); - break endtagloop; - } - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE_BODY; - break endtagloop; - case TABLE: - eltPos = findLastOrRoot(TreeBuilder.TR); - if (eltPos == 0) { - assert fragment || isTemplateContents(); - errNoTableRowToClose(); - break endtagloop; - } - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE_BODY; - continue; - case TBODY_OR_THEAD_OR_TFOOT: - if (findLastInTableScope(name) == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - break endtagloop; - } - eltPos = findLastOrRoot(TreeBuilder.TR); - if (eltPos == 0) { - assert fragment || isTemplateContents(); - errNoTableRowToClose(); - break endtagloop; - } - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE_BODY; - continue; - case BODY: - case CAPTION: - case COL: - case COLGROUP: - case HTML: - case TD_OR_TH: - errStrayEndTag(name); - break endtagloop; - default: - // fall through to IN_TABLE - } - case IN_TABLE_BODY: - switch (group) { - case TBODY_OR_THEAD_OR_TFOOT: - eltPos = findLastOrRoot(name); - if (eltPos == 0) { - errStrayEndTag(name); - break endtagloop; - } - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE; - break endtagloop; - case TABLE: - eltPos = findLastInTableScopeOrRootTemplateTbodyTheadTfoot(); - if (eltPos == 0 || stack[eltPos].getGroup() == TEMPLATE) { - assert fragment || isTemplateContents(); - errStrayEndTag(name); - break endtagloop; - } - clearStackBackTo(eltPos); - pop(); - mode = IN_TABLE; - continue; - case BODY: - case CAPTION: - case COL: - case COLGROUP: - case HTML: - case TD_OR_TH: - case TR: - errStrayEndTag(name); - break endtagloop; - default: - // fall through to IN_TABLE - } - case IN_TABLE: - switch (group) { - case TABLE: - eltPos = findLast("table"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment || isTemplateContents(); - errStrayEndTag(name); - break endtagloop; - } - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - break endtagloop; - case BODY: - case CAPTION: - case COL: - case COLGROUP: - case HTML: - case TBODY_OR_THEAD_OR_TFOOT: - case TD_OR_TH: - case TR: - errStrayEndTag(name); - break endtagloop; - case TEMPLATE: - // fall through to IN_HEAD - break; - default: - errStrayEndTag(name); - // fall through to IN_BODY - } - case IN_CAPTION: - switch (group) { - case CAPTION: - eltPos = findLastInTableScope("caption"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - break endtagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && currentPtr != eltPos) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - mode = IN_TABLE; - break endtagloop; - case TABLE: - errTableClosedWhileCaptionOpen(); - eltPos = findLastInTableScope("caption"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - break endtagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && currentPtr != eltPos) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - mode = IN_TABLE; - continue; - case BODY: - case COL: - case COLGROUP: - case HTML: - case TBODY_OR_THEAD_OR_TFOOT: - case TD_OR_TH: - case TR: - errStrayEndTag(name); - break endtagloop; - default: - // fall through to IN_BODY - } - case IN_CELL: - switch (group) { - case TD_OR_TH: - eltPos = findLastInTableScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - break endtagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - mode = IN_ROW; - break endtagloop; - case TABLE: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - if (findLastInTableScope(name) == TreeBuilder.NOT_FOUND_ON_STACK) { - assert name == "tbody" || name == "tfoot" || name == "thead" || fragment || isTemplateContents(); - errStrayEndTag(name); - break endtagloop; - } - closeTheCell(findLastInTableScopeTdTh()); - continue; - case BODY: - case CAPTION: - case COL: - case COLGROUP: - case HTML: - errStrayEndTag(name); - break endtagloop; - default: - // fall through to IN_BODY - } - case FRAMESET_OK: - case IN_BODY: - switch (group) { - case BODY: - if (!isSecondOnStackBody()) { - assert fragment || isTemplateContents(); - errStrayEndTag(name); - break endtagloop; - } - assert currentPtr >= 1; - if (errorHandler != null) { - uncloseloop1: for (int i = 2; i <= currentPtr; i++) { - switch (stack[i].getGroup()) { - case DD_OR_DT: - case LI: - case OPTGROUP: - case OPTION: // is this possible? - case P: - case RB_OR_RTC: - case RT_OR_RP: - case TD_OR_TH: - case TBODY_OR_THEAD_OR_TFOOT: - break; - default: - errEndWithUnclosedElements(name); - break uncloseloop1; - } - } - } - mode = AFTER_BODY; - break endtagloop; - case HTML: - if (!isSecondOnStackBody()) { - assert fragment || isTemplateContents(); - errStrayEndTag(name); - break endtagloop; - } - if (errorHandler != null) { - uncloseloop2: for (int i = 0; i <= currentPtr; i++) { - switch (stack[i].getGroup()) { - case DD_OR_DT: - case LI: - case P: - case RB_OR_RTC: - case RT_OR_RP: - case TBODY_OR_THEAD_OR_TFOOT: - case TD_OR_TH: - case BODY: - case HTML: - break; - default: - errEndWithUnclosedElements(name); - break uncloseloop2; - } - } - } - mode = AFTER_BODY; - continue; - case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU: - case UL_OR_OL_OR_DL: - case PRE_OR_LISTING: - case FIELDSET: - case BUTTON: - case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: - eltPos = findLastInScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - } else { - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - } - break endtagloop; - case FORM: - if (!isTemplateContents()) { - if (formPointer == null) { - errStrayEndTag(name); - break endtagloop; - } - formPointer = null; - eltPos = findLastInScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - break endtagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - removeFromStack(eltPos); - break endtagloop; - } else { - eltPos = findLastInScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - break endtagloop; - } - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - break endtagloop; - } - case P: - eltPos = findLastInButtonScope("p"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errNoElementToCloseButEndTagSeen("p"); - // XXX Can the 'in foreign' case happen anymore? - if (isInForeign()) { - errHtmlStartTagInForeignContext(name); - // Check for currentPtr for the fragment - // case. - while (currentPtr >= 0 && stack[currentPtr].ns != "http://www.w3.org/1999/xhtml") { - pop(); - } - } - appendVoidElementToCurrentMayFoster( - elementName, - HtmlAttributes.EMPTY_ATTRIBUTES); - break endtagloop; - } - generateImpliedEndTagsExceptFor("p"); - assert eltPos != TreeBuilder.NOT_FOUND_ON_STACK; - if (errorHandler != null && eltPos != currentPtr) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - break endtagloop; - case LI: - eltPos = findLastInListScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errNoElementToCloseButEndTagSeen(name); - } else { - generateImpliedEndTagsExceptFor(name); - if (errorHandler != null - && eltPos != currentPtr) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - } - break endtagloop; - case DD_OR_DT: - eltPos = findLastInScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errNoElementToCloseButEndTagSeen(name); - } else { - generateImpliedEndTagsExceptFor(name); - if (errorHandler != null - && eltPos != currentPtr) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - } - break endtagloop; - case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: - eltPos = findLastInScopeHn(); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - } else { - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - } - break endtagloop; - case OBJECT: - case MARQUEE_OR_APPLET: - eltPos = findLastInScope(name); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag(name); - } else { - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - } - break endtagloop; - case BR: - errEndTagBr(); - if (isInForeign()) { - // XXX can this happen anymore? - errHtmlStartTagInForeignContext(name); - // Check for currentPtr for the fragment - // case. - while (currentPtr >= 0 && stack[currentPtr].ns != "http://www.w3.org/1999/xhtml") { - pop(); - } - } - reconstructTheActiveFormattingElements(); - appendVoidElementToCurrentMayFoster( - elementName, - HtmlAttributes.EMPTY_ATTRIBUTES); - break endtagloop; - case TEMPLATE: - // fall through to IN_HEAD; - break; - case AREA_OR_WBR: - // CPPONLY: case MENUITEM: - case PARAM_OR_SOURCE_OR_TRACK: - case EMBED: - case IMG: - case IMAGE: - case INPUT: - case KEYGEN: // XXX?? - case HR: - case ISINDEX: - case IFRAME: - case NOEMBED: // XXX??? - case NOFRAMES: // XXX?? - case SELECT: - case TABLE: - case TEXTAREA: // XXX?? - errStrayEndTag(name); - break endtagloop; - case NOSCRIPT: - if (scriptingEnabled) { - errStrayEndTag(name); - break endtagloop; - } else { - // fall through - } - case A: - case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U: - case FONT: - case NOBR: - if (adoptionAgencyEndTag(name)) { - break endtagloop; - } - // else handle like any other tag - default: - if (isCurrent(name)) { - pop(); - break endtagloop; - } - - eltPos = currentPtr; - for (;;) { - StackNode<T> node = stack[eltPos]; - if (node.ns == "http://www.w3.org/1999/xhtml" && node.name == name) { - generateImpliedEndTags(); - if (errorHandler != null - && !isCurrent(name)) { - errUnclosedElements(eltPos, name); - } - while (currentPtr >= eltPos) { - pop(); - } - break endtagloop; - } else if (eltPos == 0 || node.isSpecial()) { - errStrayEndTag(name); - break endtagloop; - } - eltPos--; - } - } - case IN_HEAD: - switch (group) { - case HEAD: - pop(); - mode = AFTER_HEAD; - break endtagloop; - case BR: - case HTML: - case BODY: - pop(); - mode = AFTER_HEAD; - continue; - case TEMPLATE: - endTagTemplateInHead(); - break endtagloop; - default: - errStrayEndTag(name); - break endtagloop; - } - case IN_HEAD_NOSCRIPT: - switch (group) { - case NOSCRIPT: - pop(); - mode = IN_HEAD; - break endtagloop; - case BR: - errStrayEndTag(name); - pop(); - mode = IN_HEAD; - continue; - default: - errStrayEndTag(name); - break endtagloop; - } - case IN_COLUMN_GROUP: - switch (group) { - case COLGROUP: - if (currentPtr == 0 || stack[currentPtr].getGroup() == - TreeBuilder.TEMPLATE) { - assert fragment || isTemplateContents(); - errGarbageInColgroup(); - break endtagloop; - } - pop(); - mode = IN_TABLE; - break endtagloop; - case COL: - errStrayEndTag(name); - break endtagloop; - case TEMPLATE: - endTagTemplateInHead(); - break endtagloop; - default: - if (currentPtr == 0 || stack[currentPtr].getGroup() == - TreeBuilder.TEMPLATE) { - assert fragment || isTemplateContents(); - errGarbageInColgroup(); - break endtagloop; - } - pop(); - mode = IN_TABLE; - continue; - } - case IN_SELECT_IN_TABLE: - switch (group) { - case CAPTION: - case TABLE: - case TBODY_OR_THEAD_OR_TFOOT: - case TR: - case TD_OR_TH: - errEndTagSeenWithSelectOpen(name); - if (findLastInTableScope(name) != TreeBuilder.NOT_FOUND_ON_STACK) { - eltPos = findLastInTableScope("select"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment; - break endtagloop; // http://www.w3.org/Bugs/Public/show_bug.cgi?id=8375 - } - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - continue; - } else { - break endtagloop; - } - default: - // fall through to IN_SELECT - } - case IN_SELECT: - switch (group) { - case OPTION: - if (isCurrent("option")) { - pop(); - break endtagloop; - } else { - errStrayEndTag(name); - break endtagloop; - } - case OPTGROUP: - if (isCurrent("option") - && "optgroup" == stack[currentPtr - 1].name) { - pop(); - } - if (isCurrent("optgroup")) { - pop(); - } else { - errStrayEndTag(name); - } - break endtagloop; - case SELECT: - eltPos = findLastInTableScope("select"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - assert fragment; - errStrayEndTag(name); - break endtagloop; - } - while (currentPtr >= eltPos) { - pop(); - } - resetTheInsertionMode(); - break endtagloop; - case TEMPLATE: - endTagTemplateInHead(); - break endtagloop; - default: - errStrayEndTag(name); - break endtagloop; - } - case AFTER_BODY: - switch (group) { - case HTML: - if (fragment) { - errStrayEndTag(name); - break endtagloop; - } else { - mode = AFTER_AFTER_BODY; - break endtagloop; - } - default: - errEndTagAfterBody(); - mode = framesetOk ? FRAMESET_OK : IN_BODY; - continue; - } - case IN_FRAMESET: - switch (group) { - case FRAMESET: - if (currentPtr == 0) { - assert fragment; - errStrayEndTag(name); - break endtagloop; - } - pop(); - if ((!fragment) && !isCurrent("frameset")) { - mode = AFTER_FRAMESET; - } - break endtagloop; - default: - errStrayEndTag(name); - break endtagloop; - } - case AFTER_FRAMESET: - switch (group) { - case HTML: - mode = AFTER_AFTER_FRAMESET; - break endtagloop; - default: - errStrayEndTag(name); - break endtagloop; - } - case INITIAL: - /* - * Parse error. - */ - // [NOCPP[ - switch (doctypeExpectation) { - case AUTO: - err("End tag seen without seeing a doctype first. Expected e.g. \u201C<!DOCTYPE html>\u201D."); - break; - case HTML: - // ]NOCPP] - errEndTagSeenWithoutDoctype(); - // [NOCPP[ - break; - case HTML401_STRICT: - err("End tag seen without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\u201D."); - break; - case HTML401_TRANSITIONAL: - err("End tag seen without seeing a doctype first. Expected \u201C<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\u201D."); - break; - case NO_DOCTYPE_ERRORS: - } - // ]NOCPP] - /* - * - * Set the document to quirks mode. - */ - documentModeInternal(DocumentMode.QUIRKS_MODE, null, null, - false); - /* - * Then, switch to the root element mode of the tree - * construction stage - */ - mode = BEFORE_HTML; - /* - * and reprocess the current token. - */ - continue; - case BEFORE_HTML: - switch (group) { - case HEAD: - case BR: - case HTML: - case BODY: - /* - * Create an HTMLElement node with the tag name - * html, in the HTML namespace. Append it to the - * Document object. - */ - appendHtmlElementToDocumentAndPush(); - /* Switch to the main mode */ - mode = BEFORE_HEAD; - /* - * reprocess the current token. - */ - continue; - default: - errStrayEndTag(name); - break endtagloop; - } - case BEFORE_HEAD: - switch (group) { - case HEAD: - case BR: - case HTML: - case BODY: - appendToCurrentNodeAndPushHeadElement(HtmlAttributes.EMPTY_ATTRIBUTES); - mode = IN_HEAD; - continue; - default: - errStrayEndTag(name); - break endtagloop; - } - case AFTER_HEAD: - switch (group) { - case TEMPLATE: - endTagTemplateInHead(); - break endtagloop; - case HTML: - case BODY: - case BR: - appendToCurrentNodeAndPushBodyElement(); - mode = FRAMESET_OK; - continue; - default: - errStrayEndTag(name); - break endtagloop; - } - case AFTER_AFTER_BODY: - errStrayEndTag(name); - mode = framesetOk ? FRAMESET_OK : IN_BODY; - continue; - case AFTER_AFTER_FRAMESET: - errStrayEndTag(name); - break endtagloop; - case TEXT: - // XXX need to manage insertion point here - pop(); - if (originalMode == AFTER_HEAD) { - silentPop(); - } - mode = originalMode; - break endtagloop; - } - } // endtagloop - } - - private void endTagTemplateInHead() throws SAXException { - int eltPos = findLast("template"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - errStrayEndTag("template"); - return; - } - generateImpliedEndTags(); - if (errorHandler != null && !isCurrent("template")) { - errUnclosedElements(eltPos, "template"); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - popTemplateMode(); - resetTheInsertionMode(); - } - - private int findLastInTableScopeOrRootTemplateTbodyTheadTfoot() { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].getGroup() == TreeBuilder.TBODY_OR_THEAD_OR_TFOOT || - stack[i].getGroup() == TreeBuilder.TEMPLATE) { - return i; - } - } - return 0; - } - - private int findLast(@Local String name) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].ns == "http://www.w3.org/1999/xhtml" && stack[i].name == name) { - return i; - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private int findLastInTableScope(@Local String name) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].ns == "http://www.w3.org/1999/xhtml") { - if (stack[i].name == name) { - return i; - } else if (stack[i].name == "table" || stack[i].name == "template") { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private int findLastInButtonScope(@Local String name) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].ns == "http://www.w3.org/1999/xhtml") { - if (stack[i].name == name) { - return i; - } else if (stack[i].name == "button") { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - - if (stack[i].isScoping()) { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private int findLastInScope(@Local String name) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].ns == "http://www.w3.org/1999/xhtml" && stack[i].name == name) { - return i; - } else if (stack[i].isScoping()) { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private int findLastInListScope(@Local String name) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].ns == "http://www.w3.org/1999/xhtml") { - if (stack[i].name == name) { - return i; - } else if (stack[i].name == "ul" || stack[i].name == "ol") { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - - if (stack[i].isScoping()) { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private int findLastInScopeHn() { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].getGroup() == TreeBuilder.H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) { - return i; - } else if (stack[i].isScoping()) { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private void generateImpliedEndTagsExceptFor(@Local String name) - throws SAXException { - for (;;) { - StackNode<T> node = stack[currentPtr]; - switch (node.getGroup()) { - case P: - case LI: - case DD_OR_DT: - case OPTION: - case OPTGROUP: - case RB_OR_RTC: - case RT_OR_RP: - if (node.ns == "http://www.w3.org/1999/xhtml" && node.name == name) { - return; - } - pop(); - continue; - default: - return; - } - } - } - - private void generateImpliedEndTags() throws SAXException { - for (;;) { - switch (stack[currentPtr].getGroup()) { - case P: - case LI: - case DD_OR_DT: - case OPTION: - case OPTGROUP: - case RB_OR_RTC: - case RT_OR_RP: - pop(); - continue; - default: - return; - } - } - } - - private boolean isSecondOnStackBody() { - return currentPtr >= 1 && stack[1].getGroup() == TreeBuilder.BODY; - } - - private void documentModeInternal(DocumentMode m, String publicIdentifier, - String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) - throws SAXException { - - if (isSrcdocDocument) { - // Srcdoc documents are always rendered in standards mode. - quirks = false; - if (documentModeHandler != null) { - documentModeHandler.documentMode( - DocumentMode.STANDARDS_MODE - // [NOCPP[ - , null, null, false - // ]NOCPP] - ); - } - return; - } - - quirks = (m == DocumentMode.QUIRKS_MODE); - if (documentModeHandler != null) { - documentModeHandler.documentMode( - m - // [NOCPP[ - , publicIdentifier, systemIdentifier, - html4SpecificAdditionalErrorChecks - // ]NOCPP] - ); - } - // [NOCPP[ - documentMode(m, publicIdentifier, systemIdentifier, - html4SpecificAdditionalErrorChecks); - // ]NOCPP] - } - - private boolean isAlmostStandards(String publicIdentifier, - String systemIdentifier) { - if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3c//dtd xhtml 1.0 transitional//en", publicIdentifier)) { - return true; - } - if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3c//dtd xhtml 1.0 frameset//en", publicIdentifier)) { - return true; - } - if (systemIdentifier != null) { - if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3c//dtd html 4.01 transitional//en", publicIdentifier)) { - return true; - } - if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3c//dtd html 4.01 frameset//en", publicIdentifier)) { - return true; - } - } - return false; - } - - private boolean isQuirky(@Local String name, String publicIdentifier, - String systemIdentifier, boolean forceQuirks) { - if (forceQuirks) { - return true; - } - if (name != HTML_LOCAL) { - return true; - } - if (publicIdentifier != null) { - for (int i = 0; i < TreeBuilder.QUIRKY_PUBLIC_IDS.length; i++) { - if (Portability.lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString( - TreeBuilder.QUIRKY_PUBLIC_IDS[i], publicIdentifier)) { - return true; - } - } - if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3o//dtd w3 html strict 3.0//en//", publicIdentifier) - || Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-/w3c/dtd html 4.0 transitional/en", - publicIdentifier) - || Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "html", publicIdentifier)) { - return true; - } - } - if (systemIdentifier == null) { - if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3c//dtd html 4.01 transitional//en", publicIdentifier)) { - return true; - } else if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "-//w3c//dtd html 4.01 frameset//en", publicIdentifier)) { - return true; - } - } else if (Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd", - systemIdentifier)) { - return true; - } - return false; - } - - private void closeTheCell(int eltPos) throws SAXException { - generateImpliedEndTags(); - if (errorHandler != null && eltPos != currentPtr) { - errUnclosedElementsCell(eltPos); - } - while (currentPtr >= eltPos) { - pop(); - } - clearTheListOfActiveFormattingElementsUpToTheLastMarker(); - mode = IN_ROW; - return; - } - - private int findLastInTableScopeTdTh() { - for (int i = currentPtr; i > 0; i--) { - @Local String name = stack[i].name; - if (stack[i].ns == "http://www.w3.org/1999/xhtml") { - if ("td" == name || "th" == name) { - return i; - } else if (name == "table" || name == "template") { - return TreeBuilder.NOT_FOUND_ON_STACK; - } - } - } - return TreeBuilder.NOT_FOUND_ON_STACK; - } - - private void clearStackBackTo(int eltPos) throws SAXException { - int eltGroup = stack[eltPos].getGroup(); - while (currentPtr > eltPos) { // > not >= intentional - if (stack[currentPtr].ns == "http://www.w3.org/1999/xhtml" - && stack[currentPtr].getGroup() == TEMPLATE - && (eltGroup == TABLE || eltGroup == TBODY_OR_THEAD_OR_TFOOT|| eltGroup == TR || eltPos == 0)) { - return; - } - pop(); - } - } - - private void resetTheInsertionMode() { - StackNode<T> node; - @Local String name; - @NsUri String ns; - for (int i = currentPtr; i >= 0; i--) { - node = stack[i]; - name = node.name; - ns = node.ns; - if (i == 0) { - if (!(contextNamespace == "http://www.w3.org/1999/xhtml" && (contextName == "td" || contextName == "th"))) { - if (fragment) { - // Make sure we are parsing a fragment otherwise the context element doesn't make sense. - name = contextName; - ns = contextNamespace; - } - } else { - mode = framesetOk ? FRAMESET_OK : IN_BODY; // XXX from Hixie's email - return; - } - } - if ("select" == name) { - int ancestorIndex = i; - while (ancestorIndex > 0) { - StackNode<T> ancestor = stack[ancestorIndex--]; - if ("http://www.w3.org/1999/xhtml" == ancestor.ns) { - if ("template" == ancestor.name) { - break; - } - if ("table" == ancestor.name) { - mode = IN_SELECT_IN_TABLE; - return; - } - } - } - mode = IN_SELECT; - return; - } else if ("td" == name || "th" == name) { - mode = IN_CELL; - return; - } else if ("tr" == name) { - mode = IN_ROW; - return; - } else if ("tbody" == name || "thead" == name || "tfoot" == name) { - mode = IN_TABLE_BODY; - return; - } else if ("caption" == name) { - mode = IN_CAPTION; - return; - } else if ("colgroup" == name) { - mode = IN_COLUMN_GROUP; - return; - } else if ("table" == name) { - mode = IN_TABLE; - return; - } else if ("http://www.w3.org/1999/xhtml" != ns) { - mode = framesetOk ? FRAMESET_OK : IN_BODY; - return; - } else if ("template" == name) { - assert templateModePtr >= 0; - mode = templateModeStack[templateModePtr]; - return; - } else if ("head" == name) { - if (name == contextName) { - mode = framesetOk ? FRAMESET_OK : IN_BODY; // really - } else { - mode = IN_HEAD; - } - return; - } else if ("body" == name) { - mode = framesetOk ? FRAMESET_OK : IN_BODY; - return; - } else if ("frameset" == name) { - // TODO: Fragment case. Add error reporting. - mode = IN_FRAMESET; - return; - } else if ("html" == name) { - if (headPointer == null) { - // TODO: Fragment case. Add error reporting. - mode = BEFORE_HEAD; - } else { - mode = AFTER_HEAD; - } - return; - } else if (i == 0) { - mode = framesetOk ? FRAMESET_OK : IN_BODY; - return; - } - } - } - - /** - * @throws SAXException - * - */ - private void implicitlyCloseP() throws SAXException { - int eltPos = findLastInButtonScope("p"); - if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { - return; - } - generateImpliedEndTagsExceptFor("p"); - if (errorHandler != null && eltPos != currentPtr) { - errUnclosedElementsImplied(eltPos, "p"); - } - while (currentPtr >= eltPos) { - pop(); - } - } - - private boolean debugOnlyClearLastStackSlot() { - stack[currentPtr] = null; - return true; - } - - private boolean debugOnlyClearLastListSlot() { - listOfActiveFormattingElements[listPtr] = null; - return true; - } - - private void pushTemplateMode(int mode) { - templateModePtr++; - if (templateModePtr == templateModeStack.length) { - int[] newStack = new int[templateModeStack.length + 64]; - System.arraycopy(templateModeStack, 0, newStack, 0, templateModeStack.length); - templateModeStack = newStack; - } - templateModeStack[templateModePtr] = mode; - } - - @SuppressWarnings("unchecked") private void push(StackNode<T> node) throws SAXException { - currentPtr++; - if (currentPtr == stack.length) { - StackNode<T>[] newStack = new StackNode[stack.length + 64]; - System.arraycopy(stack, 0, newStack, 0, stack.length); - stack = newStack; - } - stack[currentPtr] = node; - elementPushed(node.ns, node.popName, node.node); - } - - @SuppressWarnings("unchecked") private void silentPush(StackNode<T> node) throws SAXException { - currentPtr++; - if (currentPtr == stack.length) { - StackNode<T>[] newStack = new StackNode[stack.length + 64]; - System.arraycopy(stack, 0, newStack, 0, stack.length); - stack = newStack; - } - stack[currentPtr] = node; - } - - @SuppressWarnings("unchecked") private void append(StackNode<T> node) { - listPtr++; - if (listPtr == listOfActiveFormattingElements.length) { - StackNode<T>[] newList = new StackNode[listOfActiveFormattingElements.length + 64]; - System.arraycopy(listOfActiveFormattingElements, 0, newList, 0, - listOfActiveFormattingElements.length); - listOfActiveFormattingElements = newList; - } - listOfActiveFormattingElements[listPtr] = node; - } - - @Inline private void insertMarker() { - append(null); - } - - private void clearTheListOfActiveFormattingElementsUpToTheLastMarker() { - while (listPtr > -1) { - if (listOfActiveFormattingElements[listPtr] == null) { - --listPtr; - return; - } - listOfActiveFormattingElements[listPtr].release(); - --listPtr; - } - } - - @Inline private boolean isCurrent(@Local String name) { - return stack[currentPtr].ns == "http://www.w3.org/1999/xhtml" && - name == stack[currentPtr].name; - } - - private void removeFromStack(int pos) throws SAXException { - if (currentPtr == pos) { - pop(); - } else { - fatal(); - stack[pos].release(); - System.arraycopy(stack, pos + 1, stack, pos, currentPtr - pos); - assert debugOnlyClearLastStackSlot(); - currentPtr--; - } - } - - private void removeFromStack(StackNode<T> node) throws SAXException { - if (stack[currentPtr] == node) { - pop(); - } else { - int pos = currentPtr - 1; - while (pos >= 0 && stack[pos] != node) { - pos--; - } - if (pos == -1) { - // dead code? - return; - } - fatal(); - node.release(); - System.arraycopy(stack, pos + 1, stack, pos, currentPtr - pos); - currentPtr--; - } - } - - private void removeFromListOfActiveFormattingElements(int pos) { - assert listOfActiveFormattingElements[pos] != null; - listOfActiveFormattingElements[pos].release(); - if (pos == listPtr) { - assert debugOnlyClearLastListSlot(); - listPtr--; - return; - } - assert pos < listPtr; - System.arraycopy(listOfActiveFormattingElements, pos + 1, - listOfActiveFormattingElements, pos, listPtr - pos); - assert debugOnlyClearLastListSlot(); - listPtr--; - } - - /** - * Adoption agency algorithm. - * - * @param name subject as described in the specified algorithm. - * @return Returns true if the algorithm has completed and there is nothing remaining to - * be done. Returns false if the algorithm needs to "act as described in the 'any other - * end tag' entry" as described in the specified algorithm. - * @throws SAXException - */ - private boolean adoptionAgencyEndTag(@Local String name) throws SAXException { - // This check intends to ensure that for properly nested tags, closing tags will match - // against the stack instead of the listOfActiveFormattingElements. - if (stack[currentPtr].ns == "http://www.w3.org/1999/xhtml" && - stack[currentPtr].name == name && - findInListOfActiveFormattingElements(stack[currentPtr]) == -1) { - // If the current element matches the name but isn't on the list of active - // formatting elements, then it is possible that the list was mangled by the Noah's Ark - // clause. In this case, we want to match the end tag against the stack instead of - // proceeding with the AAA algorithm that may match against the list of - // active formatting elements (and possibly mangle the tree in unexpected ways). - pop(); - return true; - } - - // If you crash around here, perhaps some stack node variable claimed to - // be a weak ref isn't. - for (int i = 0; i < 8; ++i) { - int formattingEltListPos = listPtr; - while (formattingEltListPos > -1) { - StackNode<T> listNode = listOfActiveFormattingElements[formattingEltListPos]; // weak ref - if (listNode == null) { - formattingEltListPos = -1; - break; - } else if (listNode.name == name) { - break; - } - formattingEltListPos--; - } - if (formattingEltListPos == -1) { - return false; - } - // this *looks* like a weak ref to the list of formatting elements - StackNode<T> formattingElt = listOfActiveFormattingElements[formattingEltListPos]; - int formattingEltStackPos = currentPtr; - boolean inScope = true; - while (formattingEltStackPos > -1) { - StackNode<T> node = stack[formattingEltStackPos]; // weak ref - if (node == formattingElt) { - break; - } else if (node.isScoping()) { - inScope = false; - } - formattingEltStackPos--; - } - if (formattingEltStackPos == -1) { - errNoElementToCloseButEndTagSeen(name); - removeFromListOfActiveFormattingElements(formattingEltListPos); - return true; - } - if (!inScope) { - errNoElementToCloseButEndTagSeen(name); - return true; - } - // stackPos now points to the formatting element and it is in scope - if (formattingEltStackPos != currentPtr) { - errEndTagViolatesNestingRules(name); - } - int furthestBlockPos = formattingEltStackPos + 1; - while (furthestBlockPos <= currentPtr) { - StackNode<T> node = stack[furthestBlockPos]; // weak ref - assert furthestBlockPos > 0: "How is formattingEltStackPos + 1 not > 0?"; - if (node.isSpecial()) { - break; - } - furthestBlockPos++; - } - if (furthestBlockPos > currentPtr) { - // no furthest block - while (currentPtr >= formattingEltStackPos) { - pop(); - } - removeFromListOfActiveFormattingElements(formattingEltListPos); - return true; - } - StackNode<T> commonAncestor = stack[formattingEltStackPos - 1]; // weak ref - StackNode<T> furthestBlock = stack[furthestBlockPos]; // weak ref - // detachFromParent(furthestBlock.node); XXX AAA CHANGE - int bookmark = formattingEltListPos; - int nodePos = furthestBlockPos; - StackNode<T> lastNode = furthestBlock; // weak ref - int j = 0; - for (;;) { - ++j; - nodePos--; - if (nodePos == formattingEltStackPos) { - break; - } - StackNode<T> node = stack[nodePos]; // weak ref - int nodeListPos = findInListOfActiveFormattingElements(node); - - if (j > 3 && nodeListPos != -1) { - removeFromListOfActiveFormattingElements(nodeListPos); - - // Adjust the indices into the list to account - // for the removal of nodeListPos. - if (nodeListPos <= formattingEltListPos) { - formattingEltListPos--; - } - if (nodeListPos <= bookmark) { - bookmark--; - } - - // Update position to reflect removal from list. - nodeListPos = -1; - } - - if (nodeListPos == -1) { - assert formattingEltStackPos < nodePos; - assert bookmark < nodePos; - assert furthestBlockPos > nodePos; - removeFromStack(nodePos); // node is now a bad pointer in C++ - furthestBlockPos--; - continue; - } - // now node is both on stack and in the list - if (nodePos == furthestBlockPos) { - bookmark = nodeListPos + 1; - } - // if (hasChildren(node.node)) { XXX AAA CHANGE - assert node == listOfActiveFormattingElements[nodeListPos]; - assert node == stack[nodePos]; - T clone = createElement("http://www.w3.org/1999/xhtml", - node.name, node.attributes.cloneAttributes(null), commonAncestor.node); - StackNode<T> newNode = new StackNode<T>(node.getFlags(), node.ns, - node.name, clone, node.popName, node.attributes - // [NOCPP[ - , node.getLocator() - // ]NOCPP] - ); // creation ownership goes to stack - node.dropAttributes(); // adopt ownership to newNode - stack[nodePos] = newNode; - newNode.retain(); // retain for list - listOfActiveFormattingElements[nodeListPos] = newNode; - node.release(); // release from stack - node.release(); // release from list - node = newNode; - // } XXX AAA CHANGE - detachFromParent(lastNode.node); - appendElement(lastNode.node, node.node); - lastNode = node; - } - if (commonAncestor.isFosterParenting()) { - fatal(); - detachFromParent(lastNode.node); - insertIntoFosterParent(lastNode.node); - } else { - detachFromParent(lastNode.node); - appendElement(lastNode.node, commonAncestor.node); - } - T clone = createElement("http://www.w3.org/1999/xhtml", - formattingElt.name, - formattingElt.attributes.cloneAttributes(null), furthestBlock.node); - StackNode<T> formattingClone = new StackNode<T>( - formattingElt.getFlags(), formattingElt.ns, - formattingElt.name, clone, formattingElt.popName, - formattingElt.attributes - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); // Ownership transfers to stack below - formattingElt.dropAttributes(); // transfer ownership to - // formattingClone - appendChildrenToNewParent(furthestBlock.node, clone); - appendElement(clone, furthestBlock.node); - removeFromListOfActiveFormattingElements(formattingEltListPos); - insertIntoListOfActiveFormattingElements(formattingClone, bookmark); - assert formattingEltStackPos < furthestBlockPos; - removeFromStack(formattingEltStackPos); - // furthestBlockPos is now off by one and points to the slot after - // it - insertIntoStack(formattingClone, furthestBlockPos); - } - return true; - } - - private void insertIntoStack(StackNode<T> node, int position) - throws SAXException { - assert currentPtr + 1 < stack.length; - assert position <= currentPtr + 1; - if (position == currentPtr + 1) { - push(node); - } else { - System.arraycopy(stack, position, stack, position + 1, - (currentPtr - position) + 1); - currentPtr++; - stack[position] = node; - } - } - - private void insertIntoListOfActiveFormattingElements( - StackNode<T> formattingClone, int bookmark) { - formattingClone.retain(); - assert listPtr + 1 < listOfActiveFormattingElements.length; - if (bookmark <= listPtr) { - System.arraycopy(listOfActiveFormattingElements, bookmark, - listOfActiveFormattingElements, bookmark + 1, - (listPtr - bookmark) + 1); - } - listPtr++; - listOfActiveFormattingElements[bookmark] = formattingClone; - } - - private int findInListOfActiveFormattingElements(StackNode<T> node) { - for (int i = listPtr; i >= 0; i--) { - if (node == listOfActiveFormattingElements[i]) { - return i; - } - } - return -1; - } - - private int findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker( - @Local String name) { - for (int i = listPtr; i >= 0; i--) { - StackNode<T> node = listOfActiveFormattingElements[i]; - if (node == null) { - return -1; - } else if (node.name == name) { - return i; - } - } - return -1; - } - - - private void maybeForgetEarlierDuplicateFormattingElement( - @Local String name, HtmlAttributes attributes) throws SAXException { - int candidate = -1; - int count = 0; - for (int i = listPtr; i >= 0; i--) { - StackNode<T> node = listOfActiveFormattingElements[i]; - if (node == null) { - break; - } - if (node.name == name && node.attributes.equalsAnother(attributes)) { - candidate = i; - ++count; - } - } - if (count >= 3) { - removeFromListOfActiveFormattingElements(candidate); - } - } - - private int findLastOrRoot(@Local String name) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].ns == "http://www.w3.org/1999/xhtml" && stack[i].name == name) { - return i; - } - } - return 0; - } - - private int findLastOrRoot(int group) { - for (int i = currentPtr; i > 0; i--) { - if (stack[i].getGroup() == group) { - return i; - } - } - return 0; - } - - /** - * Attempt to add attribute to the body element. - * @param attributes the attributes - * @return <code>true</code> iff the attributes were added - * @throws SAXException - */ - private boolean addAttributesToBody(HtmlAttributes attributes) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - if (currentPtr >= 1) { - StackNode<T> body = stack[1]; - if (body.getGroup() == TreeBuilder.BODY) { - addAttributesToElement(body.node, attributes); - return true; - } - } - return false; - } - - private void addAttributesToHtml(HtmlAttributes attributes) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - addAttributesToElement(stack[0].node, attributes); - } - - private void pushHeadPointerOntoStack() throws SAXException { - assert headPointer != null; - assert mode == AFTER_HEAD; - fatal(); - silentPush(new StackNode<T>(ElementName.HEAD, headPointer - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - )); - } - - /** - * @throws SAXException - * - */ - private void reconstructTheActiveFormattingElements() throws SAXException { - if (listPtr == -1) { - return; - } - StackNode<T> mostRecent = listOfActiveFormattingElements[listPtr]; - if (mostRecent == null || isInStack(mostRecent)) { - return; - } - int entryPos = listPtr; - for (;;) { - entryPos--; - if (entryPos == -1) { - break; - } - if (listOfActiveFormattingElements[entryPos] == null) { - break; - } - if (isInStack(listOfActiveFormattingElements[entryPos])) { - break; - } - } - while (entryPos < listPtr) { - entryPos++; - StackNode<T> entry = listOfActiveFormattingElements[entryPos]; - StackNode<T> currentNode = stack[currentPtr]; - - T clone; - if (currentNode.isFosterParenting()) { - clone = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", entry.name, - entry.attributes.cloneAttributes(null)); - } else { - clone = createElement("http://www.w3.org/1999/xhtml", entry.name, - entry.attributes.cloneAttributes(null), currentNode.node); - appendElement(clone, currentNode.node); - } - - StackNode<T> entryClone = new StackNode<T>(entry.getFlags(), - entry.ns, entry.name, clone, entry.popName, - entry.attributes - // [NOCPP[ - , entry.getLocator() - // ]NOCPP] - ); - - entry.dropAttributes(); // transfer ownership to entryClone - - push(entryClone); - // stack takes ownership of the local variable - listOfActiveFormattingElements[entryPos] = entryClone; - // overwriting the old entry on the list, so release & retain - entry.release(); - entryClone.retain(); - } - } - - private void insertIntoFosterParent(T child) throws SAXException { - int tablePos = findLastOrRoot(TreeBuilder.TABLE); - int templatePos = findLastOrRoot(TreeBuilder.TEMPLATE); - - if (templatePos >= tablePos) { - appendElement(child, stack[templatePos].node); - return; - } - - StackNode<T> node = stack[tablePos]; - insertFosterParentedChild(child, node.node, stack[tablePos - 1].node); - } - - private T createAndInsertFosterParentedElement(@NsUri String ns, @Local String name, - HtmlAttributes attributes) throws SAXException { - return createAndInsertFosterParentedElement(ns, name, attributes, null); - } - - private T createAndInsertFosterParentedElement(@NsUri String ns, @Local String name, - HtmlAttributes attributes, T form) throws SAXException { - int tablePos = findLastOrRoot(TreeBuilder.TABLE); - int templatePos = findLastOrRoot(TreeBuilder.TEMPLATE); - - if (templatePos >= tablePos) { - T child = createElement(ns, name, attributes, form, stack[templatePos].node); - appendElement(child, stack[templatePos].node); - return child; - } - - StackNode<T> node = stack[tablePos]; - return createAndInsertFosterParentedElement(ns, name, attributes, form, node.node, stack[tablePos - 1].node); - } - - private boolean isInStack(StackNode<T> node) { - for (int i = currentPtr; i >= 0; i--) { - if (stack[i] == node) { - return true; - } - } - return false; - } - - private void popTemplateMode() { - templateModePtr--; - } - - private void pop() throws SAXException { - StackNode<T> node = stack[currentPtr]; - assert debugOnlyClearLastStackSlot(); - currentPtr--; - elementPopped(node.ns, node.popName, node.node); - node.release(); - } - - private void silentPop() throws SAXException { - StackNode<T> node = stack[currentPtr]; - assert debugOnlyClearLastStackSlot(); - currentPtr--; - node.release(); - } - - private void popOnEof() throws SAXException { - StackNode<T> node = stack[currentPtr]; - assert debugOnlyClearLastStackSlot(); - currentPtr--; - markMalformedIfScript(node.node); - elementPopped(node.ns, node.popName, node.node); - node.release(); - } - - // [NOCPP[ - private void checkAttributes(HtmlAttributes attributes, @NsUri String ns) - throws SAXException { - if (errorHandler != null) { - int len = attributes.getXmlnsLength(); - for (int i = 0; i < len; i++) { - AttributeName name = attributes.getXmlnsAttributeName(i); - if (name == AttributeName.XMLNS) { - if (html4) { - err("Attribute \u201Cxmlns\u201D not allowed here. (HTML4-only error.)"); - } else { - String xmlns = attributes.getXmlnsValue(i); - if (!ns.equals(xmlns)) { - err("Bad value \u201C" - + xmlns - + "\u201D for the attribute \u201Cxmlns\u201D (only \u201C" - + ns + "\u201D permitted here)."); - switch (namePolicy) { - case ALTER_INFOSET: - // fall through - case ALLOW: - warn("Attribute \u201Cxmlns\u201D is not serializable as XML 1.0."); - break; - case FATAL: - fatal("Attribute \u201Cxmlns\u201D is not serializable as XML 1.0."); - break; - } - } - } - } else if (ns != "http://www.w3.org/1999/xhtml" - && name == AttributeName.XMLNS_XLINK) { - String xmlns = attributes.getXmlnsValue(i); - if (!"http://www.w3.org/1999/xlink".equals(xmlns)) { - err("Bad value \u201C" - + xmlns - + "\u201D for the attribute \u201Cxmlns:link\u201D (only \u201Chttp://www.w3.org/1999/xlink\u201D permitted here)."); - switch (namePolicy) { - case ALTER_INFOSET: - // fall through - case ALLOW: - warn("Attribute \u201Cxmlns:xlink\u201D with a value other than \u201Chttp://www.w3.org/1999/xlink\u201D is not serializable as XML 1.0 without changing document semantics."); - break; - case FATAL: - fatal("Attribute \u201Cxmlns:xlink\u201D with a value other than \u201Chttp://www.w3.org/1999/xlink\u201D is not serializable as XML 1.0 without changing document semantics."); - break; - } - } - } else { - err("Attribute \u201C" + attributes.getXmlnsLocalName(i) - + "\u201D not allowed here."); - switch (namePolicy) { - case ALTER_INFOSET: - // fall through - case ALLOW: - warn("Attribute with the local name \u201C" - + attributes.getXmlnsLocalName(i) - + "\u201D is not serializable as XML 1.0."); - break; - case FATAL: - fatal("Attribute with the local name \u201C" - + attributes.getXmlnsLocalName(i) - + "\u201D is not serializable as XML 1.0."); - break; - } - } - } - } - attributes.processNonNcNames(this, namePolicy); - } - - private String checkPopName(@Local String name) throws SAXException { - if (NCName.isNCName(name)) { - return name; - } else { - switch (namePolicy) { - case ALLOW: - warn("Element name \u201C" + name - + "\u201D cannot be represented as XML 1.0."); - return name; - case ALTER_INFOSET: - warn("Element name \u201C" + name - + "\u201D cannot be represented as XML 1.0."); - return NCName.escapeName(name); - case FATAL: - fatal("Element name \u201C" + name - + "\u201D cannot be represented as XML 1.0."); - } - } - return null; // keep compiler happy - } - - // ]NOCPP] - - private void appendHtmlElementToDocumentAndPush(HtmlAttributes attributes) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - T elt = createHtmlElementSetAsRoot(attributes); - StackNode<T> node = new StackNode<T>(ElementName.HTML, - elt - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendHtmlElementToDocumentAndPush() throws SAXException { - appendHtmlElementToDocumentAndPush(tokenizer.emptyAttributes()); - } - - private void appendToCurrentNodeAndPushHeadElement(HtmlAttributes attributes) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - T currentNode = stack[currentPtr].node; - T elt = createElement("http://www.w3.org/1999/xhtml", "head", attributes, currentNode); - appendElement(elt, currentNode); - headPointer = elt; - StackNode<T> node = new StackNode<T>(ElementName.HEAD, - elt - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendToCurrentNodeAndPushBodyElement(HtmlAttributes attributes) - throws SAXException { - appendToCurrentNodeAndPushElement(ElementName.BODY, - attributes); - } - - private void appendToCurrentNodeAndPushBodyElement() throws SAXException { - appendToCurrentNodeAndPushBodyElement(tokenizer.emptyAttributes()); - } - - private void appendToCurrentNodeAndPushFormElementMayFoster( - HtmlAttributes attributes) throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", "form", attributes); - } else { - elt = createElement("http://www.w3.org/1999/xhtml", "form", attributes, current.node); - appendElement(elt, current.node); - } - - if (!isTemplateContents()) { - formPointer = elt; - } - - StackNode<T> node = new StackNode<T>(ElementName.FORM, - elt - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendToCurrentNodeAndPushFormattingElementMayFoster( - ElementName elementName, HtmlAttributes attributes) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - // This method can't be called for custom elements - HtmlAttributes clone = attributes.cloneAttributes(null); - // Attributes must not be read after calling createElement, because - // createElement may delete attributes in C++. - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", elementName.name, attributes); - } else { - elt = createElement("http://www.w3.org/1999/xhtml", elementName.name, attributes, current.node); - appendElement(elt, current.node); - } - StackNode<T> node = new StackNode<T>(elementName, elt, clone - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - append(node); - node.retain(); // append doesn't retain itself - } - - private void appendToCurrentNodeAndPushElement(ElementName elementName, - HtmlAttributes attributes) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - // This method can't be called for custom elements - T currentNode = stack[currentPtr].node; - T elt = createElement("http://www.w3.org/1999/xhtml", elementName.name, attributes, currentNode); - appendElement(elt, currentNode); - if (ElementName.TEMPLATE == elementName) { - elt = getDocumentFragmentForTemplate(elt); - } - StackNode<T> node = new StackNode<T>(elementName, elt - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, - HtmlAttributes attributes) - throws SAXException { - @Local String popName = elementName.name; - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - if (elementName.isCustom()) { - popName = checkPopName(popName); - } - // ]NOCPP] - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", popName, attributes); - } else { - elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes, current.node); - appendElement(elt, current.node); - } - StackNode<T> node = new StackNode<T>(elementName, elt, popName - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendToCurrentNodeAndPushElementMayFosterMathML( - ElementName elementName, HtmlAttributes attributes) - throws SAXException { - @Local String popName = elementName.name; - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1998/Math/MathML"); - if (elementName.isCustom()) { - popName = checkPopName(popName); - } - // ]NOCPP] - boolean markAsHtmlIntegrationPoint = false; - if (ElementName.ANNOTATION_XML == elementName - && annotationXmlEncodingPermitsHtml(attributes)) { - markAsHtmlIntegrationPoint = true; - } - // Attributes must not be read after calling createElement(), since - // createElement may delete the object in C++. - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1998/Math/MathML", popName, attributes); - } else { - elt = createElement("http://www.w3.org/1998/Math/MathML", popName, attributes, current.node); - appendElement(elt, current.node); - } - StackNode<T> node = new StackNode<T>(elementName, elt, popName, - markAsHtmlIntegrationPoint - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - // [NOCPP[ - T getDocumentFragmentForTemplate(T template) { - return template; - } - - T getFormPointerForContext(T context) { - return null; - } - // ]NOCPP] - - private boolean annotationXmlEncodingPermitsHtml(HtmlAttributes attributes) { - String encoding = attributes.getValue(AttributeName.ENCODING); - if (encoding == null) { - return false; - } - return Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "application/xhtml+xml", encoding) - || Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( - "text/html", encoding); - } - - private void appendToCurrentNodeAndPushElementMayFosterSVG( - ElementName elementName, HtmlAttributes attributes) - throws SAXException { - @Local String popName = elementName.camelCaseName; - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/2000/svg"); - if (elementName.isCustom()) { - popName = checkPopName(popName); - } - // ]NOCPP] - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/2000/svg", popName, attributes); - } else { - elt = createElement("http://www.w3.org/2000/svg", popName, attributes, current.node); - appendElement(elt, current.node); - } - StackNode<T> node = new StackNode<T>(elementName, popName, elt - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, - HtmlAttributes attributes, T form) - throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - // Can't be called for custom elements - T elt; - T formOwner = form == null || fragment || isTemplateContents() ? null : form; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", elementName.name, - attributes, formOwner); - } else { - elt = createElement("http://www.w3.org/1999/xhtml", elementName.name, - attributes, formOwner, current.node); - appendElement(elt, current.node); - } - StackNode<T> node = new StackNode<T>(elementName, elt - // [NOCPP[ - , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) - // ]NOCPP] - ); - push(node); - } - - private void appendVoidElementToCurrentMayFoster( - @Local String name, HtmlAttributes attributes, T form) throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - // Can't be called for custom elements - T elt; - T formOwner = form == null || fragment || isTemplateContents() ? null : form; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", name, - attributes, formOwner); - } else { - elt = createElement("http://www.w3.org/1999/xhtml", name, - attributes, formOwner, current.node); - appendElement(elt, current.node); - } - elementPushed("http://www.w3.org/1999/xhtml", name, elt); - elementPopped("http://www.w3.org/1999/xhtml", name, elt); - } - - private void appendVoidElementToCurrentMayFoster( - ElementName elementName, HtmlAttributes attributes) - throws SAXException { - @Local String popName = elementName.name; - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - if (elementName.isCustom()) { - popName = checkPopName(popName); - } - // ]NOCPP] - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", popName, attributes); - } else { - elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes, current.node); - appendElement(elt, current.node); - } - elementPushed("http://www.w3.org/1999/xhtml", popName, elt); - elementPopped("http://www.w3.org/1999/xhtml", popName, elt); - } - - private void appendVoidElementToCurrentMayFosterSVG( - ElementName elementName, HtmlAttributes attributes) - throws SAXException { - @Local String popName = elementName.camelCaseName; - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/2000/svg"); - if (elementName.isCustom()) { - popName = checkPopName(popName); - } - // ]NOCPP] - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/2000/svg", popName, attributes); - } else { - elt = createElement("http://www.w3.org/2000/svg", popName, attributes, current.node); - appendElement(elt, current.node); - } - elementPushed("http://www.w3.org/2000/svg", popName, elt); - elementPopped("http://www.w3.org/2000/svg", popName, elt); - } - - private void appendVoidElementToCurrentMayFosterMathML( - ElementName elementName, HtmlAttributes attributes) - throws SAXException { - @Local String popName = elementName.name; - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1998/Math/MathML"); - if (elementName.isCustom()) { - popName = checkPopName(popName); - } - // ]NOCPP] - T elt; - StackNode<T> current = stack[currentPtr]; - if (current.isFosterParenting()) { - fatal(); - elt = createAndInsertFosterParentedElement("http://www.w3.org/1998/Math/MathML", popName, attributes); - } else { - elt = createElement("http://www.w3.org/1998/Math/MathML", popName, attributes, current.node); - appendElement(elt, current.node); - } - elementPushed("http://www.w3.org/1998/Math/MathML", popName, elt); - elementPopped("http://www.w3.org/1998/Math/MathML", popName, elt); - } - - private void appendVoidElementToCurrent( - @Local String name, HtmlAttributes attributes, T form) throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - // Can't be called for custom elements - T currentNode = stack[currentPtr].node; - T elt = createElement("http://www.w3.org/1999/xhtml", name, attributes, - form == null || fragment || isTemplateContents() ? null : form, currentNode); - appendElement(elt, currentNode); - elementPushed("http://www.w3.org/1999/xhtml", name, elt); - elementPopped("http://www.w3.org/1999/xhtml", name, elt); - } - - private void appendVoidFormToCurrent(HtmlAttributes attributes) throws SAXException { - // [NOCPP[ - checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); - // ]NOCPP] - T currentNode = stack[currentPtr].node; - T elt = createElement("http://www.w3.org/1999/xhtml", "form", - attributes, currentNode); - formPointer = elt; - // ownership transferred to form pointer - appendElement(elt, currentNode); - elementPushed("http://www.w3.org/1999/xhtml", "form", elt); - elementPopped("http://www.w3.org/1999/xhtml", "form", elt); - } - - // [NOCPP[ - - private final void accumulateCharactersForced(@Const @NoLength char[] buf, - int start, int length) throws SAXException { - System.arraycopy(buf, start, charBuffer, charBufferLen, length); - charBufferLen += length; - } - - @Override public void ensureBufferSpace(int inputLength) - throws SAXException { - // TODO: Unify Tokenizer.strBuf and TreeBuilder.charBuffer so that - // this method becomes unnecessary. - int worstCase = charBufferLen + inputLength; - if (charBuffer == null) { - // Add an arbitrary small value to avoid immediate reallocation - // once there are a few characters in the buffer. - charBuffer = new char[worstCase + 128]; - } else if (worstCase > charBuffer.length) { - // HotSpot reportedly allocates memory with 8-byte accuracy, so - // there's no point in trying to do math here to avoid slop. - // Maybe we should add some small constant to worstCase here - // but not doing that without profiling. In C++ with jemalloc, - // the corresponding method should do math to round up here - // to avoid slop. - char[] newBuf = new char[worstCase]; - System.arraycopy(charBuffer, 0, newBuf, 0, charBufferLen); - charBuffer = newBuf; - } - } - - // ]NOCPP] - - protected void accumulateCharacters(@Const @NoLength char[] buf, int start, - int length) throws SAXException { - appendCharacters(stack[currentPtr].node, buf, start, length); - } - - // ------------------------------- // - - protected final void requestSuspension() { - tokenizer.requestSuspension(); - } - - protected abstract T createElement(@NsUri String ns, @Local String name, - HtmlAttributes attributes, T intendedParent) throws SAXException; - - protected T createElement(@NsUri String ns, @Local String name, - HtmlAttributes attributes, T form, T intendedParent) throws SAXException { - return createElement("http://www.w3.org/1999/xhtml", name, attributes, intendedParent); - } - - protected abstract T createHtmlElementSetAsRoot(HtmlAttributes attributes) - throws SAXException; - - protected abstract void detachFromParent(T element) throws SAXException; - - protected abstract boolean hasChildren(T element) throws SAXException; - - protected abstract void appendElement(T child, T newParent) - throws SAXException; - - protected abstract void appendChildrenToNewParent(T oldParent, T newParent) - throws SAXException; - - protected abstract void insertFosterParentedChild(T child, T table, - T stackParent) throws SAXException; - - // We don't generate CPP code for this method because it is not used in generated CPP - // code. Instead, the form owner version of this method is called with a null form owner. - // [NOCPP[ - - protected abstract T createAndInsertFosterParentedElement(@NsUri String ns, @Local String name, - HtmlAttributes attributes, T table, T stackParent) throws SAXException; - - // ]NOCPP] - - protected T createAndInsertFosterParentedElement(@NsUri String ns, @Local String name, - HtmlAttributes attributes, T form, T table, T stackParent) throws SAXException { - return createAndInsertFosterParentedElement(ns, name, attributes, table, stackParent); - }; - - protected abstract void insertFosterParentedCharacters( - @NoLength char[] buf, int start, int length, T table, T stackParent) - throws SAXException; - - protected abstract void appendCharacters(T parent, @NoLength char[] buf, - int start, int length) throws SAXException; - - protected abstract void appendIsindexPrompt(T parent) throws SAXException; - - protected abstract void appendComment(T parent, @NoLength char[] buf, - int start, int length) throws SAXException; - - protected abstract void appendCommentToDocument(@NoLength char[] buf, - int start, int length) throws SAXException; - - protected abstract void addAttributesToElement(T element, - HtmlAttributes attributes) throws SAXException; - - protected void markMalformedIfScript(T elt) throws SAXException { - - } - - protected void start(boolean fragmentMode) throws SAXException { - - } - - protected void end() throws SAXException { - - } - - protected void appendDoctypeToDocument(@Local String name, - String publicIdentifier, String systemIdentifier) - throws SAXException { - - } - - protected void elementPushed(@NsUri String ns, @Local String name, T node) - throws SAXException { - - } - - protected void elementPopped(@NsUri String ns, @Local String name, T node) - throws SAXException { - - } - - // [NOCPP[ - - protected void documentMode(DocumentMode m, String publicIdentifier, - String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) - throws SAXException { - - } - - /** - * @see nu.validator.htmlparser.common.TokenHandler#wantsComments() - */ - public boolean wantsComments() { - return wantingComments; - } - - public void setIgnoringComments(boolean ignoreComments) { - wantingComments = !ignoreComments; - } - - /** - * Sets the errorHandler. - * - * @param errorHandler - * the errorHandler to set - */ - public final void setErrorHandler(ErrorHandler errorHandler) { - this.errorHandler = errorHandler; - } - - /** - * Returns the errorHandler. - * - * @return the errorHandler - */ - public ErrorHandler getErrorHandler() { - return errorHandler; - } - - /** - * The argument MUST be an interned string or <code>null</code>. - * - * @param context - */ - public final void setFragmentContext(@Local String context) { - this.contextName = context; - this.contextNamespace = "http://www.w3.org/1999/xhtml"; - this.contextNode = null; - this.fragment = (contextName != null); - this.quirks = false; - } - - // ]NOCPP] - - /** - * @see nu.validator.htmlparser.common.TokenHandler#cdataSectionAllowed() - */ - @Inline public boolean cdataSectionAllowed() throws SAXException { - return isInForeign(); - } - - private boolean isInForeign() { - return currentPtr >= 0 - && stack[currentPtr].ns != "http://www.w3.org/1999/xhtml"; - } - - private boolean isInForeignButNotHtmlOrMathTextIntegrationPoint() { - if (currentPtr < 0) { - return false; - } - return !isSpecialParentInForeign(stack[currentPtr]); - } - - /** - * The argument MUST be an interned string or <code>null</code>. - * - * @param context - */ - public final void setFragmentContext(@Local String context, - @NsUri String ns, T node, boolean quirks) { - // [NOCPP[ - if (!((context == null && ns == null) - || "http://www.w3.org/1999/xhtml" == ns - || "http://www.w3.org/2000/svg" == ns || "http://www.w3.org/1998/Math/MathML" == ns)) { - throw new IllegalArgumentException( - "The namespace must be the HTML, SVG or MathML namespace (or null when the local name is null). Got: " - + ns); - } - // ]NOCPP] - this.contextName = context; - this.contextNamespace = ns; - this.contextNode = node; - this.fragment = (contextName != null); - this.quirks = quirks; - } - - protected final T currentNode() { - return stack[currentPtr].node; - } - - /** - * Returns the scriptingEnabled. - * - * @return the scriptingEnabled - */ - public boolean isScriptingEnabled() { - return scriptingEnabled; - } - - /** - * Sets the scriptingEnabled. - * - * @param scriptingEnabled - * the scriptingEnabled to set - */ - public void setScriptingEnabled(boolean scriptingEnabled) { - this.scriptingEnabled = scriptingEnabled; - } - - public void setIsSrcdocDocument(boolean isSrcdocDocument) { - this.isSrcdocDocument = isSrcdocDocument; - } - - // [NOCPP[ - - /** - * Sets the doctypeExpectation. - * - * @param doctypeExpectation - * the doctypeExpectation to set - */ - public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) { - this.doctypeExpectation = doctypeExpectation; - } - - public void setNamePolicy(XmlViolationPolicy namePolicy) { - this.namePolicy = namePolicy; - } - - /** - * Sets the documentModeHandler. - * - * @param documentModeHandler - * the documentModeHandler to set - */ - public void setDocumentModeHandler(DocumentModeHandler documentModeHandler) { - this.documentModeHandler = documentModeHandler; - } - - /** - * Sets the reportingDoctype. - * - * @param reportingDoctype - * the reportingDoctype to set - */ - public void setReportingDoctype(boolean reportingDoctype) { - this.reportingDoctype = reportingDoctype; - } - - // ]NOCPP] - - /** - * Flushes the pending characters. Public for document.write use cases only. - * @throws SAXException - */ - public final void flushCharacters() throws SAXException { - if (charBufferLen > 0) { - if ((mode == IN_TABLE || mode == IN_TABLE_BODY || mode == IN_ROW) - && charBufferContainsNonWhitespace()) { - errNonSpaceInTable(); - reconstructTheActiveFormattingElements(); - if (!stack[currentPtr].isFosterParenting()) { - // reconstructing gave us a new current node - appendCharacters(currentNode(), charBuffer, 0, - charBufferLen); - charBufferLen = 0; - return; - } - - int tablePos = findLastOrRoot(TreeBuilder.TABLE); - int templatePos = findLastOrRoot(TreeBuilder.TEMPLATE); - - if (templatePos >= tablePos) { - appendCharacters(stack[templatePos].node, charBuffer, 0, charBufferLen); - charBufferLen = 0; - return; - } - - StackNode<T> tableElt = stack[tablePos]; - insertFosterParentedCharacters(charBuffer, 0, charBufferLen, - tableElt.node, stack[tablePos - 1].node); - charBufferLen = 0; - return; - } - appendCharacters(currentNode(), charBuffer, 0, charBufferLen); - charBufferLen = 0; - } - } - - private boolean charBufferContainsNonWhitespace() { - for (int i = 0; i < charBufferLen; i++) { - switch (charBuffer[i]) { - case ' ': - case '\t': - case '\n': - case '\r': - case '\u000C': - continue; - default: - return true; - } - } - return false; - } - - /** - * Creates a comparable snapshot of the tree builder state. Snapshot - * creation is only supported immediately after a script end tag has been - * processed. In C++ the caller is responsible for calling - * <code>delete</code> on the returned object. - * - * @return a snapshot. - * @throws SAXException - */ - @SuppressWarnings("unchecked") public TreeBuilderState<T> newSnapshot() - throws SAXException { - StackNode<T>[] listCopy = new StackNode[listPtr + 1]; - for (int i = 0; i < listCopy.length; i++) { - StackNode<T> node = listOfActiveFormattingElements[i]; - if (node != null) { - StackNode<T> newNode = new StackNode<T>(node.getFlags(), node.ns, - node.name, node.node, node.popName, - node.attributes.cloneAttributes(null) - // [NOCPP[ - , node.getLocator() - // ]NOCPP] - ); - listCopy[i] = newNode; - } else { - listCopy[i] = null; - } - } - StackNode<T>[] stackCopy = new StackNode[currentPtr + 1]; - for (int i = 0; i < stackCopy.length; i++) { - StackNode<T> node = stack[i]; - int listIndex = findInListOfActiveFormattingElements(node); - if (listIndex == -1) { - StackNode<T> newNode = new StackNode<T>(node.getFlags(), node.ns, - node.name, node.node, node.popName, - null - // [NOCPP[ - , node.getLocator() - // ]NOCPP] - ); - stackCopy[i] = newNode; - } else { - stackCopy[i] = listCopy[listIndex]; - stackCopy[i].retain(); - } - } - int[] templateModeStackCopy = new int[templateModePtr + 1]; - System.arraycopy(templateModeStack, 0, templateModeStackCopy, 0, - templateModeStackCopy.length); - return new StateSnapshot<T>(stackCopy, listCopy, templateModeStackCopy, formPointer, - headPointer, deepTreeSurrogateParent, mode, originalMode, framesetOk, - needToDropLF, quirks); - } - - public boolean snapshotMatches(TreeBuilderState<T> snapshot) { - StackNode<T>[] stackCopy = snapshot.getStack(); - int stackLen = snapshot.getStackLength(); - StackNode<T>[] listCopy = snapshot.getListOfActiveFormattingElements(); - int listLen = snapshot.getListOfActiveFormattingElementsLength(); - int[] templateModeStackCopy = snapshot.getTemplateModeStack(); - int templateModeStackLen = snapshot.getTemplateModeStackLength(); - - if (stackLen != currentPtr + 1 - || listLen != listPtr + 1 - || templateModeStackLen != templateModePtr + 1 - || formPointer != snapshot.getFormPointer() - || headPointer != snapshot.getHeadPointer() - || deepTreeSurrogateParent != snapshot.getDeepTreeSurrogateParent() - || mode != snapshot.getMode() - || originalMode != snapshot.getOriginalMode() - || framesetOk != snapshot.isFramesetOk() - || needToDropLF != snapshot.isNeedToDropLF() - || quirks != snapshot.isQuirks()) { // maybe just assert quirks - return false; - } - for (int i = listLen - 1; i >= 0; i--) { - if (listCopy[i] == null - && listOfActiveFormattingElements[i] == null) { - continue; - } else if (listCopy[i] == null - || listOfActiveFormattingElements[i] == null) { - return false; - } - if (listCopy[i].node != listOfActiveFormattingElements[i].node) { - return false; // it's possible that this condition is overly - // strict - } - } - for (int i = stackLen - 1; i >= 0; i--) { - if (stackCopy[i].node != stack[i].node) { - return false; - } - } - for (int i = templateModeStackLen - 1; i >=0; i--) { - if (templateModeStackCopy[i] != templateModeStack[i]) { - return false; - } - } - return true; - } - - @SuppressWarnings("unchecked") public void loadState( - TreeBuilderState<T> snapshot, Interner interner) - throws SAXException { - StackNode<T>[] stackCopy = snapshot.getStack(); - int stackLen = snapshot.getStackLength(); - StackNode<T>[] listCopy = snapshot.getListOfActiveFormattingElements(); - int listLen = snapshot.getListOfActiveFormattingElementsLength(); - int[] templateModeStackCopy = snapshot.getTemplateModeStack(); - int templateModeStackLen = snapshot.getTemplateModeStackLength(); - - for (int i = 0; i <= listPtr; i++) { - if (listOfActiveFormattingElements[i] != null) { - listOfActiveFormattingElements[i].release(); - } - } - if (listOfActiveFormattingElements.length < listLen) { - listOfActiveFormattingElements = new StackNode[listLen]; - } - listPtr = listLen - 1; - - for (int i = 0; i <= currentPtr; i++) { - stack[i].release(); - } - if (stack.length < stackLen) { - stack = new StackNode[stackLen]; - } - currentPtr = stackLen - 1; - - if (templateModeStack.length < templateModeStackLen) { - templateModeStack = new int[templateModeStackLen]; - } - templateModePtr = templateModeStackLen - 1; - - for (int i = 0; i < listLen; i++) { - StackNode<T> node = listCopy[i]; - if (node != null) { - StackNode<T> newNode = new StackNode<T>(node.getFlags(), node.ns, - Portability.newLocalFromLocal(node.name, interner), node.node, - Portability.newLocalFromLocal(node.popName, interner), - node.attributes.cloneAttributes(null) - // [NOCPP[ - , node.getLocator() - // ]NOCPP] - ); - listOfActiveFormattingElements[i] = newNode; - } else { - listOfActiveFormattingElements[i] = null; - } - } - for (int i = 0; i < stackLen; i++) { - StackNode<T> node = stackCopy[i]; - int listIndex = findInArray(node, listCopy); - if (listIndex == -1) { - StackNode<T> newNode = new StackNode<T>(node.getFlags(), node.ns, - Portability.newLocalFromLocal(node.name, interner), node.node, - Portability.newLocalFromLocal(node.popName, interner), - null - // [NOCPP[ - , node.getLocator() - // ]NOCPP] - ); - stack[i] = newNode; - } else { - stack[i] = listOfActiveFormattingElements[listIndex]; - stack[i].retain(); - } - } - System.arraycopy(templateModeStackCopy, 0, templateModeStack, 0, templateModeStackLen); - formPointer = snapshot.getFormPointer(); - headPointer = snapshot.getHeadPointer(); - deepTreeSurrogateParent = snapshot.getDeepTreeSurrogateParent(); - mode = snapshot.getMode(); - originalMode = snapshot.getOriginalMode(); - framesetOk = snapshot.isFramesetOk(); - needToDropLF = snapshot.isNeedToDropLF(); - quirks = snapshot.isQuirks(); - } - - private int findInArray(StackNode<T> node, StackNode<T>[] arr) { - for (int i = listPtr; i >= 0; i--) { - if (node == arr[i]) { - return i; - } - } - return -1; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getFormPointer() - */ - public T getFormPointer() { - return formPointer; - } - - /** - * Returns the headPointer. - * - * @return the headPointer - */ - public T getHeadPointer() { - return headPointer; - } - - /** - * Returns the deepTreeSurrogateParent. - * - * @return the deepTreeSurrogateParent - */ - public T getDeepTreeSurrogateParent() { - return deepTreeSurrogateParent; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getListOfActiveFormattingElements() - */ - public StackNode<T>[] getListOfActiveFormattingElements() { - return listOfActiveFormattingElements; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getStack() - */ - public StackNode<T>[] getStack() { - return stack; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getTemplateModeStack() - */ - public int[] getTemplateModeStack() { - return templateModeStack; - } - - /** - * Returns the mode. - * - * @return the mode - */ - public int getMode() { - return mode; - } - - /** - * Returns the originalMode. - * - * @return the originalMode - */ - public int getOriginalMode() { - return originalMode; - } - - /** - * Returns the framesetOk. - * - * @return the framesetOk - */ - public boolean isFramesetOk() { - return framesetOk; - } - - /** - * Returns the needToDropLF. - * - * @return the needToDropLF - */ - public boolean isNeedToDropLF() { - return needToDropLF; - } - - /** - * Returns the quirks. - * - * @return the quirks - */ - public boolean isQuirks() { - return quirks; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getListOfActiveFormattingElementsLength() - */ - public int getListOfActiveFormattingElementsLength() { - return listPtr + 1; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getStackLength() - */ - public int getStackLength() { - return currentPtr + 1; - } - - /** - * @see nu.validator.htmlparser.impl.TreeBuilderState#getTemplateModeStackLength() - */ - public int getTemplateModeStackLength() { - return templateModePtr + 1; - } - - /** - * Reports a stray start tag. - * @param name the name of the stray tag - * - * @throws SAXException - */ - private void errStrayStartTag(@Local String name) throws SAXException { - err("Stray start tag \u201C" + name + "\u201D."); - } - - /** - * Reports a stray end tag. - * @param name the name of the stray tag - * - * @throws SAXException - */ - private void errStrayEndTag(@Local String name) throws SAXException { - err("Stray end tag \u201C" + name + "\u201D."); - } - - /** - * Reports a state when elements expected to be closed were not. - * - * @param eltPos the position of the start tag on the stack of the element - * being closed. - * @param name the name of the end tag - * - * @throws SAXException - */ - private void errUnclosedElements(int eltPos, @Local String name) throws SAXException { - errNoCheck("End tag \u201C" + name + "\u201D seen, but there were open elements."); - errListUnclosedStartTags(eltPos); - } - - /** - * Reports a state when elements expected to be closed ahead of an implied - * end tag but were not. - * - * @param eltPos the position of the start tag on the stack of the element - * being closed. - * @param name the name of the end tag - * - * @throws SAXException - */ - private void errUnclosedElementsImplied(int eltPos, String name) throws SAXException { - errNoCheck("End tag \u201C" + name + "\u201D implied, but there were open elements."); - errListUnclosedStartTags(eltPos); - } - - /** - * Reports a state when elements expected to be closed ahead of an implied - * table cell close. - * - * @param eltPos the position of the start tag on the stack of the element - * being closed. - * @throws SAXException - */ - private void errUnclosedElementsCell(int eltPos) throws SAXException { - errNoCheck("A table cell was implicitly closed, but there were open elements."); - errListUnclosedStartTags(eltPos); - } - - private void errStrayDoctype() throws SAXException { - err("Stray doctype."); - } - - private void errAlmostStandardsDoctype() throws SAXException { - if (!isSrcdocDocument) { - err("Almost standards mode doctype. Expected \u201C<!DOCTYPE html>\u201D."); - } - } - - private void errQuirkyDoctype() throws SAXException { - if (!isSrcdocDocument) { - err("Quirky doctype. Expected \u201C<!DOCTYPE html>\u201D."); - } - } - - private void errNonSpaceInTrailer() throws SAXException { - err("Non-space character in page trailer."); - } - - private void errNonSpaceAfterFrameset() throws SAXException { - err("Non-space after \u201Cframeset\u201D."); - } - - private void errNonSpaceInFrameset() throws SAXException { - err("Non-space in \u201Cframeset\u201D."); - } - - private void errNonSpaceAfterBody() throws SAXException { - err("Non-space character after body."); - } - - private void errNonSpaceInColgroupInFragment() throws SAXException { - err("Non-space in \u201Ccolgroup\u201D when parsing fragment."); - } - - private void errNonSpaceInNoscriptInHead() throws SAXException { - err("Non-space character inside \u201Cnoscript\u201D inside \u201Chead\u201D."); - } - - private void errFooBetweenHeadAndBody(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("\u201C" + name + "\u201D element between \u201Chead\u201D and \u201Cbody\u201D."); - } - - private void errStartTagWithoutDoctype() throws SAXException { - if (!isSrcdocDocument) { - err("Start tag seen without seeing a doctype first. Expected \u201C<!DOCTYPE html>\u201D."); - } - } - - private void errNoSelectInTableScope() throws SAXException { - err("No \u201Cselect\u201D in table scope."); - } - - private void errStartSelectWhereEndSelectExpected() throws SAXException { - err("\u201Cselect\u201D start tag where end tag expected."); - } - - private void errStartTagWithSelectOpen(@Local String name) - throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("\u201C" + name - + "\u201D start tag with \u201Cselect\u201D open."); - } - - private void errBadStartTagInHead(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("Bad start tag in \u201C" + name - + "\u201D in \u201Chead\u201D."); - } - - private void errImage() throws SAXException { - err("Saw a start tag \u201Cimage\u201D."); - } - - private void errIsindex() throws SAXException { - err("\u201Cisindex\u201D seen."); - } - - private void errFooSeenWhenFooOpen(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("An \u201C" + name + "\u201D start tag seen but an element of the same type was already open."); - } - - private void errHeadingWhenHeadingOpen() throws SAXException { - err("Heading cannot be a child of another heading."); - } - - private void errFramesetStart() throws SAXException { - err("\u201Cframeset\u201D start tag seen."); - } - - private void errNoCellToClose() throws SAXException { - err("No cell to close."); - } - - private void errStartTagInTable(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("Start tag \u201C" + name - + "\u201D seen in \u201Ctable\u201D."); - } - - private void errFormWhenFormOpen() throws SAXException { - err("Saw a \u201Cform\u201D start tag, but there was already an active \u201Cform\u201D element. Nested forms are not allowed. Ignoring the tag."); - } - - private void errTableSeenWhileTableOpen() throws SAXException { - err("Start tag for \u201Ctable\u201D seen but the previous \u201Ctable\u201D is still open."); - } - - private void errStartTagInTableBody(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("\u201C" + name + "\u201D start tag in table body."); - } - - private void errEndTagSeenWithoutDoctype() throws SAXException { - if (!isSrcdocDocument) { - err("End tag seen without seeing a doctype first. Expected \u201C<!DOCTYPE html>\u201D."); - } - } - - private void errEndTagAfterBody() throws SAXException { - err("Saw an end tag after \u201Cbody\u201D had been closed."); - } - - private void errEndTagSeenWithSelectOpen(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("\u201C" + name - + "\u201D end tag with \u201Cselect\u201D open."); - } - - private void errGarbageInColgroup() throws SAXException { - err("Garbage in \u201Ccolgroup\u201D fragment."); - } - - private void errEndTagBr() throws SAXException { - err("End tag \u201Cbr\u201D."); - } - - private void errNoElementToCloseButEndTagSeen(@Local String name) - throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("No \u201C" + name + "\u201D element in scope but a \u201C" - + name + "\u201D end tag seen."); - } - - private void errHtmlStartTagInForeignContext(@Local String name) - throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("HTML start tag \u201C" + name - + "\u201D in a foreign namespace context."); - } - - private void errTableClosedWhileCaptionOpen() throws SAXException { - err("\u201Ctable\u201D closed but \u201Ccaption\u201D was still open."); - } - - private void errNoTableRowToClose() throws SAXException { - err("No table row to close."); - } - - private void errNonSpaceInTable() throws SAXException { - err("Misplaced non-space characters insided a table."); - } - - private void errUnclosedChildrenInRuby() throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("Unclosed children in \u201Cruby\u201D."); - } - - private void errStartTagSeenWithoutRuby(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("Start tag \u201C" - + name - + "\u201D seen without a \u201Cruby\u201D element being open."); - } - - private void errSelfClosing() throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("Self-closing syntax (\u201C/>\u201D) used on a non-void HTML element. Ignoring the slash and treating as a start tag."); - } - - private void errNoCheckUnclosedElementsOnStack() throws SAXException { - errNoCheck("Unclosed elements on stack."); - } - - private void errEndTagDidNotMatchCurrentOpenElement(@Local String name, - @Local String currOpenName) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("End tag \u201C" - + name - + "\u201D did not match the name of the current open element (\u201C" - + currOpenName + "\u201D)."); - } - - private void errEndTagViolatesNestingRules(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("End tag \u201C" + name + "\u201D violates nesting rules."); - } - - private void errEofWithUnclosedElements() throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("End of file seen and there were open elements."); - // just report all remaining unclosed elements - errListUnclosedStartTags(0); - } - - /** - * Reports arriving at/near end of document with unclosed elements remaining. - * - * @param message - * the message - * @throws SAXException - */ - private void errEndWithUnclosedElements(@Local String name) throws SAXException { - if (errorHandler == null) { - return; - } - errNoCheck("End tag for \u201C" - + name - + "\u201D seen, but there were unclosed elements."); - // just report all remaining unclosed elements - errListUnclosedStartTags(0); - } -} diff --git a/parser/html/javasrc/UTF16Buffer.java b/parser/html/javasrc/UTF16Buffer.java deleted file mode 100644 index ec79185ec..000000000 --- a/parser/html/javasrc/UTF16Buffer.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2008-2010 Mozilla Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package nu.validator.htmlparser.impl; - -import nu.validator.htmlparser.annotation.NoLength; - -/** - * An UTF-16 buffer that knows the start and end indeces of its unconsumed - * content. - * - * @version $Id$ - * @author hsivonen - */ -public final class UTF16Buffer { - - /** - * The backing store of the buffer. May be larger than the logical content - * of this <code>UTF16Buffer</code>. - */ - private final @NoLength char[] buffer; - - /** - * The index of the first unconsumed character in the backing buffer. - */ - private int start; - - /** - * The index of the slot immediately after the last character in the backing - * buffer that is part of the logical content of this - * <code>UTF16Buffer</code>. - */ - private int end; - - //[NOCPP[ - - /** - * Constructor for wrapping an existing UTF-16 code unit array. - * - * @param buffer - * the backing buffer - * @param start - * the index of the first character to consume - * @param end - * the index immediately after the last character to consume - */ - public UTF16Buffer(@NoLength char[] buffer, int start, int end) { - this.buffer = buffer; - this.start = start; - this.end = end; - } - - // ]NOCPP] - - /** - * Returns the start index. - * - * @return the start index - */ - public int getStart() { - return start; - } - - /** - * Sets the start index. - * - * @param start - * the start index - */ - public void setStart(int start) { - this.start = start; - } - - /** - * Returns the backing buffer. - * - * @return the backing buffer - */ - public @NoLength char[] getBuffer() { - return buffer; - } - - /** - * Returns the end index. - * - * @return the end index - */ - public int getEnd() { - return end; - } - - /** - * Checks if the buffer has data left. - * - * @return <code>true</code> if there's data left - */ - public boolean hasMore() { - return start < end; - } - - /** - * Returns <code>end - start</code>. - * - * @return <code>end - start</code> - */ - public int getLength() { - return end - start; - } - - /** - * Adjusts the start index to skip over the first character if it is a line - * feed and the previous character was a carriage return. - * - * @param lastWasCR - * whether the previous character was a carriage return - */ - public void adjust(boolean lastWasCR) { - if (lastWasCR && buffer[start] == '\n') { - start++; - } - } - - /** - * Sets the end index. - * - * @param end - * the end index - */ - public void setEnd(int end) { - this.end = end; - } -} diff --git a/parser/html/nsHtml5ArrayCopy.h b/parser/html/nsHtml5ArrayCopy.h index 594a801ab..5e2b37858 100644 --- a/parser/html/nsHtml5ArrayCopy.h +++ b/parser/html/nsHtml5ArrayCopy.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/parser/html/nsHtml5AttributeName.cpp b/parser/html/nsHtml5AttributeName.cpp index dc546c111..2dee33220 100644 --- a/parser/html/nsHtml5AttributeName.cpp +++ b/parser/html/nsHtml5AttributeName.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2011 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit AttributeName.java instead and regenerate. - */ - #define nsHtml5AttributeName_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5AttributeName.h b/parser/html/nsHtml5AttributeName.h index d0b93341b..12e4da3b2 100644 --- a/parser/html/nsHtml5AttributeName.h +++ b/parser/html/nsHtml5AttributeName.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2011 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit AttributeName.java instead and regenerate. - */ - #ifndef nsHtml5AttributeName_h #define nsHtml5AttributeName_h diff --git a/parser/html/nsHtml5ElementName.cpp b/parser/html/nsHtml5ElementName.cpp index fb523e7ef..74b0450ee 100644 --- a/parser/html/nsHtml5ElementName.cpp +++ b/parser/html/nsHtml5ElementName.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2014 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit ElementName.java instead and regenerate. - */ - #define nsHtml5ElementName_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5ElementName.h b/parser/html/nsHtml5ElementName.h index b5f0e4b9b..252716990 100644 --- a/parser/html/nsHtml5ElementName.h +++ b/parser/html/nsHtml5ElementName.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2014 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit ElementName.java instead and regenerate. - */ - #ifndef nsHtml5ElementName_h #define nsHtml5ElementName_h diff --git a/parser/html/nsHtml5HtmlAttributes.cpp b/parser/html/nsHtml5HtmlAttributes.cpp index 62b9ae2b2..fc4c33cde 100644 --- a/parser/html/nsHtml5HtmlAttributes.cpp +++ b/parser/html/nsHtml5HtmlAttributes.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2008-2011 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,11 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit HtmlAttributes.java instead and regenerate. - */ - #define nsHtml5HtmlAttributes_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5HtmlAttributes.h b/parser/html/nsHtml5HtmlAttributes.h index 12149a0b5..e4423f152 100644 --- a/parser/html/nsHtml5HtmlAttributes.h +++ b/parser/html/nsHtml5HtmlAttributes.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2008-2011 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,11 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit HtmlAttributes.java instead and regenerate. - */ - #ifndef nsHtml5HtmlAttributes_h #define nsHtml5HtmlAttributes_h diff --git a/parser/html/nsHtml5MetaScanner.cpp b/parser/html/nsHtml5MetaScanner.cpp index 24f17b02b..b9c426c19 100644 --- a/parser/html/nsHtml5MetaScanner.cpp +++ b/parser/html/nsHtml5MetaScanner.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2008-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,11 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit MetaScanner.java instead and regenerate. - */ - #define nsHtml5MetaScanner_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5MetaScanner.h b/parser/html/nsHtml5MetaScanner.h index a4d308147..43f107454 100644 --- a/parser/html/nsHtml5MetaScanner.h +++ b/parser/html/nsHtml5MetaScanner.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2008-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,11 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit MetaScanner.java instead and regenerate. - */ - #ifndef nsHtml5MetaScanner_h #define nsHtml5MetaScanner_h diff --git a/parser/html/nsHtml5Portability.h b/parser/html/nsHtml5Portability.h index a3214dd2f..a0143940b 100644 --- a/parser/html/nsHtml5Portability.h +++ b/parser/html/nsHtml5Portability.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit Portability.java instead and regenerate. - */ - #ifndef nsHtml5Portability_h #define nsHtml5Portability_h diff --git a/parser/html/nsHtml5StackNode.cpp b/parser/html/nsHtml5StackNode.cpp index 41163ae40..3f527c656 100644 --- a/parser/html/nsHtml5StackNode.cpp +++ b/parser/html/nsHtml5StackNode.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2007-2011 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,11 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit StackNode.java instead and regenerate. - */ - #define nsHtml5StackNode_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5StackNode.h b/parser/html/nsHtml5StackNode.h index 1677ec571..a2fb57911 100644 --- a/parser/html/nsHtml5StackNode.h +++ b/parser/html/nsHtml5StackNode.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2007-2011 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,11 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit StackNode.java instead and regenerate. - */ - #ifndef nsHtml5StackNode_h #define nsHtml5StackNode_h diff --git a/parser/html/nsHtml5StateSnapshot.cpp b/parser/html/nsHtml5StateSnapshot.cpp index 90780738b..a943503b0 100644 --- a/parser/html/nsHtml5StateSnapshot.cpp +++ b/parser/html/nsHtml5StateSnapshot.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2010 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit StateSnapshot.java instead and regenerate. - */ - #define nsHtml5StateSnapshot_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5StateSnapshot.h b/parser/html/nsHtml5StateSnapshot.h index 119570499..be2bce158 100644 --- a/parser/html/nsHtml5StateSnapshot.h +++ b/parser/html/nsHtml5StateSnapshot.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2010 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit StateSnapshot.java instead and regenerate. - */ - #ifndef nsHtml5StateSnapshot_h #define nsHtml5StateSnapshot_h diff --git a/parser/html/nsHtml5Tokenizer.cpp b/parser/html/nsHtml5Tokenizer.cpp index e70c081bf..5464d211d 100644 --- a/parser/html/nsHtml5Tokenizer.cpp +++ b/parser/html/nsHtml5Tokenizer.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2005-2007 Henri Sivonen * Copyright (c) 2007-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * Portions of comments Copyright 2004-2010 Apple Computer, Inc., Mozilla * Foundation, and Opera Software ASA. * @@ -23,11 +24,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit Tokenizer.java instead and regenerate. - */ - #define nsHtml5Tokenizer_cpp__ #include "nsIAtom.h" @@ -127,15 +123,11 @@ nsHtml5Tokenizer::isViewingXmlSource() } void -nsHtml5Tokenizer::setStateAndEndTagExpectation(int32_t specialTokenizerState, nsIAtom* endTagExpectation) +nsHtml5Tokenizer::setState(int32_t specialTokenizerState) { this->stateSave = specialTokenizerState; - if (specialTokenizerState == NS_HTML5TOKENIZER_DATA) { - return; - } - autoJArray<char16_t,int32_t> asArray = nsHtml5Portability::newCharArrayFromLocal(endTagExpectation); - this->endTagExpectation = nsHtml5ElementName::elementNameByBuffer(asArray, 0, asArray.length, interner); - endTagExpectationToArray(); + this->endTagExpectation = nullptr; + this->endTagExpectationAsArray = nullptr; } void @@ -1062,9 +1054,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu } c = checkChar(buf, pos); switch(c) { - case '\0': { - NS_HTML5_BREAK(stateloop); - } case '-': { clearStrBufAfterOneHyphen(); state = P::transition(mViewSource, NS_HTML5TOKENIZER_COMMENT_START, reconsume, pos); @@ -1469,9 +1458,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu NS_HTML5_BREAK(stateloop); } c = checkChar(buf, pos); - if (c == '\0') { - NS_HTML5_BREAK(stateloop); - } switch(c) { case ' ': case '\t': @@ -1479,7 +1465,8 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu case '\r': case '\f': case '<': - case '&': { + case '&': + case '\0': { emitOrAppendCharRefBuf(returnState); if (!(returnState & NS_HTML5TOKENIZER_DATA_AND_RCDATA_MASK)) { cstart = pos; @@ -1527,9 +1514,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu NS_HTML5_BREAK(stateloop); } c = checkChar(buf, pos); - if (c == '\0') { - NS_HTML5_BREAK(stateloop); - } int32_t hilo = 0; if (c <= 'z') { const int32_t* row = nsHtml5NamedCharactersAccel::HILO_ACCEL[c]; @@ -1564,9 +1548,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu NS_HTML5_BREAK(stateloop); } c = checkChar(buf, pos); - if (c == '\0') { - NS_HTML5_BREAK(stateloop); - } entCol++; for (; ; ) { if (hi < lo) { @@ -2040,7 +2021,13 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu NS_HTML5_BREAK(stateloop); } c = checkChar(buf, pos); - if (index < endTagExpectationAsArray.length) { + if (!endTagExpectationAsArray) { + tokenHandler->characters(nsHtml5Tokenizer::LT_SOLIDUS, 0, 2); + cstart = pos; + reconsume = true; + state = P::transition(mViewSource, returnState, reconsume, pos); + NS_HTML5_CONTINUE(stateloop); + } else if (index < endTagExpectationAsArray.length) { char16_t e = endTagExpectationAsArray[index]; char16_t folded = c; if (c >= 'A' && c <= 'Z') { diff --git a/parser/html/nsHtml5Tokenizer.h b/parser/html/nsHtml5Tokenizer.h index 00cca9a9c..37f0eae17 100644 --- a/parser/html/nsHtml5Tokenizer.h +++ b/parser/html/nsHtml5Tokenizer.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2005-2007 Henri Sivonen * Copyright (c) 2007-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * Portions of comments Copyright 2004-2010 Apple Computer, Inc., Mozilla * Foundation, and Opera Software ASA. * @@ -23,11 +24,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit Tokenizer.java instead and regenerate. - */ - #ifndef nsHtml5Tokenizer_h #define nsHtml5Tokenizer_h @@ -143,7 +139,7 @@ class nsHtml5Tokenizer void setInterner(nsHtml5AtomTable* interner); void initLocation(nsHtml5String newPublicId, nsHtml5String newSystemId); bool isViewingXmlSource(); - void setStateAndEndTagExpectation(int32_t specialTokenizerState, nsIAtom* endTagExpectation); + void setState(int32_t specialTokenizerState); void setStateAndEndTagExpectation(int32_t specialTokenizerState, nsHtml5ElementName* endTagExpectation); private: void endTagExpectationToArray(); diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp index 457c7deb1..a02626e47 100644 --- a/parser/html/nsHtml5TreeBuilder.cpp +++ b/parser/html/nsHtml5TreeBuilder.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2007-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla * Foundation, and Opera Software ASA. * @@ -23,11 +24,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit TreeBuilder.java instead and regenerate. - */ - #define nsHtml5TreeBuilder_cpp__ #include "nsContentUtils.h" @@ -105,7 +101,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->camelCaseName, elt); currentPtr++; stack[currentPtr] = node; - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_DATA); mode = NS_HTML5TREE_BUILDER_FRAMESET_OK; } else if (contextNamespace == kNameSpaceID_MathML) { nsHtml5ElementName* elementName = nsHtml5ElementName::ELT_MATH; @@ -117,7 +113,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->name, false); currentPtr++; stack[currentPtr] = node; - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_DATA); mode = NS_HTML5TREE_BUILDER_FRAMESET_OK; } else { nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_HTML, elt); @@ -129,15 +125,20 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) resetTheInsertionMode(); formPointer = getFormPointerForContext(contextNode); if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::textarea == contextName) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RCDATA, contextName); - } else if (nsHtml5Atoms::style == contextName || nsHtml5Atoms::xmp == contextName || nsHtml5Atoms::iframe == contextName || nsHtml5Atoms::noembed == contextName || nsHtml5Atoms::noframes == contextName || (scriptingEnabled && nsHtml5Atoms::noscript == contextName)) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_RCDATA); + } else if (nsHtml5Atoms::style == contextName || + nsHtml5Atoms::xmp == contextName || + nsHtml5Atoms::iframe == contextName || + nsHtml5Atoms::noembed == contextName || + nsHtml5Atoms::noframes == contextName || + (scriptingEnabled && nsHtml5Atoms::noscript == contextName)) { + tokenizer->setState(NS_HTML5TOKENIZER_RAWTEXT); } else if (nsHtml5Atoms::plaintext == contextName) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_PLAINTEXT, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_PLAINTEXT); } else if (nsHtml5Atoms::script == contextName) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_SCRIPT_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_SCRIPT_DATA); } else { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_DATA); } } contextName = nullptr; diff --git a/parser/html/nsHtml5TreeBuilder.h b/parser/html/nsHtml5TreeBuilder.h index 67f5010c5..208402d36 100644 --- a/parser/html/nsHtml5TreeBuilder.h +++ b/parser/html/nsHtml5TreeBuilder.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2007-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla * Foundation, and Opera Software ASA. * @@ -23,11 +24,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit TreeBuilder.java instead and regenerate. - */ - #ifndef nsHtml5TreeBuilder_h #define nsHtml5TreeBuilder_h diff --git a/parser/html/nsHtml5UTF16Buffer.cpp b/parser/html/nsHtml5UTF16Buffer.cpp index 0d6870bc4..e829accb0 100644 --- a/parser/html/nsHtml5UTF16Buffer.cpp +++ b/parser/html/nsHtml5UTF16Buffer.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2010 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit UTF16Buffer.java instead and regenerate. - */ - #define nsHtml5UTF16Buffer_cpp__ #include "nsIAtom.h" diff --git a/parser/html/nsHtml5UTF16Buffer.h b/parser/html/nsHtml5UTF16Buffer.h index c94245f74..e783c28d3 100644 --- a/parser/html/nsHtml5UTF16Buffer.h +++ b/parser/html/nsHtml5UTF16Buffer.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2008-2010 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* - * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. - * Please edit UTF16Buffer.java instead and regenerate. - */ - #ifndef nsHtml5UTF16Buffer_h #define nsHtml5UTF16Buffer_h diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py index dfc7cf8ad..00d9ff9bb 100644 --- a/python/mozbuild/mozbuild/configure/constants.py +++ b/python/mozbuild/mozbuild/configure/constants.py @@ -23,6 +23,7 @@ OS = EnumString.subclass( 'iOS', 'NetBSD', 'OpenBSD', + 'SunOS', 'OSX', 'WINNT', ) @@ -35,6 +36,7 @@ Kernel = EnumString.subclass( 'Linux', 'NetBSD', 'OpenBSD', + 'SunOS', 'WINNT', ) @@ -97,6 +99,7 @@ kernel_preprocessor_checks = { 'Linux': '__linux__', 'NetBSD': '__NetBSD__', 'OpenBSD': '__OpenBSD__', + 'SunOS': '__sun__', 'WINNT': '_WIN32 || __CYGWIN__', } diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index a45656b37..c2e1a3e89 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -544,9 +544,14 @@ class Build(MachCommandBase): # Check if there are any unpreprocessed files in '@MOZ_OBJDIR@/dist/bin' # See python/mozbuild/mozbuild/preprocessor.py#L293-L309 for the list of directives # We skip if, ifdef, ifndef, else, elif, elifdef and elifndef, because they are never used alone - grepcmd = 'grep -E -r "^(#|%)(define|endif|error|expand|filter|include|literal|undef|unfilter)" '\ - + '--include=\*.{css,dtd,html,js,jsm,xhtml,xml,xul,manifest,properties,rdf} '\ - + self.topobjdir + '/dist/bin | awk "/\.css:%/ || (!/\.css/ && /:#/)"' + # + # The original version of this script only worked with GNU grep because of the --include flag. + # Not a problem in and of itself, except that it didn't take TOOLCHAIN_PREFIX and simply assumed + # all operating systems use GNU grep as the system grep (often it's called ggrep or something). + # This script is a bit slower, but should do the same thing on all Unix platforms. + + grepcmd = 'find ' + self.topobjdir + '/dist/bin' + ' -name \'\*.{css,dtd,html,js,jsm,xhtml,xml,xul,manifest,properties,rdf}\' ' + '| xargs grep -E "^(#|%)(define|endif|error|expand|filter|include|literal|undef|unfilter)" '\ + + '| awk "/\.css:%/ || (!/\.css/ && /:#/)"' grepresult = subprocess.Popen(grepcmd, stdout=subprocess.PIPE, shell=True).communicate()[0] if grepresult: print('\nERROR: preprocessor was not applied to the following files:\n\n' + grepresult) diff --git a/python/mozbuild/mozbuild/mozconfig_loader b/python/mozbuild/mozbuild/mozconfig_loader index 6b1e05dce..6c3df47ac 100755 --- a/python/mozbuild/mozbuild/mozconfig_loader +++ b/python/mozbuild/mozbuild/mozconfig_loader @@ -10,49 +10,46 @@ set -e ac_add_options() { - local opt - for opt; do - case "$opt" in + for _mozconfig_opt; do + case "$_mozconfig_opt" in --target=*) echo "------BEGIN_MK_OPTION" - echo $opt | sed s/--target/CONFIG_GUESS/ + echo $_mozconfig_opt | sed s/--target/CONFIG_GUESS/ echo "------END_MK_OPTION" ;; esac echo "------BEGIN_AC_OPTION" - echo $opt + echo $_mozconfig_opt echo "------END_AC_OPTION" done } ac_add_app_options() { - local app - app=$1 + _mozconfig_app=$1 shift echo "------BEGIN_AC_APP_OPTION" - echo $app + echo $_mozconfig_app echo "$*" echo "------END_AC_APP_OPTION" } mk_add_options() { - local opt name op value - for opt; do + for _mozconfig_opt; do echo "------BEGIN_MK_OPTION" - echo $opt + echo $_mozconfig_opt # Remove any leading "export" - opt=${opt#export} - case "$opt" in - *\?=*) op="?=" ;; - *:=*) op=":=" ;; - *+=*) op="+=" ;; - *=*) op="=" ;; + opt=${_mozconfig_opt#export} + case "$_mozconfig_opt" in + *\?=*) _mozconfig_op="?=" ;; + *:=*) _mozconfig_op=":=" ;; + *+=*) _mozconfig_op="+=" ;; + *=*) _mozconfig_op="=" ;; esac # Remove the operator and the value that follows - name=${opt%%${op}*} - # Note: $(echo ${name}) strips the variable from any leading and trailing + _mozconfig_name=${_mozconfig_opt%%${_mozconfig_op}*} + # Note: $(echo ${_mozconfig_name}) strips the variable from any leading and trailing # whitespaces. - eval "$(echo ${name})_IS_SET=1" + eval "$(echo ${_mozconfig_name})_IS_SET=1" echo "------END_MK_OPTION" done } @@ -77,4 +74,5 @@ echo "------END_AFTER_SOURCE" echo "------BEGIN_ENV_AFTER_SOURCE" $3 $4 + echo "------END_ENV_AFTER_SOURCE" diff --git a/security/manager/ssl/nsISiteSecurityService.idl b/security/manager/ssl/nsISiteSecurityService.idl index 753f32b57..b61577152 100644 --- a/security/manager/ssl/nsISiteSecurityService.idl +++ b/security/manager/ssl/nsISiteSecurityService.idl @@ -23,7 +23,7 @@ namespace mozilla [ref] native nsCStringTArrayRef(nsTArray<nsCString>); [ref] native mozillaPkixTime(mozilla::pkix::Time); -[scriptable, uuid(275127f8-dbd7-4681-afbf-6df0c6587a01)] +[scriptable, uuid(233908bd-6741-4474-a6e1-f298c6ce9eaf)] interface nsISiteSecurityService : nsISupports { const uint32_t HEADER_HSTS = 0; @@ -98,15 +98,21 @@ interface nsISiteSecurityService : nsISupports * Given a header type, removes state relating to that header of a host, * including the includeSubdomains state that would affect subdomains. * This essentially removes the state for the domain tree rooted at this - * host. + * host. If any preloaded information is present for that host, that + * information will then be used instead of any other previously existing + * state, unless the force parameter is set. + * * @param aType the type of security state in question * @param aURI the URI of the target host * @param aFlags options for this request as defined in nsISocketProvider: * NO_PERMANENT_STORAGE + * @param force if set, forces no-HSTS state by writing a knockout value, + * overriding any preload list state */ void removeState(in uint32_t aType, in nsIURI aURI, - in uint32_t aFlags); + in uint32_t aFlags, + [optional] in boolean force); /** * See isSecureURI diff --git a/security/manager/ssl/nsSiteSecurityService.cpp b/security/manager/ssl/nsSiteSecurityService.cpp index cfee79d8d..44ee7dcc0 100644 --- a/security/manager/ssl/nsSiteSecurityService.cpp +++ b/security/manager/ssl/nsSiteSecurityService.cpp @@ -330,21 +330,22 @@ nsSiteSecurityService::SetHSTSState(uint32_t aType, uint32_t flags, SecurityPropertyState aHSTSState) { - // If max-age is zero, that's an indication to immediately remove the - // security state, so here's a shortcut. - if (!maxage) { - return RemoveState(aType, aSourceURI, flags); + // Exit early if STS not enabled + if (!mUseStsService) { + return NS_OK; + } + + // If max-age is zero, the host is no longer considered HSTS. If the host was + // preloaded, we store an entry indicating that this host is not HSTS, causing + // the preloaded information to be ignored. + if (maxage == 0) { + return RemoveState(aType, aSourceURI, flags, true); } MOZ_ASSERT((aHSTSState == SecurityPropertySet || aHSTSState == SecurityPropertyNegative), "HSTS State must be SecurityPropertySet or SecurityPropertyNegative"); - // Exit early if STS not enabled - if (!mUseStsService) { - return NS_OK; - } - int64_t expiretime = ExpireTimeFromMaxAge(maxage); SiteHSTSState siteState(expiretime, aHSTSState, includeSubdomains); nsAutoCString stateString; @@ -367,7 +368,7 @@ nsSiteSecurityService::SetHSTSState(uint32_t aType, NS_IMETHODIMP nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI, - uint32_t aFlags) + uint32_t aFlags, bool force = false) { // Child processes are not allowed direct access to this. if (!XRE_IsParentProcess()) { @@ -387,8 +388,9 @@ nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI, mozilla::DataStorageType storageType = isPrivate ? mozilla::DataStorage_Private : mozilla::DataStorage_Persistent; - // If this host is in the preload list, we have to store a knockout entry. - if (GetPreloadListEntry(hostname.get())) { + // If this host is in the preload list, we have to store a knockout entry + // if it's explicitly forced to not be HSTS anymore + if (force && GetPreloadListEntry(hostname.get())) { SSSLOG(("SSS: storing knockout entry for %s", hostname.get())); SiteHSTSState siteState(0, SecurityPropertyKnockout, false); nsAutoCString stateString; @@ -769,7 +771,10 @@ nsSiteSecurityService::ProcessPKPHeader(nsIURI* aSourceURI, return NS_ERROR_FAILURE; } - // if maxAge == 0 we must delete all state, for now no hole-punching + // If maxAge == 0, we remove dynamic HPKP state for this host. Due to + // architectural constraints, if this host was preloaded, any future lookups + // will use the preloaded state (i.e. we can't store a "this host is not HPKP" + // entry like we can for HSTS). if (maxAge == 0) { return RemoveState(aType, aSourceURI, aFlags); } diff --git a/security/nss/coreconf/coreconf.dep b/security/nss/coreconf/coreconf.dep index 5182f7555..590d1bfae 100644 --- a/security/nss/coreconf/coreconf.dep +++ b/security/nss/coreconf/coreconf.dep @@ -10,3 +10,4 @@ */ #error "Do not include this header file." + diff --git a/security/nss/lib/dbm/include/extern.h b/security/nss/lib/dbm/include/extern.h index 897369fb8..4fbdc2d80 100644 --- a/security/nss/lib/dbm/include/extern.h +++ b/security/nss/lib/dbm/include/extern.h @@ -31,32 +31,32 @@ * @(#)extern.h 8.4 (Berkeley) 6/16/94 */ -BUFHEAD *__add_ovflpage(HTAB *, BUFHEAD *); -int __addel(HTAB *, BUFHEAD *, const DBT *, const DBT *); -int __big_delete(HTAB *, BUFHEAD *); -int __big_insert(HTAB *, BUFHEAD *, const DBT *, const DBT *); -int __big_keydata(HTAB *, BUFHEAD *, DBT *, DBT *, int); -int __big_return(HTAB *, BUFHEAD *, int, DBT *, int); -int __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *, - uint32, uint32, SPLIT_RETURN *); -int __buf_free(HTAB *, int, int); -void __buf_init(HTAB *, int); -uint32 __call_hash(HTAB *, char *, size_t); -int __delpair(HTAB *, BUFHEAD *, int); -int __expand_table(HTAB *); -int __find_bigpair(HTAB *, BUFHEAD *, int, char *, int); -uint16 __find_last_page(HTAB *, BUFHEAD **); -void __free_ovflpage(HTAB *, BUFHEAD *); -BUFHEAD *__get_buf(HTAB *, uint32, BUFHEAD *, int); -int __get_page(HTAB *, char *, uint32, int, int, int); -int __ibitmap(HTAB *, int, int, int); -uint32 __log2(uint32); -int __put_page(HTAB *, char *, uint32, int, int); -void __reclaim_buf(HTAB *, BUFHEAD *); -int __split_page(HTAB *, uint32, uint32); +BUFHEAD *dbm_add_ovflpage(HTAB *, BUFHEAD *); +int dbm_addel(HTAB *, BUFHEAD *, const DBT *, const DBT *); +int dbm_big_delete(HTAB *, BUFHEAD *); +int dbm_big_insert(HTAB *, BUFHEAD *, const DBT *, const DBT *); +int dbm_big_keydata(HTAB *, BUFHEAD *, DBT *, DBT *, int); +int dbm_big_return(HTAB *, BUFHEAD *, int, DBT *, int); +int dbm_big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *, + uint32, uint32, SPLIT_RETURN *); +int dbm_buf_free(HTAB *, int, int); +void dbm_buf_init(HTAB *, int); +uint32 dbm_call_hash(HTAB *, char *, size_t); +int dbm_delpair(HTAB *, BUFHEAD *, int); +int dbm_expand_table(HTAB *); +int dbm_find_bigpair(HTAB *, BUFHEAD *, int, char *, int); +uint16 dbm_find_last_page(HTAB *, BUFHEAD **); +void dbm_free_ovflpage(HTAB *, BUFHEAD *); +BUFHEAD *dbm_get_buf(HTAB *, uint32, BUFHEAD *, int); +int dbm_get_page(HTAB *, char *, uint32, int, int, int); +int dbm_ibitmap(HTAB *, int, int, int); +uint32 dbm_log2(uint32); +int dbm_put_page(HTAB *, char *, uint32, int, int); +void dbm_reclaim_buf(HTAB *, BUFHEAD *); +int dbm_split_page(HTAB *, uint32, uint32); /* Default hash routine. */ -extern uint32 (*__default_hash)(const void *, size_t); +extern uint32 (*dbm_default_hash)(const void *, size_t); #ifdef HASH_STATISTICS extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows; diff --git a/security/nss/lib/dbm/include/hash.h b/security/nss/lib/dbm/include/hash.h index 7da51dc64..0ce3c3ff2 100644 --- a/security/nss/lib/dbm/include/hash.h +++ b/security/nss/lib/dbm/include/hash.h @@ -190,7 +190,7 @@ typedef struct htab { /* Memory resident data structure */ #define OADDR_OF(S, O) ((uint32)((uint32)(S) << SPLITSHIFT) + (O)) #define BUCKET_TO_PAGE(B) \ - (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((uint32)((B) + 1)) - 1] : 0) + (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[dbm_log2((uint32)((B) + 1)) - 1] : 0) #define OADDR_TO_PAGE(B) \ BUCKET_TO_PAGE((1 << SPLITNUM((B))) - 1) + OPAGENUM((B)); @@ -314,28 +314,28 @@ typedef struct htab { /* Memory resident data structure */ #define NEXT_FREE hdr.next_free #define H_CHARKEY hdr.h_charkey -extern uint32 (*__default_hash)(const void *, size_t); -void __buf_init(HTAB *hashp, int32 nbytes); -int __big_delete(HTAB *hashp, BUFHEAD *bufp); -BUFHEAD *__get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage); -uint32 __call_hash(HTAB *hashp, char *k, size_t len); +extern uint32 (*dbm_default_hash)(const void *, size_t); +void dbm_buf_init(HTAB *hashp, int32 nbytes); +int dbm_big_delete(HTAB *hashp, BUFHEAD *bufp); +BUFHEAD *dbm_get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage); +uint32 dbm_call_hash(HTAB *hashp, char *k, size_t len); #include "page.h" -extern int __big_split(HTAB *hashp, BUFHEAD *op, BUFHEAD *np, - BUFHEAD *big_keyp, uint32 addr, uint32 obucket, SPLIT_RETURN *ret); -void __free_ovflpage(HTAB *hashp, BUFHEAD *obufp); -BUFHEAD *__add_ovflpage(HTAB *hashp, BUFHEAD *bufp); -int __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val); -int __expand_table(HTAB *hashp); -uint32 __log2(uint32 num); -void __reclaim_buf(HTAB *hashp, BUFHEAD *bp); -int __get_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_disk, int is_bitmap); -int __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap); -int __ibitmap(HTAB *hashp, int pnum, int nbits, int ndx); -int __buf_free(HTAB *hashp, int do_free, int to_disk); -int __find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size); -uint16 __find_last_page(HTAB *hashp, BUFHEAD **bpp); -int __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val); -int __big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current); -int __delpair(HTAB *hashp, BUFHEAD *bufp, int ndx); -int __big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set); -int __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket); +extern int dbm_big_split(HTAB *hashp, BUFHEAD *op, BUFHEAD *np, + BUFHEAD *big_keyp, uint32 addr, uint32 obucket, SPLIT_RETURN *ret); +void dbm_free_ovflpage(HTAB *hashp, BUFHEAD *obufp); +BUFHEAD *dbm_add_ovflpage(HTAB *hashp, BUFHEAD *bufp); +int dbm_big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val); +int dbm_expand_table(HTAB *hashp); +uint32 dbm_log2(uint32 num); +void dbm_reclaim_buf(HTAB *hashp, BUFHEAD *bp); +int dbm_get_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_disk, int is_bitmap); +int dbm_put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap); +int dbm_ibitmap(HTAB *hashp, int pnum, int nbits, int ndx); +int dbm_buf_free(HTAB *hashp, int do_free, int to_disk); +int dbm_find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size); +uint16 dbm_find_last_page(HTAB *hashp, BUFHEAD **bpp); +int dbm_addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val); +int dbm_big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current); +int dbm_delpair(HTAB *hashp, BUFHEAD *bufp, int ndx); +int dbm_big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set); +int dbm_split_page(HTAB *hashp, uint32 obucket, uint32 nbucket); diff --git a/security/nss/lib/dbm/include/mcom_db.h b/security/nss/lib/dbm/include/mcom_db.h index 0a4f6dc14..e961dd1b4 100644 --- a/security/nss/lib/dbm/include/mcom_db.h +++ b/security/nss/lib/dbm/include/mcom_db.h @@ -287,16 +287,16 @@ typedef enum { LockOutDatabase, #endif /* Access method description structure. */ -typedef struct __db { +typedef struct dbm_db { DBTYPE type; /* Underlying db type. */ - int (*close)(struct __db *); - int (*del)(const struct __db *, const DBT *, uint); - int (*get)(const struct __db *, const DBT *, DBT *, uint); - int (*put)(const struct __db *, DBT *, const DBT *, uint); - int (*seq)(const struct __db *, DBT *, DBT *, uint); - int (*sync)(const struct __db *, uint); + int (*close)(struct dbm_db *); + int (*del)(const struct dbm_db *, const DBT *, uint); + int (*get)(const struct dbm_db *, const DBT *, DBT *, uint); + int (*put)(const struct dbm_db *, DBT *, const DBT *, uint); + int (*seq)(const struct dbm_db *, DBT *, DBT *, uint); + int (*sync)(const struct dbm_db *, uint); void *internal; /* Access method private. */ - int (*fd)(const struct __db *); + int (*fd)(const struct dbm_db *); } DB; #define BTREEMAGIC 0x053162 @@ -412,10 +412,10 @@ dbopen(const char *, int, int, DBTYPE, const void *); void dbSetOrClearDBLock(DBLockFlagEnum type); #ifdef __DBINTERFACE_PRIVATE -DB *__bt_open(const char *, int, int, const BTREEINFO *, int); -DB *__hash_open(const char *, int, int, const HASHINFO *, int); -DB *__rec_open(const char *, int, int, const RECNOINFO *, int); -void __dbpanic(DB *dbp); +DB *dbm_bt_open(const char *, int, int, const BTREEINFO *, int); +DB *dbm_hash_open(const char *, int, int, const HASHINFO *, int); +DB *dbm_rec_open(const char *, int, int, const RECNOINFO *, int); +void dbm_dbpanic(DB *dbp); #endif PR_END_EXTERN_C diff --git a/security/nss/lib/dbm/include/ncompat.h b/security/nss/lib/dbm/include/ncompat.h index 9fd434799..f9f631622 100644 --- a/security/nss/lib/dbm/include/ncompat.h +++ b/security/nss/lib/dbm/include/ncompat.h @@ -89,13 +89,13 @@ typedef unsigned int sigset_t; #define SIG_UNBLOCK 2 #define SIG_SETMASK 3 -static int __sigtemp; /* For the use of sigprocmask */ +static int dbm_sigtemp; /* For the use of sigprocmask */ /* Repeated test of oset != NULL is to avoid "*0". */ #define sigprocmask(how, set, oset) \ - ((__sigtemp = \ + ((dbm_sigtemp = \ (((how) == SIG_BLOCK) ? sigblock(0) | *(set) : (((how) == SIG_UNBLOCK) ? sigblock(0) & ~(*(set)) : ((how) == SIG_SETMASK ? *(set) : sigblock(0))))), \ - ((oset) ? (*(oset ? oset : set) = sigsetmask(__sigtemp)) : sigsetmask(__sigtemp)), 0) + ((oset) ? (*(oset ? oset : set) = sigsetmask(dbm_sigtemp)) : sigsetmask(dbm_sigtemp)), 0) #endif /* diff --git a/security/nss/lib/dbm/src/db.c b/security/nss/lib/dbm/src/db.c index 5c35bbd48..4b5810760 100644 --- a/security/nss/lib/dbm/src/db.c +++ b/security/nss/lib/dbm/src/db.c @@ -92,16 +92,16 @@ dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo /* we don't need btree and recno right now */ #if 0 case DB_BTREE: - return (__bt_open(fname, flags & USE_OPEN_FLAGS, + return (dbm_bt_open(fname, flags & USE_OPEN_FLAGS, mode, openinfo, flags & DB_FLAGS)); case DB_RECNO: - return (__rec_open(fname, flags & USE_OPEN_FLAGS, + return (dbm_rec_open(fname, flags & USE_OPEN_FLAGS, mode, openinfo, flags & DB_FLAGS)); #endif case DB_HASH: - return (__hash_open(fname, flags & USE_OPEN_FLAGS, - mode, (const HASHINFO *)openinfo, flags & DB_FLAGS)); + return (dbm_hash_open(fname, flags & USE_OPEN_FLAGS, + mode, (const HASHINFO *)openinfo, flags & DB_FLAGS)); default: break; } @@ -110,7 +110,7 @@ dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo } static int -__dberr() +dbm_dberr() { return (RET_ERROR); } @@ -122,13 +122,14 @@ __dberr() * dbp: pointer to the DB structure. */ void -__dbpanic(DB *dbp) +dbm_dbpanic(DB *dbp) { /* The only thing that can succeed is a close. */ - dbp->del = (int (*)(const struct __db *, const DBT *, uint))__dberr; - dbp->fd = (int (*)(const struct __db *))__dberr; - dbp->get = (int (*)(const struct __db *, const DBT *, DBT *, uint))__dberr; - dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, uint))__dberr; - dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, uint))__dberr; - dbp->sync = (int (*)(const struct __db *, uint))__dberr; + dbp->del = (int (*)(const struct dbm_db *, const DBT *, uint))dbm_dberr; + dbp->fd = (int (*)(const struct dbm_db *))dbm_dberr; + dbp->get = (int (*)(const struct dbm_db *, const DBT *, DBT *, uint))dbm_dberr; + dbp->put = (int (*)(const struct dbm_db *, DBT *, const DBT *, uint))dbm_dberr; + dbp->seq = (int (*)(const struct dbm_db *, DBT *, DBT *, uint))dbm_dberr; + dbp->sync = (int (*)(const struct dbm_db *, uint))dbm_dberr; + } diff --git a/security/nss/lib/dbm/src/h_bigkey.c b/security/nss/lib/dbm/src/h_bigkey.c index 6edfe7f5a..795c7a09d 100644 --- a/security/nss/lib/dbm/src/h_bigkey.c +++ b/security/nss/lib/dbm/src/h_bigkey.c @@ -85,7 +85,7 @@ static int collect_data(HTAB *, BUFHEAD *, int, int); *-1 ==> ERROR */ extern int -__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) +dbm_big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) { register uint16 *p; uint key_size, n, val_size; @@ -114,7 +114,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) FREESPACE(p) = off - PAGE_META(n); OFFSET(p) = off; p[n] = PARTIAL_KEY; - bufp = __add_ovflpage(hashp, bufp); + bufp = dbm_add_ovflpage(hashp, bufp); if (!bufp) return (-1); n = p[0]; @@ -158,7 +158,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) OFFSET(p) = off; if (val_size) { p[n] = FULL_KEY; - bufp = __add_ovflpage(hashp, bufp); + bufp = dbm_add_ovflpage(hashp, bufp); if (!bufp) return (-1); cp = bufp->page; @@ -182,7 +182,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) *-1 => ERROR */ extern int -__big_delete(HTAB *hashp, BUFHEAD *bufp) +dbm_big_delete(HTAB *hashp, BUFHEAD *bufp) { register BUFHEAD *last_bfp, *rbufp; uint16 *bp, pageno; @@ -207,9 +207,9 @@ __big_delete(HTAB *hashp, BUFHEAD *bufp) break; pageno = bp[bp[0] - 1]; rbufp->flags |= BUF_MOD; - rbufp = __get_buf(hashp, pageno, rbufp, 0); + rbufp = dbm_get_buf(hashp, pageno, rbufp, 0); if (last_bfp) - __free_ovflpage(hashp, last_bfp); + dbm_free_ovflpage(hashp, last_bfp); last_bfp = rbufp; if (!rbufp) return (-1); /* Error. */ @@ -244,9 +244,9 @@ __big_delete(HTAB *hashp, BUFHEAD *bufp) bufp->flags |= BUF_MOD; if (rbufp) - __free_ovflpage(hashp, rbufp); + dbm_free_ovflpage(hashp, rbufp); if (last_bfp != rbufp) - __free_ovflpage(hashp, last_bfp); + dbm_free_ovflpage(hashp, last_bfp); hashp->NKEYS--; return (0); @@ -259,7 +259,7 @@ __big_delete(HTAB *hashp, BUFHEAD *bufp) * -3 error */ extern int -__find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) +dbm_find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) { register uint16 *bp; register char *p; @@ -279,7 +279,7 @@ __find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) return (-2); kkey += bytes; ksize -= bytes; - bufp = __get_buf(hashp, bp[ndx + 2], bufp, 0); + bufp = dbm_get_buf(hashp, bp[ndx + 2], bufp, 0); if (!bufp) return (-3); p = bufp->page; @@ -306,7 +306,7 @@ __find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) * bucket) */ extern uint16 -__find_last_page(HTAB *hashp, BUFHEAD **bpp) +dbm_find_last_page(HTAB *hashp, BUFHEAD **bpp) { BUFHEAD *bufp; uint16 *bp, pageno; @@ -332,7 +332,7 @@ __find_last_page(HTAB *hashp, BUFHEAD **bpp) return (0); pageno = bp[n - 1]; - bufp = __get_buf(hashp, pageno, bufp, 0); + bufp = dbm_get_buf(hashp, pageno, bufp, 0); if (!bufp) return (0); /* Need to indicate an error! */ bp = (uint16 *)bufp->page; @@ -350,7 +350,7 @@ __find_last_page(HTAB *hashp, BUFHEAD **bpp) * index (index should always be 1). */ extern int -__big_return( +dbm_big_return( HTAB *hashp, BUFHEAD *bufp, int ndx, @@ -364,7 +364,7 @@ __big_return( bp = (uint16 *)bufp->page; while (bp[ndx + 1] == PARTIAL_KEY) { - bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!bufp) return (-1); bp = (uint16 *)bufp->page; @@ -372,7 +372,7 @@ __big_return( } if (bp[ndx + 1] == FULL_KEY) { - bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!bufp) return (-1); bp = (uint16 *)bufp->page; @@ -392,7 +392,7 @@ __big_return( len = bp[1] - off; save_p = bufp; save_addr = bufp->addr; - bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!bufp) return (-1); bp = (uint16 *)bufp->page; @@ -409,8 +409,8 @@ __big_return( hashp->cbucket++; hashp->cndx = 1; } else { - hashp->cpage = __get_buf(hashp, - bp[bp[0] - 1], bufp, 0); + hashp->cpage = dbm_get_buf(hashp, + bp[bp[0] - 1], bufp, 0); if (!hashp->cpage) return (-1); hashp->cndx = 1; @@ -470,7 +470,7 @@ collect_data( save_bufp->flags |= BUF_PIN; /* read the length of the buffer */ - for (totlen = len; bufp; bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0)) { + for (totlen = len; bufp; bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0)) { bp = (uint16 *)bufp->page; mylen = hashp->BSIZE - bp[1]; @@ -502,7 +502,7 @@ collect_data( /* copy the buffers back into temp buf */ for (bufp = save_bufp; bufp; - bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0)) { + bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0)) { bp = (uint16 *)bufp->page; mylen = hashp->BSIZE - bp[1]; memmove(&hashp->tmp_buf[len], (bufp->page) + bp[1], (size_t)mylen); @@ -522,7 +522,7 @@ collect_data( hashp->cpage = NULL; hashp->cbucket++; } else { - hashp->cpage = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + hashp->cpage = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!hashp->cpage) return (-1); else if (!((uint16 *)hashp->cpage->page)[0]) { @@ -538,7 +538,7 @@ collect_data( * Fill in the key and data for this big pair. */ extern int -__big_keydata( +dbm_big_keydata( HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, @@ -579,10 +579,10 @@ collect_key( free(hashp->tmp_key); if ((hashp->tmp_key = (char *)malloc((size_t)totlen)) == NULL) return (-1); - if (__big_return(hashp, bufp, 1, val, set)) + if (dbm_big_return(hashp, bufp, 1, val, set)) return (-1); } else { - xbp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + xbp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!xbp || ((totlen = collect_key(hashp, xbp, totlen, val, set)) < 1)) return (-1); @@ -601,7 +601,7 @@ collect_key( * -1 => error */ extern int -__big_split( +dbm_big_split( HTAB *hashp, BUFHEAD *op, /* Pointer to where to put keys that go in old bucket */ BUFHEAD *np, /* Pointer to new bucket page */ @@ -621,13 +621,13 @@ __big_split( bp = big_keyp; /* Now figure out where the big key/data goes */ - if (__big_keydata(hashp, big_keyp, &key, &val, 0)) + if (dbm_big_keydata(hashp, big_keyp, &key, &val, 0)) return (-1); - change = (__call_hash(hashp, (char *)key.data, key.size) != obucket); + change = (dbm_call_hash(hashp, (char *)key.data, key.size) != obucket); - if ((ret->next_addr = __find_last_page(hashp, &big_keyp))) { + if ((ret->next_addr = dbm_find_last_page(hashp, &big_keyp))) { if (!(ret->nextp = - __get_buf(hashp, ret->next_addr, big_keyp, 0))) + dbm_get_buf(hashp, ret->next_addr, big_keyp, 0))) return (-1); ; } else @@ -692,7 +692,7 @@ __big_split( tp[0] -= 2; FREESPACE(tp) = free_space + OVFLSIZE; OFFSET(tp) = off; - tmpp = __add_ovflpage(hashp, big_keyp); + tmpp = dbm_add_ovflpage(hashp, big_keyp); if (!tmpp) return (-1); tp[4] = n; @@ -704,4 +704,5 @@ __big_split( else ret->oldp = tmpp; return (0); + } diff --git a/security/nss/lib/dbm/src/h_func.c b/security/nss/lib/dbm/src/h_func.c index 0d8734e8b..897060992 100644 --- a/security/nss/lib/dbm/src/h_func.c +++ b/security/nss/lib/dbm/src/h_func.c @@ -52,7 +52,7 @@ static uint32 hash3(const void *, size_t); static uint32 hash4(const void *, size_t); /* Global default hash function */ -uint32 (*__default_hash)(const void *, size_t) = hash4; +uint32 (*dbm_default_hash)(const void *, size_t) = hash4; /* * HASH FUNCTIONS @@ -205,3 +205,4 @@ hash4(const void *keyarg, register size_t len) } return (h); } + diff --git a/security/nss/lib/dbm/src/h_log2.c b/security/nss/lib/dbm/src/h_log2.c index a42b51a99..0e91fd042 100644 --- a/security/nss/lib/dbm/src/h_log2.c +++ b/security/nss/lib/dbm/src/h_log2.c @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94"; #include "mcom_db.h" uint32 -__log2(uint32 num) +dbm_log2(uint32 num) { register uint32 i, limit; @@ -51,4 +51,5 @@ __log2(uint32 num) for (i = 0; limit < num; limit = limit << 1, i++) { } return (i); + } diff --git a/security/nss/lib/dbm/src/h_page.c b/security/nss/lib/dbm/src/h_page.c index e5623224b..e6f61c623 100644 --- a/security/nss/lib/dbm/src/h_page.c +++ b/security/nss/lib/dbm/src/h_page.c @@ -204,7 +204,7 @@ putpair(char *p, const DBT *key, DBT *val) * -1 error */ extern int -__delpair(HTAB *hashp, BUFHEAD *bufp, int ndx) +dbm_delpair(HTAB *hashp, BUFHEAD *bufp, int ndx) { register uint16 *bp, newoff; register int n; @@ -214,7 +214,7 @@ __delpair(HTAB *hashp, BUFHEAD *bufp, int ndx) n = bp[0]; if (bp[ndx + 1] < REAL_KEY) - return (__big_delete(hashp, bufp)); + return (dbm_big_delete(hashp, bufp)); if (ndx != 1) newoff = bp[ndx - 1]; else @@ -277,7 +277,7 @@ __delpair(HTAB *hashp, BUFHEAD *bufp, int ndx) * -1 ==> Error */ extern int -__split_page(HTAB *hashp, uint32 obucket, uint32 nbucket) +dbm_split_page(HTAB *hashp, uint32 obucket, uint32 nbucket) { register BUFHEAD *new_bufp, *old_bufp; register uint16 *ino; @@ -292,10 +292,10 @@ __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket) copyto = (uint16)hashp->BSIZE; off = (uint16)hashp->BSIZE; - old_bufp = __get_buf(hashp, obucket, NULL, 0); + old_bufp = dbm_get_buf(hashp, obucket, NULL, 0); if (old_bufp == NULL) return (-1); - new_bufp = __get_buf(hashp, nbucket, NULL, 0); + new_bufp = dbm_get_buf(hashp, nbucket, NULL, 0); if (new_bufp == NULL) return (-1); @@ -331,7 +331,7 @@ __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket) assert(((int)key.size) > -1); #endif - if (__call_hash(hashp, (char *)key.data, key.size) == obucket) { + if (dbm_call_hash(hashp, (char *)key.data, key.size) == obucket) { /* Don't switch page */ diff = copyto - off; if (diff) { @@ -443,8 +443,8 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, return DATABASE_CORRUPTED_ERROR; if (ino[2] < REAL_KEY && ino[2] != OVFLPAGE) { - if ((status = __big_split(hashp, old_bufp, - new_bufp, bufp, bufp->addr, obucket, &ret))) + if ((status = dbm_big_split(hashp, old_bufp, + new_bufp, bufp, bufp->addr, obucket, &ret))) return (status); old_bufp = ret.oldp; if (!old_bufp) @@ -477,7 +477,7 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, scopyto - sizeof(uint16) * (ino[0] + 3); OFFSET(ino) = scopyto; - bufp = __get_buf(hashp, ov_addr, bufp, 0); + bufp = dbm_get_buf(hashp, ov_addr, bufp, 0); if (!bufp) return (-1); @@ -487,7 +487,7 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, moved = 0; if (last_bfp) - __free_ovflpage(hashp, last_bfp); + dbm_free_ovflpage(hashp, last_bfp); last_bfp = bufp; } /* Move regular sized pairs of there are any */ @@ -506,13 +506,13 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, val.size = ino[n] - ino[n + 1]; off = ino[n + 1]; - if (__call_hash(hashp, (char *)key.data, key.size) == obucket) { + if (dbm_call_hash(hashp, (char *)key.data, key.size) == obucket) { /* Keep on old page */ if (PAIRFITS(op, (&key), (&val))) putpair((char *)op, &key, &val); else { old_bufp = - __add_ovflpage(hashp, old_bufp); + dbm_add_ovflpage(hashp, old_bufp); if (!old_bufp) return (-1); op = (uint16 *)old_bufp->page; @@ -525,7 +525,7 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, putpair((char *)np, &key, &val); else { new_bufp = - __add_ovflpage(hashp, new_bufp); + dbm_add_ovflpage(hashp, new_bufp); if (!new_bufp) return (-1); np = (uint16 *)new_bufp->page; @@ -536,7 +536,7 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, } } if (last_bfp) - __free_ovflpage(hashp, last_bfp); + dbm_free_ovflpage(hashp, last_bfp); return (0); } @@ -548,7 +548,7 @@ ugly_split(HTAB *hashp, uint32 obucket, BUFHEAD *old_bufp, * 1 ==> failure */ extern int -__addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) +dbm_addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) { register uint16 *bp, *sop; int do_expand; @@ -562,7 +562,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) and we need to add another page */ break; else if (bp[2] < REAL_KEY && bp[bp[0]] != OVFLPAGE) { - bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!bufp) { #ifdef DEBUG assert(0); @@ -585,7 +585,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) return (0); } } else { - bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); + bufp = dbm_get_buf(hashp, bp[bp[0] - 1], bufp, 0); if (!bufp) { #ifdef DEBUG assert(0); @@ -599,7 +599,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) putpair(bufp->page, key, (DBT *)val); else { do_expand = 1; - bufp = __add_ovflpage(hashp, bufp); + bufp = dbm_add_ovflpage(hashp, bufp); if (!bufp) { #ifdef DEBUG assert(0); @@ -610,7 +610,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) if (PAIRFITS(sop, key, val)) putpair((char *)sop, key, (DBT *)val); - else if (__big_insert(hashp, bufp, key, val)) { + else if (dbm_big_insert(hashp, bufp, key, val)) { #ifdef DEBUG assert(0); #endif @@ -625,7 +625,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) hashp->NKEYS++; if (do_expand || (hashp->NKEYS / (hashp->MAX_BUCKET + 1) > hashp->FFACTOR)) - return (__expand_table(hashp)); + return (dbm_expand_table(hashp)); return (0); } @@ -636,7 +636,7 @@ __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) * NULL on error */ extern BUFHEAD * -__add_ovflpage(HTAB *hashp, BUFHEAD *bufp) +dbm_add_ovflpage(HTAB *hashp, BUFHEAD *bufp) { register uint16 *sp; uint16 ndx, ovfl_num; @@ -657,7 +657,7 @@ __add_ovflpage(HTAB *hashp, BUFHEAD *bufp) tmp1 = bufp->addr; tmp2 = bufp->ovfl ? bufp->ovfl->addr : 0; #endif - if (!ovfl_num || !(bufp->ovfl = __get_buf(hashp, ovfl_num, bufp, 1))) + if (!ovfl_num || !(bufp->ovfl = dbm_get_buf(hashp, ovfl_num, bufp, 1))) return (NULL); bufp->ovfl->flags |= BUF_MOD; #ifdef DEBUG1 @@ -687,12 +687,12 @@ __add_ovflpage(HTAB *hashp, BUFHEAD *bufp) * -1 indicates FAILURE */ extern int -__get_page(HTAB *hashp, - char *p, - uint32 bucket, - int is_bucket, - int is_disk, - int is_bitmap) +dbm_get_page(HTAB *hashp, + char *p, + uint32 bucket, + int is_bucket, + int is_disk, + int is_bitmap) { register int fd, page; size_t size; @@ -805,7 +805,7 @@ __get_page(HTAB *hashp, * -1 ==>failure */ extern int -__put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap) +dbm_put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap) { register int fd, page; size_t size; @@ -895,7 +895,7 @@ __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap) * once they are read in. */ extern int -__ibitmap(HTAB *hashp, int pnum, int nbits, int ndx) +dbm_ibitmap(HTAB *hashp, int pnum, int nbits, int ndx) { uint32 *ip; size_t clearbytes, clearints; @@ -1011,8 +1011,8 @@ overflow_page(HTAB *hashp) * don't have to if we tell init_bitmap not to leave it clear * in the first place. */ - if (__ibitmap(hashp, - (int)OADDR_OF(splitnum, offset), 1, free_page)) + if (dbm_ibitmap(hashp, + (int)OADDR_OF(splitnum, offset), 1, free_page)) return (0); hashp->SPARES[splitnum]++; #ifdef DEBUG2 @@ -1084,7 +1084,7 @@ found: * Mark this overflow page as free. */ extern void -__free_ovflpage(HTAB *hashp, BUFHEAD *obufp) +dbm_free_ovflpage(HTAB *hashp, BUFHEAD *obufp) { uint16 addr; uint32 *freep; @@ -1125,7 +1125,7 @@ __free_ovflpage(HTAB *hashp, BUFHEAD *obufp) (void)fprintf(stderr, "FREE_OVFLPAGE: ADDR: %d BIT: %d PAGE %d\n", obufp->addr, free_bit, free_page); #endif - __reclaim_buf(hashp, obufp); + dbm_reclaim_buf(hashp, obufp); } /* @@ -1236,8 +1236,8 @@ fetch_bitmap(HTAB *hashp, uint32 ndx) return (NULL); if ((hashp->mapp[ndx] = (uint32 *)malloc((size_t)hashp->BSIZE)) == NULL) return (NULL); - if (__get_page(hashp, - (char *)hashp->mapp[ndx], hashp->BITMAPS[ndx], 0, 1, 1)) { + if (dbm_get_page(hashp, + (char *)hashp->mapp[ndx], hashp->BITMAPS[ndx], 0, 1, 1)) { free(hashp->mapp[ndx]); hashp->mapp[ndx] = NULL; /* NEW: 9-11-95 */ return (NULL); @@ -1253,15 +1253,16 @@ print_chain(int addr) short *bp, oaddr; (void)fprintf(stderr, "%d ", addr); - bufp = __get_buf(hashp, addr, NULL, 0); + bufp = dbm_get_buf(hashp, addr, NULL, 0); bp = (short *)bufp->page; while (bp[0] && ((bp[bp[0]] == OVFLPAGE) || ((bp[0] > 2) && bp[2] < REAL_KEY))) { oaddr = bp[bp[0] - 1]; (void)fprintf(stderr, "%d ", (int)oaddr); - bufp = __get_buf(hashp, (int)oaddr, bufp, 0); + bufp = dbm_get_buf(hashp, (int)oaddr, bufp, 0); bp = (short *)bufp->page; } (void)fprintf(stderr, "\n"); } + #endif diff --git a/security/nss/lib/dbm/src/hash.c b/security/nss/lib/dbm/src/hash.c index 98b1c07c7..100bbad27 100644 --- a/security/nss/lib/dbm/src/hash.c +++ b/security/nss/lib/dbm/src/hash.c @@ -118,7 +118,7 @@ int hash_accesses, hash_collisions, hash_expansions, hash_overflows; * This closes the file, flushing buffers as appropriate. */ static void -__remove_database(DB *dbp) +dbm_remove_database(DB *dbp) { HTAB *hashp = (HTAB *)dbp->internal; @@ -134,7 +134,7 @@ __remove_database(DB *dbp) /* OPEN/CLOSE */ extern DB * -__hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dflags) +dbm_hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dflags) { HTAB *hashp = NULL; struct stat statbuf; @@ -199,7 +199,7 @@ __hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dfl if (info && info->hash) hashp->hash = info->hash; else - hashp->hash = __default_hash; + hashp->hash = dbm_default_hash; hdrsize = read(hashp->fp, (char *)&hashp->hdr, sizeof(HASHHDR)); if (hdrsize == -1) @@ -243,9 +243,9 @@ __hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dfl /* Initialize Buffer Manager */ if (info && info->cachesize) - __buf_init(hashp, (int32)info->cachesize); + dbm_buf_init(hashp, (int32)info->cachesize); else - __buf_init(hashp, DEF_BUFSIZE); + dbm_buf_init(hashp, DEF_BUFSIZE); hashp->new_file = new_table; #ifdef macintosh @@ -331,7 +331,7 @@ init_hash(HTAB *hashp, const char *file, HASHINFO *info) hashp->SSHIFT = DEF_SEGSIZE_SHIFT; hashp->DSIZE = DEF_DIRSIZE; hashp->FFACTOR = DEF_FFACTOR; - hashp->hash = __default_hash; + hashp->hash = dbm_default_hash; memset(hashp->SPARES, 0, sizeof(hashp->SPARES)); memset(hashp->BITMAPS, 0, sizeof(hashp->BITMAPS)); @@ -353,13 +353,13 @@ init_hash(HTAB *hashp, const char *file, HASHINFO *info) if (hashp->BSIZE > MAX_BSIZE) hashp->BSIZE = MAX_BSIZE; #endif - hashp->BSHIFT = __log2((uint32)hashp->BSIZE); + hashp->BSHIFT = dbm_log2((uint32)hashp->BSIZE); } if (info) { if (info->bsize) { /* Round pagesize up to power of 2 */ - hashp->BSHIFT = __log2(info->bsize); + hashp->BSHIFT = dbm_log2(info->bsize); hashp->BSIZE = 1 << hashp->BSHIFT; if (hashp->BSIZE > MAX_BSIZE) { errno = EINVAL; @@ -406,7 +406,7 @@ init_htab(HTAB *hashp, int nelem) */ nelem = (nelem - 1) / hashp->FFACTOR + 1; - l2 = __log2((uint32)PR_MAX(nelem, 2)); + l2 = dbm_log2((uint32)PR_MAX(nelem, 2)); nbuckets = 1 << l2; hashp->SPARES[l2] = l2 + 1; @@ -415,7 +415,7 @@ init_htab(HTAB *hashp, int nelem) hashp->LAST_FREED = 2; /* First bitmap page is at: splitpoint l2 page offset 1 */ - if (__ibitmap(hashp, (int)OADDR_OF(l2, 1), l2 + 1, 0)) + if (dbm_ibitmap(hashp, (int)OADDR_OF(l2, 1), l2 + 1, 0)) return (-1); hashp->MAX_BUCKET = hashp->LOW_MASK = nbuckets - 1; @@ -425,7 +425,7 @@ init_htab(HTAB *hashp, int nelem) 1; nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; - nsegs = 1 << __log2((uint32)nsegs); + nsegs = 1 << dbm_log2((uint32)nsegs); if (nsegs > hashp->DSIZE) hashp->DSIZE = nsegs; @@ -463,7 +463,7 @@ hdestroy(HTAB *hashp) * Call on buffer manager to free buffers, and if required, * write them to disk. */ - if (__buf_free(hashp, 1, hashp->save_file)) + if (dbm_buf_free(hashp, 1, hashp->save_file)) save_errno = errno; if (hashp->dir) { free(*hashp->dir); /* Free initial segments */ @@ -585,7 +585,7 @@ hash_sync(const DB *dbp, uint flags) if (!hashp->save_file) return (0); - if (__buf_free(hashp, 0, 1) || flush_meta(hashp)) + if (dbm_buf_free(hashp, 0, 1) || flush_meta(hashp)) return (DBM_ERROR); #if defined(_WIN32) || defined(_WINDOWS) if (hashp->updateEOF && hashp->filename && !hashp->is_temp) { @@ -635,8 +635,8 @@ flush_meta(HTAB *hashp) } for (i = 0; i < NCACHED; i++) if (hashp->mapp[i]) - if (__put_page(hashp, (char *)hashp->mapp[i], - hashp->BITMAPS[i], 0, 1)) + if (dbm_put_page(hashp, (char *)hashp->mapp[i], + hashp->BITMAPS[i], 0, 1)) return (-1); return (0); } @@ -675,7 +675,7 @@ hash_get( #if defined(unix) && defined(DEBUG) printf("\n\nDBM Database has been corrupted, tell Lou...\n\n"); #endif - __remove_database((DB *)dbp); + dbm_remove_database((DB *)dbp); } return (rv); @@ -711,7 +711,7 @@ hash_put( #if defined(unix) && defined(DEBUG) printf("\n\nDBM Database has been corrupted, tell Lou...\n\n"); #endif - __remove_database((DB *)dbp); + dbm_remove_database((DB *)dbp); } return (rv); @@ -744,7 +744,7 @@ hash_delete( #if defined(unix) && defined(DEBUG) printf("\n\nDBM Database has been corrupted, tell Lou...\n\n"); #endif - __remove_database((DB *)dbp); + dbm_remove_database((DB *)dbp); } return (rv); @@ -777,7 +777,7 @@ hash_access( off = hashp->BSIZE; size = key->size; kp = (char *)key->data; - rbufp = __get_buf(hashp, __call_hash(hashp, kp, size), NULL, 0); + rbufp = dbm_get_buf(hashp, dbm_call_hash(hashp, kp, size), NULL, 0); if (!rbufp) return (DATABASE_CORRUPTED_ERROR); save_bufp = rbufp; @@ -805,7 +805,7 @@ hash_access( last_overflow_page_no = *bp; - rbufp = __get_buf(hashp, *bp, rbufp, 0); + rbufp = dbm_get_buf(hashp, *bp, rbufp, 0); if (!rbufp) { save_bufp->flags &= ~BUF_PIN; return (DBM_ERROR); @@ -822,17 +822,17 @@ hash_access( off = hashp->BSIZE; } else if (bp[1] < REAL_KEY) { if ((ndx = - __find_bigpair(hashp, rbufp, ndx, kp, (int)size)) > 0) + dbm_find_bigpair(hashp, rbufp, ndx, kp, (int)size)) > 0) goto found; if (ndx == -2) { bufp = rbufp; if (!(pageno = - __find_last_page(hashp, &bufp))) { + dbm_find_last_page(hashp, &bufp))) { ndx = 0; rbufp = bufp; break; /* FOR */ } - rbufp = __get_buf(hashp, pageno, bufp, 0); + rbufp = dbm_get_buf(hashp, pageno, bufp, 0); if (!rbufp) { save_bufp->flags &= ~BUF_PIN; return (DBM_ERROR); @@ -853,7 +853,7 @@ hash_access( switch (action) { case HASH_PUT: case HASH_PUTNEW: - if (__addel(hashp, rbufp, key, val)) { + if (dbm_addel(hashp, rbufp, key, val)) { save_bufp->flags &= ~BUF_PIN; return (DBM_ERROR); } else { @@ -875,7 +875,7 @@ found: case HASH_GET: bp = (uint16 *)rbufp->page; if (bp[ndx + 1] < REAL_KEY) { - if (__big_return(hashp, rbufp, ndx, val, 0)) + if (dbm_big_return(hashp, rbufp, ndx, val, 0)) return (DBM_ERROR); } else { val->data = (uint8 *)rbufp->page + (int)bp[ndx + 1]; @@ -883,14 +883,14 @@ found: } break; case HASH_PUT: - if ((__delpair(hashp, rbufp, ndx)) || - (__addel(hashp, rbufp, key, val))) { + if ((dbm_delpair(hashp, rbufp, ndx)) || + (dbm_addel(hashp, rbufp, key, val))) { save_bufp->flags &= ~BUF_PIN; return (DBM_ERROR); } break; case HASH_DELETE: - if (__delpair(hashp, rbufp, ndx)) + if (dbm_delpair(hashp, rbufp, ndx)) return (DBM_ERROR); break; default: @@ -933,7 +933,7 @@ hash_seq( for (bucket = hashp->cbucket; bucket <= (uint32)hashp->MAX_BUCKET; bucket++, hashp->cndx = 1) { - bufp = __get_buf(hashp, bucket, NULL, 0); + bufp = dbm_get_buf(hashp, bucket, NULL, 0); if (!bufp) return (DBM_ERROR); hashp->cpage = bufp; @@ -955,7 +955,7 @@ hash_seq( #endif while (bp[hashp->cndx + 1] == OVFLPAGE) { bufp = hashp->cpage = - __get_buf(hashp, bp[hashp->cndx], bufp, 0); + dbm_get_buf(hashp, bp[hashp->cndx], bufp, 0); if (!bufp) return (DBM_ERROR); bp = (uint16 *)(bufp->page); @@ -968,7 +968,7 @@ hash_seq( } ndx = hashp->cndx; if (bp[ndx + 1] < REAL_KEY) { - if (__big_keydata(hashp, bufp, key, data, 1)) + if (dbm_big_keydata(hashp, bufp, key, data, 1)) return (DBM_ERROR); } else { key->data = (uint8 *)hashp->cpage->page + bp[ndx]; @@ -994,7 +994,7 @@ hash_seq( * -1 ==> Error */ extern int -__expand_table(HTAB *hashp) +dbm_expand_table(HTAB *hashp) { uint32 old_bucket, new_bucket; int new_segnum, spare_ndx; @@ -1029,7 +1029,7 @@ __expand_table(HTAB *hashp) * * increases), we need to copy the current contents of the spare * split bucket to the next bucket. */ - spare_ndx = __log2((uint32)(hashp->MAX_BUCKET + 1)); + spare_ndx = dbm_log2((uint32)(hashp->MAX_BUCKET + 1)); if (spare_ndx > hashp->OVFL_POINT) { hashp->SPARES[spare_ndx] = hashp->SPARES[hashp->OVFL_POINT]; hashp->OVFL_POINT = spare_ndx; @@ -1041,7 +1041,7 @@ __expand_table(HTAB *hashp) hashp->HIGH_MASK = new_bucket | hashp->LOW_MASK; } /* Relocate records to the new bucket */ - return (__split_page(hashp, old_bucket, new_bucket)); + return (dbm_split_page(hashp, old_bucket, new_bucket)); } /* @@ -1065,7 +1065,7 @@ hash_realloc( } extern uint32 -__call_hash(HTAB *hashp, char *k, size_t len) +dbm_call_hash(HTAB *hashp, char *k, size_t len) { uint32 n, bucket; @@ -1168,4 +1168,5 @@ swap_header(HTAB *hashp) M_16_SWAP(hdrp->bitmaps[i]); } } + #endif diff --git a/security/nss/lib/dbm/src/hash_buf.c b/security/nss/lib/dbm/src/hash_buf.c index a7cd2d076..02deb81c5 100644 --- a/security/nss/lib/dbm/src/hash_buf.c +++ b/security/nss/lib/dbm/src/hash_buf.c @@ -104,7 +104,7 @@ static BUFHEAD *newbuf(HTAB *, uint32, BUFHEAD *); * address you are seeking. */ extern BUFHEAD * -__get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage) +dbm_get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage) /* If prev_bp set, indicates a new overflow page. */ { register BUFHEAD *bp; @@ -124,7 +124,7 @@ __get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage) /* Grab buffer out of directory */ segment_ndx = addr & (hashp->SGSIZE - 1); - /* valid segment ensured by __call_hash() */ + /* valid segment ensured by dbm_call_hash() */ segp = hashp->dir[addr >> hashp->SSHIFT]; #ifdef DEBUG assert(segp != NULL); @@ -140,7 +140,7 @@ __get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage) bp = newbuf(hashp, addr, prev_bp); if (!bp) return (NULL); - if (__get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0)) { + if (dbm_get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0)) { /* free bp and its page */ if (prev_bp) { /* if prev_bp is set then the new page that @@ -242,8 +242,8 @@ newbuf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp) } oaddr = shortp[shortp[0] - 1]; } - if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page, - bp->addr, (int)IS_BUCKET(bp->flags), 0)) + if ((bp->flags & BUF_MOD) && dbm_put_page(hashp, bp->page, + bp->addr, (int)IS_BUCKET(bp->flags), 0)) return (NULL); /* * Update the pointer to this page (i.e. invalidate it). @@ -298,8 +298,8 @@ newbuf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp) /* set before __put_page */ oaddr = shortp[shortp[0] - 1]; } - if ((xbp->flags & BUF_MOD) && __put_page(hashp, - xbp->page, xbp->addr, 0, 0)) + if ((xbp->flags & BUF_MOD) && dbm_put_page(hashp, + xbp->page, xbp->addr, 0, 0)) return (NULL); xbp->addr = 0; xbp->flags = 0; @@ -335,7 +335,7 @@ newbuf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp) } extern void -__buf_init(HTAB *hashp, int32 nbytes) +dbm_buf_init(HTAB *hashp, int32 nbytes) { BUFHEAD *bfp; int npages; @@ -358,7 +358,7 @@ __buf_init(HTAB *hashp, int32 nbytes) } extern int -__buf_free(HTAB *hashp, int do_free, int to_disk) +dbm_buf_free(HTAB *hashp, int do_free, int to_disk) { BUFHEAD *bp; int status = -1; @@ -370,8 +370,8 @@ __buf_free(HTAB *hashp, int do_free, int to_disk) /* Check that the buffer is valid */ if (bp->addr || IS_BUCKET(bp->flags)) { if (to_disk && (bp->flags & BUF_MOD) && - (status = __put_page(hashp, bp->page, - bp->addr, IS_BUCKET(bp->flags), 0))) { + (status = dbm_put_page(hashp, bp->page, + bp->addr, IS_BUCKET(bp->flags), 0))) { if (do_free) { if (bp->page) @@ -397,11 +397,12 @@ __buf_free(HTAB *hashp, int do_free, int to_disk) } extern void -__reclaim_buf(HTAB *hashp, BUFHEAD *bp) +dbm_reclaim_buf(HTAB *hashp, BUFHEAD *bp) { bp->ovfl = 0; bp->addr = 0; bp->flags = 0; BUF_REMOVE(bp); LRU_INSERT(bp); + } diff --git a/security/nss/lib/freebl/chacha20poly1305.c b/security/nss/lib/freebl/chacha20poly1305.c index 302f0db9e..8fdaf3fec 100644 --- a/security/nss/lib/freebl/chacha20poly1305.c +++ b/security/nss/lib/freebl/chacha20poly1305.c @@ -234,6 +234,11 @@ ChaCha20Poly1305_Open(const ChaCha20Poly1305Context *ctx, unsigned char *output, PORT_SetError(SEC_ERROR_OUTPUT_LEN); return SECFailure; } + // ChaCha has a 64 octet block, with a 32-bit block counter. + if (inputLen >= (1ULL << (6 + 32)) + ctx->tagLen) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } PORT_Memset(block, 0, sizeof(block)); // Generate a block of keystream. The first 32 bytes will be the poly1305 diff --git a/security/nss/lib/freebl/ctr.c b/security/nss/lib/freebl/ctr.c index d7652c060..4d26a5b06 100644 --- a/security/nss/lib/freebl/ctr.c +++ b/security/nss/lib/freebl/ctr.c @@ -128,6 +128,12 @@ CTR_Update(CTRContext *ctr, unsigned char *outbuf, unsigned int tmp; SECStatus rv; + // Limit block count to 2^counterBits - 2 + if (ctr->counterBits < (sizeof(unsigned int) * 8) && + inlen > ((1 << ctr->counterBits) - 2) * AES_BLOCK_SIZE) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } if (maxout < inlen) { *outlen = inlen; PORT_SetError(SEC_ERROR_OUTPUT_LEN); @@ -199,6 +205,12 @@ CTR_Update_HW_AES(CTRContext *ctr, unsigned char *outbuf, unsigned int tmp; SECStatus rv; + // Limit block count to 2^counterBits - 2 + if (ctr->counterBits < (sizeof(unsigned int) * 8) && + inlen > ((1 << ctr->counterBits) - 2) * AES_BLOCK_SIZE) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } if (maxout < inlen) { *outlen = inlen; PORT_SetError(SEC_ERROR_OUTPUT_LEN); diff --git a/security/nss/lib/freebl/gcm.c b/security/nss/lib/freebl/gcm.c index f1e16da78..e93970b88 100644 --- a/security/nss/lib/freebl/gcm.c +++ b/security/nss/lib/freebl/gcm.c @@ -469,6 +469,12 @@ gcmHash_Reset(gcmHashContext *ghash, const unsigned char *AAD, { SECStatus rv; + // Limit AADLen in accordance with SP800-38D + if (sizeof(AADLen) >= 8 && AADLen > (1ULL << 61) - 1) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } + ghash->cLen = 0; PORT_Memset(ghash->counterBuf, 0, GCM_HASH_LEN_LEN * 2); ghash->bufLen = 0; diff --git a/security/nss/lib/freebl/intel-gcm-wrap.c b/security/nss/lib/freebl/intel-gcm-wrap.c index 37a1af765..f69bc7c7a 100644 --- a/security/nss/lib/freebl/intel-gcm-wrap.c +++ b/security/nss/lib/freebl/intel-gcm-wrap.c @@ -62,6 +62,12 @@ intel_AES_GCM_CreateContext(void *context, PORT_SetError(SEC_ERROR_INVALID_ARGS); return NULL; } + // Limit AADLen in accordance with SP800-38D + if (sizeof(AAD_whole_len) >= 8 && AAD_whole_len > (1ULL << 61) - 1) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return NULL; + } + gcm = PORT_ZNew(intel_AES_GCMContext); if (gcm == NULL) { return NULL; @@ -159,6 +165,14 @@ intel_AES_GCM_EncryptUpdate(intel_AES_GCMContext *gcm, unsigned char T[AES_BLOCK_SIZE]; unsigned int j; + // GCM has a 16 octet block, with a 32-bit block counter + // Limit in accordance with SP800-38D + if (sizeof(inlen) > 4 && + inlen >= ((1ULL << 32) - 2) * AES_BLOCK_SIZE) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } + tagBytes = (gcm->tagBits + (PR_BITS_PER_BYTE - 1)) / PR_BITS_PER_BYTE; if (UINT_MAX - inlen < tagBytes) { PORT_SetError(SEC_ERROR_INPUT_LEN); @@ -216,6 +230,14 @@ intel_AES_GCM_DecryptUpdate(intel_AES_GCMContext *gcm, inlen -= tagBytes; intag = inbuf + inlen; + // GCM has a 16 octet block, with a 32-bit block counter + // Limit in accordance with SP800-38D + if (sizeof(inlen) > 4 && + inlen >= ((1ULL << 32) - 2) * AES_BLOCK_SIZE) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } + if (maxout < inlen) { *outlen = inlen; PORT_SetError(SEC_ERROR_OUTPUT_LEN); diff --git a/security/nss/lib/freebl/rsapkcs.c b/security/nss/lib/freebl/rsapkcs.c index 875e4e28d..6f94770ad 100644 --- a/security/nss/lib/freebl/rsapkcs.c +++ b/security/nss/lib/freebl/rsapkcs.c @@ -115,7 +115,7 @@ rsa_FormatOneBlock(unsigned modulusLen, { unsigned char *block; unsigned char *bp; - int padLen; + unsigned int padLen; int i, j; SECStatus rv; @@ -135,14 +135,14 @@ rsa_FormatOneBlock(unsigned modulusLen, switch (blockType) { /* - * Blocks intended for private-key operation. - */ + * Blocks intended for private-key operation. + */ case RSA_BlockPrivate: /* preferred method */ /* - * 0x00 || BT || Pad || 0x00 || ActualData - * 1 1 padLen 1 data->len - * Pad is either all 0x00 or all 0xff bytes, depending on blockType. - */ + * 0x00 || BT || Pad || 0x00 || ActualData + * 1 1 padLen 1 data->len + * Pad is either all 0x00 or all 0xff bytes, depending on blockType. + */ padLen = modulusLen - data->len - 3; PORT_Assert(padLen >= RSA_BLOCK_MIN_PAD_LEN); if (padLen < RSA_BLOCK_MIN_PAD_LEN) { @@ -162,7 +162,7 @@ rsa_FormatOneBlock(unsigned modulusLen, /* * 0x00 || BT || Pad || 0x00 || ActualData * 1 1 padLen 1 data->len - * Pad is all non-zero random bytes. + * Pad is 8 or more non-zero random bytes. * * Build the block left to right. * Fill the entire block from Pad to the end with random bytes. @@ -236,7 +236,9 @@ rsa_FormatBlock(SECItem *result, * The "3" below is the first octet + the second octet + the 0x00 * octet that always comes just before the ActualData. */ - PORT_Assert(data->len <= (modulusLen - (3 + RSA_BLOCK_MIN_PAD_LEN))); + if (data->len > (modulusLen - (3 + RSA_BLOCK_MIN_PAD_LEN))) { + return SECFailure; + } result->data = rsa_FormatOneBlock(modulusLen, blockType, data); if (result->data == NULL) { diff --git a/security/nss/lib/nss/nss.h b/security/nss/lib/nss/nss.h index ea54ce0cd..f6b83a01c 100644 --- a/security/nss/lib/nss/nss.h +++ b/security/nss/lib/nss/nss.h @@ -22,10 +22,10 @@ * The format of the version string should be * "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]" */ -#define NSS_VERSION "3.41.2" _NSS_CUSTOMIZED +#define NSS_VERSION "3.41.3" _NSS_CUSTOMIZED #define NSS_VMAJOR 3 #define NSS_VMINOR 41 -#define NSS_VPATCH 2 +#define NSS_VPATCH 3 #define NSS_VBUILD 0 #define NSS_BETA PR_FALSE diff --git a/security/nss/lib/softoken/pkcs11c.c b/security/nss/lib/softoken/pkcs11c.c index 884702cc1..327a67d5c 100644 --- a/security/nss/lib/softoken/pkcs11c.c +++ b/security/nss/lib/softoken/pkcs11c.c @@ -7668,9 +7668,11 @@ NSC_DeriveKey(CK_SESSION_HANDLE hSession, const SECHashObject *rawHash; unsigned hashLen; CK_BYTE hashbuf[HASH_LENGTH_MAX]; - CK_BYTE *prk; /* psuedo-random key */ + CK_BYTE *prk; /* psuedo-random key */ CK_ULONG prkLen; - CK_BYTE *okm; /* output keying material */ + CK_BYTE *okm; /* output keying material */ + unsigned allocated_space = 0; /* If we need more work space, track it */ + unsigned char *key_buf = &key_block[0]; rawHash = HASH_GetRawHashObject(hashType); if (rawHash == NULL || rawHash->length > sizeof(hashbuf)) { @@ -7686,7 +7688,7 @@ NSC_DeriveKey(CK_SESSION_HANDLE hSession, crv = CKR_MECHANISM_PARAM_INVALID; break; } - if (keySize == 0 || keySize > sizeof key_block || + if (keySize == 0 || (!params->bExpand && keySize > hashLen) || (params->bExpand && keySize > 255 * hashLen)) { crv = CKR_TEMPLATE_INCONSISTENT; @@ -7736,34 +7738,49 @@ NSC_DeriveKey(CK_SESSION_HANDLE hSession, /* T(1) = HMAC-Hash(prk, "" | info | 0x01) * T(n) = HMAC-Hash(prk, T(n-1) | info | n * key material = T(1) | ... | T(n) + * + * If the requested output length does not fit + * within |key_block|, allocate space for expansion. */ HMACContext *hmac; CK_BYTE bi; - unsigned iterations = PR_ROUNDUP(keySize, hashLen) / hashLen; + unsigned n_bytes = PR_ROUNDUP(keySize, hashLen); + unsigned iterations = n_bytes / hashLen; hmac = HMAC_Create(rawHash, prk, prkLen, isFIPS); if (hmac == NULL) { crv = CKR_HOST_MEMORY; break; } - for (bi = 1; bi <= iterations; ++bi) { + if (n_bytes > sizeof(key_block)) { + key_buf = PORT_Alloc(n_bytes); + if (key_buf == NULL) { + crv = CKR_HOST_MEMORY; + break; + } + allocated_space = n_bytes; + } + for (bi = 1; bi <= iterations && bi > 0; ++bi) { unsigned len; HMAC_Begin(hmac); if (bi > 1) { - HMAC_Update(hmac, key_block + ((bi - 2) * hashLen), hashLen); + HMAC_Update(hmac, key_buf + ((bi - 2) * hashLen), hashLen); } if (params->ulInfoLen != 0) { HMAC_Update(hmac, params->pInfo, params->ulInfoLen); } HMAC_Update(hmac, &bi, 1); - HMAC_Finish(hmac, key_block + ((bi - 1) * hashLen), &len, + HMAC_Finish(hmac, key_buf + ((bi - 1) * hashLen), &len, hashLen); PORT_Assert(len == hashLen); } HMAC_Destroy(hmac, PR_TRUE); - okm = key_block; + okm = key_buf; } /* key material = prk */ crv = sftk_forceAttribute(key, CKA_VALUE, okm, keySize); + if (allocated_space) { + PORT_ZFree(key_buf, allocated_space); + } break; } /* end of CKM_NSS_HKDF_* */ diff --git a/security/nss/lib/softoken/softkver.h b/security/nss/lib/softoken/softkver.h index 73a38b010..ab2e91018 100644 --- a/security/nss/lib/softoken/softkver.h +++ b/security/nss/lib/softoken/softkver.h @@ -17,10 +17,10 @@ * The format of the version string should be * "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]" */ -#define SOFTOKEN_VERSION "3.41.2" SOFTOKEN_ECC_STRING +#define SOFTOKEN_VERSION "3.41.3" SOFTOKEN_ECC_STRING #define SOFTOKEN_VMAJOR 3 #define SOFTOKEN_VMINOR 41 -#define SOFTOKEN_VPATCH 2 +#define SOFTOKEN_VPATCH 3 #define SOFTOKEN_VBUILD 0 #define SOFTOKEN_BETA PR_FALSE diff --git a/security/nss/lib/util/nssutil.h b/security/nss/lib/util/nssutil.h index a2be260b0..f880fb55e 100644 --- a/security/nss/lib/util/nssutil.h +++ b/security/nss/lib/util/nssutil.h @@ -19,10 +19,10 @@ * The format of the version string should be * "<major version>.<minor version>[.<patch level>[.<build number>]][ <Beta>]" */ -#define NSSUTIL_VERSION "3.41.2" +#define NSSUTIL_VERSION "3.41.3" #define NSSUTIL_VMAJOR 3 #define NSSUTIL_VMINOR 41 -#define NSSUTIL_VPATCH 2 +#define NSSUTIL_VPATCH 3 #define NSSUTIL_VBUILD 0 #define NSSUTIL_BETA PR_FALSE diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm index bf5c66b8d..7c2c6f28d 100644 --- a/toolkit/components/osfile/modules/osfile_unix_back.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm @@ -585,10 +585,18 @@ } else if (Const._STAT_VER != undefined) { const ver = Const._STAT_VER; let xstat_name, lxstat_name, fxstat_name; - // Linux, all widths - xstat_name = "__xstat"; - lxstat_name = "__lxstat"; - fxstat_name = "__fxstat"; + if (OS.Constants.Sys.Name == "SunOS") { + // Solaris + xstat_name = "_xstat"; + lxstat_name = "_lxstat"; + fxstat_name = "_fxstat"; + } else { + + // Linux, all widths + xstat_name = "__xstat"; + lxstat_name = "__lxstat"; + fxstat_name = "__fxstat"; + } let Stat = {}; libc.declareLazyFFI(Stat, "xstat", diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp index 91e872821..9f6a90b57 100644 --- a/toolkit/components/terminator/nsTerminator.cpp +++ b/toolkit/components/terminator/nsTerminator.cpp @@ -30,7 +30,7 @@ #include "nsIObserverService.h" #include "nsIPrefService.h" -#if defined(XP_WIN) +#ifdef XP_WIN #include <windows.h> #else #include <unistd.h> @@ -385,7 +385,11 @@ nsTerminator::StartWatchdog() } UniquePtr<Options> options(new Options()); +#ifdef XP_SOLARIS const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000); +#else + const PRIntervalTime ticksDuration = 1000; +#endif options->crashAfterTicks = crashAfterMS / ticksDuration; DebugOnly<PRThread*> watchdogThread = CreateSystemThread(RunWatchdog, diff --git a/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp b/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp index 28fd9d484..8b5b1f4cb 100644 --- a/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp +++ b/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp @@ -10,4 +10,7 @@ # undef NSMODULE_SECTION # define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$Z"), dllexport) #endif -NSMODULE_DEFN(end_kPStaticModules) = nullptr; +/* This could be null, but this needs a dummy value to ensure it actually ends + * up in the same section as other NSMODULE_DEFNs, instead of being moved to a + * separate readonly section. */ +NSMODULE_DEFN(end_kPStaticModules) = (mozilla::Module*)&NSMODULE_NAME(end_kPStaticModules); diff --git a/toolkit/library/StaticXULComponentsStart.cpp b/toolkit/library/StaticXULComponentsStart.cpp index 1738aa810..d2e9a8828 100644 --- a/toolkit/library/StaticXULComponentsStart.cpp +++ b/toolkit/library/StaticXULComponentsStart.cpp @@ -1,3 +1,6 @@ #include "mozilla/Module.h" -NSMODULE_DEFN(start_kPStaticModules) = nullptr; +/* This could be null, but this needs a dummy value to ensure it actually ends + * up in the same section as other NSMODULE_DEFNs, instead of being moved to a + * separate readonly section. */ +NSMODULE_DEFN(start_kPStaticModules) = (mozilla::Module*)&NSMODULE_NAME(start_kPStaticModules); diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk index 9e7e8beee..80f934e60 100644 --- a/toolkit/library/libxul.mk +++ b/toolkit/library/libxul.mk @@ -16,10 +16,10 @@ EXTRA_DEPS += symverscript endif endif -# Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is +# Generate GDB pretty printer-autoload files on Linux and Solaris. OSX's GDB is # too old to support Python pretty-printers; if this changes, we could make # this 'ifdef GNU_CC'. -ifeq (Linux,$(OS_ARCH)) +ifeq (,$(filter-out SunOS Linux,$(OS_ARCH))) # Create a GDB Python auto-load file alongside the libxul shared library in # the build directory. PP_TARGETS += LIBXUL_AUTOLOAD @@ -27,6 +27,10 @@ LIBXUL_AUTOLOAD = $(topsrcdir)/toolkit/library/libxul.so-gdb.py.in LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir)) endif +ifeq ($(OS_ARCH),SunOS) +OS_LDFLAGS += -Wl,-z,defs +endif + # BFD ld doesn't create multiple PT_LOADs as usual when an unknown section # exists. Using an implicit linker script to make it fold that section in # .data.rel.ro makes it create multiple PT_LOADs. That implicit linker @@ -50,6 +54,6 @@ endif LOCAL_CHECKS = test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo "NSModules are not ordered appropriately" && exit 1 || exit 0 -ifeq (Linux,$(OS_ARCH)) +ifeq (,$(filter-out SunOS Linux,$(OS_ARCH))) LOCAL_CHECKS += ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0 endif diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index ba7fb5032..4d870c73c 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -241,7 +241,7 @@ OS_LIBS += CONFIG['ICONV_LIBS'] if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'): OS_LIBS += CONFIG['TK_LIBS'] -if CONFIG['OS_ARCH'] == 'OpenBSD': +if CONFIG['MOZ_SNDIO']: OS_LIBS += [ 'sndio', ] @@ -270,6 +270,13 @@ if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']: if CONFIG['MOZ_ENABLE_LIBPROXY']: OS_LIBS += CONFIG['MOZ_LIBPROXY_LIBS'] +if CONFIG['OS_ARCH'] == 'SunOS': + OS_LIBS += [ + 'elf', + 'demangle', + 'sendfile', + ] + if CONFIG['OS_ARCH'] == 'FreeBSD': OS_LIBS += [ 'util', diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index 36e228797..57a25df9d 100755 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -5577,21 +5577,6 @@ StrCpy $INSTDIR "$R9" !endif - ; If the user doesn't have write access to the installation directory set - ; the installation directory to a subdirectory of the All Users application - ; directory and if the user can't write to that location set the installation - ; directory to a subdirectory of the users local application directory - ; (e.g. non-roaming). - ${CanWriteToInstallDir} $R9 - StrCmp "$R9" "false" +1 finish_check_install_dir - - SetShellVarContext all ; Set SHCTX to All Users - StrCpy $INSTDIR "$APPDATA\${BrandFullName}\" - ${CanWriteToInstallDir} $R9 - StrCmp "$R9" "false" +2 +1 - StrCpy $INSTDIR "$LOCALAPPDATA\${BrandFullName}\" - - finish_check_install_dir: IfFileExists "$INSTDIR" +3 +1 Pop $R9 Return diff --git a/toolkit/mozapps/update/common/updatedefines.h b/toolkit/mozapps/update/common/updatedefines.h index 5790cf996..871755246 100644 --- a/toolkit/mozapps/update/common/updatedefines.h +++ b/toolkit/mozapps/update/common/updatedefines.h @@ -96,7 +96,11 @@ static inline int mywcsprintf(WCHAR* dest, size_t count, const WCHAR* fmt, ...) # include <sys/wait.h> # include <unistd.h> +#ifdef XP_SOLARIS +# include <sys/stat.h> +#else # include <fts.h> +#endif # include <dirent.h> #ifdef XP_MACOSX diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index 8025deaaf..f5f71935d 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -3648,6 +3648,88 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) return rv; } +#elif defined(XP_SOLARIS) +int add_dir_entries(const NS_tchar *dirpath, ActionList *list) +{ + int rv = OK; + NS_tchar foundpath[MAXPATHLEN]; + struct { + dirent dent_buffer; + char chars[MAXNAMLEN]; + } ent_buf; + struct dirent* ent; + mozilla::UniquePtr<NS_tchar[]> searchpath(get_full_path(dirpath)); + + DIR* dir = opendir(searchpath.get()); + if (!dir) { + LOG(("add_dir_entries error on opendir: " LOG_S ", err: %d", searchpath.get(), + errno)); + return UNEXPECTED_FILE_OPERATION_ERROR; + } + + while (readdir_r(dir, (dirent *)&ent_buf, &ent) == 0 && ent) { + if ((strcmp(ent->d_name, ".") == 0) || + (strcmp(ent->d_name, "..") == 0)) + continue; + + NS_tsnprintf(foundpath, sizeof(foundpath)/sizeof(foundpath[0]), + NS_T("%s%s"), searchpath.get(), ent->d_name); + struct stat64 st_buf; + int test = stat64(foundpath, &st_buf); + if (test) { + closedir(dir); + return UNEXPECTED_FILE_OPERATION_ERROR; + } + if (S_ISDIR(st_buf.st_mode)) { + NS_tsnprintf(foundpath, sizeof(foundpath)/sizeof(foundpath[0]), + NS_T("%s/"), foundpath); + // Recurse into the directory. + rv = add_dir_entries(foundpath, list); + if (rv) { + LOG(("add_dir_entries error: " LOG_S ", err: %d", foundpath, rv)); + closedir(dir); + return rv; + } + } else { + // Add the file to be removed to the ActionList. + NS_tchar *quotedpath = get_quoted_path(get_relative_path(foundpath)); + if (!quotedpath) { + closedir(dir); + return PARSE_ERROR; + } + + Action *action = new RemoveFile(); + rv = action->Parse(quotedpath); + if (rv) { + LOG(("add_dir_entries Parse error on recurse: " LOG_S ", err: %d", + quotedpath, rv)); + closedir(dir); + return rv; + } + + list->Append(action); + } + } + closedir(dir); + + // Add the directory to be removed to the ActionList. + NS_tchar *quotedpath = get_quoted_path(get_relative_path(dirpath)); + if (!quotedpath) + return PARSE_ERROR; + + Action *action = new RemoveDir(); + rv = action->Parse(quotedpath); + if (rv) { + LOG(("add_dir_entries Parse error on close: " LOG_S ", err: %d", + quotedpath, rv)); + } + else { + list->Append(action); + } + + return rv; +} + #else int add_dir_entries(const NS_tchar *dirpath, ActionList *list) diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp index 454882c1b..660af4522 100644 --- a/toolkit/xre/nsSigHandlers.cpp +++ b/toolkit/xre/nsSigHandlers.cpp @@ -32,6 +32,11 @@ #endif #endif +#ifdef XP_SOLARIS +#include <sys/resource.h> +#include <ucontext.h> +#endif + static const char* gProgname = "huh?"; // Note: some tests manipulate this value. @@ -193,6 +198,32 @@ static void fpehandler(int signum, siginfo_t *si, void *context) *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */ #endif #endif +#ifdef XP_SOLARIS + ucontext_t *uc = (ucontext_t *)context; + +#if defined(__i386) + uint32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0]; + *cw |= FPU_EXCEPTION_MASK; + + uint32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1]; + *sw &= ~FPU_STATUS_FLAGS; + + /* address of the instruction that caused the exception */ + uint32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3]; + uc->uc_mcontext.gregs[REG_PC] = *ip; +#endif +#if defined(__amd64__) + uint16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw; + *cw |= FPU_EXCEPTION_MASK; + + uint16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw; + *sw &= ~FPU_STATUS_FLAGS; + + uint32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr; + *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */ + *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */ +#endif +#endif } #endif @@ -255,6 +286,31 @@ void InstallSignalHandlers(const char *aProgname) } #endif +#ifdef XP_SOLARIS +#define NOFILES 512 + + // Boost Solaris file descriptors + { + struct rlimit rl; + + if (getrlimit(RLIMIT_NOFILE, &rl) == 0) + + if (rl.rlim_cur < NOFILES) { + rl.rlim_cur = NOFILES; + + if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { + perror("setrlimit(RLIMIT_NOFILE)"); + fprintf(stderr, "Cannot exceed hard limit for open files"); + } +#if defined(DEBUG) + if (getrlimit(RLIMIT_NOFILE, &rl) == 0) + printf("File descriptors set to %d\n", rl.rlim_cur); +#endif //DEBUG + } + } +#endif //XP_SOLARIS + + #if defined(MOZ_WIDGET_GTK) && (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6)) const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK"); if (assertString && diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index aac856d6e..be11fb158 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -75,21 +75,26 @@ GetUpdateLog() #endif static nsresult -GetCurrentWorkingDir(char *buf, size_t size) +GetCurrentWorkingDir(nsACString& aOutPath) { // Cannot use NS_GetSpecialDirectory because XPCOM is not yet initialized. - // This code is duplicated from xpcom/io/SpecialSystemDirectory.cpp: - + + // Just in case junk has been passed in. + aOutPath.Truncate(); + #if defined(XP_WIN) wchar_t wpath[MAX_PATH]; - if (!_wgetcwd(wpath, size)) + if (!_wgetcwd(wpath, ArrayLength(wpath))) return NS_ERROR_FAILURE; - NS_ConvertUTF16toUTF8 path(wpath); - strncpy(buf, path.get(), size); + CopyUTF16toUTF8(nsDependentString(wpath), aOutPath); #else - if(!getcwd(buf, size)) + char path[MAXPATHLEN]; + if (!getcwd(path, ArrayLength(path))) { return NS_ERROR_FAILURE; + } + aOutPath = path; #endif + return NS_OK; } @@ -535,8 +540,8 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, return; // Get the current working directory. - char workingDirPath[MAXPATHLEN]; - rv = GetCurrentWorkingDir(workingDirPath, sizeof(workingDirPath)); + nsAutoCString workingDirPath; + rv = GetCurrentWorkingDir(workingDirPath); if (NS_FAILED(rv)) return; @@ -565,7 +570,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, argv[3] = (char*) applyToDir.get(); argv[4] = (char*) pid.get(); if (appArgc) { - argv[5] = workingDirPath; + argv[5] = (char*) workingDirPath.get(); argv[6] = (char*) appFilePath.get(); for (int i = 1; i < appArgc; ++i) argv[6 + i] = appArgv[i]; @@ -743,8 +748,8 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, } // Get the current working directory. - char workingDirPath[MAXPATHLEN]; - rv = GetCurrentWorkingDir(workingDirPath, sizeof(workingDirPath)); + nsAutoCString workingDirPath; + rv = GetCurrentWorkingDir(workingDirPath); if (NS_FAILED(rv)) return; @@ -786,7 +791,7 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, argv[3] = (char*) applyToDir.get(); argv[4] = (char*) pid.get(); if (restart && appArgc) { - argv[5] = workingDirPath; + argv[5] = (char*) workingDirPath.get(); argv[6] = (char*) appFilePath.get(); for (int i = 1; i < appArgc; ++i) argv[6 + i] = appArgv[i]; diff --git a/tools/profiler/tasktracer/GeckoTaskTracer.cpp b/tools/profiler/tasktracer/GeckoTaskTracer.cpp index ada695614..36d1bffc3 100644 --- a/tools/profiler/tasktracer/GeckoTaskTracer.cpp +++ b/tools/profiler/tasktracer/GeckoTaskTracer.cpp @@ -20,22 +20,16 @@ #include <stdarg.h> -// We need a definition of gettid(), but glibc doesn't provide a +// We need a definition of gettid(), but older glibc versions don't provide a // wrapper for it. #if defined(__GLIBC__) #include <unistd.h> #include <sys/syscall.h> -static inline pid_t gettid() -{ - return (pid_t) syscall(SYS_gettid); -} +#define gettid() static_cast<pid_t>(syscall(SYS_gettid)) #elif defined(XP_MACOSX) #include <unistd.h> #include <sys/syscall.h> -static inline pid_t gettid() -{ - return (pid_t) syscall(SYS_thread_selfid); -} +#define gettid() static_cast<pid_t>(syscall(SYS_thread_selfid)) #elif defined(LINUX) #include <sys/types.h> pid_t gettid(); diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 338dcac67..05a2cab1a 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -187,6 +187,15 @@ GfxInfo::GetData() note.AppendLiteral(" -- texture_from_pixmap"); note.Append('\n'); + // illumos/Solaris 10 libc lacks a strcasestr function, but NSPR has + // one. A lot of programs just implement one on the spot or use strstr + // and a buffer as some kind of workaround. They've been implementing + // missing functions lately, though, so this may not be needed much longer. + +#ifndef strcasestr +#define strcasestr PL_strcasestr +#endif + // determine the major OpenGL version. That's the first integer in the version string. mGLMajorVersion = strtol(mVersion.get(), 0, 10); diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index c62f5873e..6f3c5313f 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -329,7 +329,7 @@ GfxInfo::Init() // Unfortunately, the Device ID is nullptr, and we can't enumerate // it using the setup infrastructure (SetupDiGetClassDevsW below // will return INVALID_HANDLE_VALUE). - if (mWindowsVersion == kWindows8 && + if (mWindowsVersion >= kWindows8 && mDeviceID.Length() == 0 && mDeviceString.EqualsLiteral("RDPUDD Chained DD")) { diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index a81eb3d71..84ba150db 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -450,6 +450,12 @@ RealBreak() ".object_arch armv4t\n" #endif "BKPT #0"); +#elif defined(__sun) +#if defined (__i386__) || defined(__i386) || defined(__x86_64__) + asm("int $3"); +#else + raise(SIGTRAP); +#endif #else #warning do not know how to break on this platform #endif @@ -524,6 +530,8 @@ Break(const char* aMsg) RealBreak(); #elif defined(__arm__) RealBreak(); +#elif defined(__sun) + RealBreak(); #else #warning do not know how to break on this platform #endif diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 88964f9b5..dcbad171e 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -317,6 +317,85 @@ VsizeMaxContiguousDistinguishedAmount(int64_t* aN) } #endif // FreeBSD +#elif defined(XP_SOLARIS) + +#include <procfs.h> +#include <fcntl.h> +#include <unistd.h> + +static void +XMappingIter(int64_t& aVsize, int64_t& aResident) +{ + aVsize = -1; + aResident = -1; + int mapfd = open("/proc/self/xmap", O_RDONLY); + struct stat st; + prxmap_t* prmapp = nullptr; + if (mapfd >= 0) { + if (!fstat(mapfd, &st)) { + int nmap = st.st_size / sizeof(prxmap_t); + while (1) { + // stat(2) on /proc/<pid>/xmap returns an incorrect value, + // prior to the release of Solaris 11. + // Here is a workaround for it. + nmap *= 2; + prmapp = (prxmap_t*)malloc((nmap + 1) * sizeof(prxmap_t)); + if (!prmapp) { + // out of memory + break; + } + int n = pread(mapfd, prmapp, (nmap + 1) * sizeof(prxmap_t), 0); + if (n < 0) { + break; + } + if (nmap >= n / sizeof(prxmap_t)) { + aVsize = 0; + aResident = 0; + for (int i = 0; i < n / sizeof(prxmap_t); i++) { + aVsize += prmapp[i].pr_size; + aResident += prmapp[i].pr_rss * prmapp[i].pr_pagesize; + } + break; + } + free(prmapp); + } + free(prmapp); + } + close(mapfd); + } +} + +#define HAVE_VSIZE_AND_RESIDENT_REPORTERS 1 +static MOZ_MUST_USE nsresult +VsizeDistinguishedAmount(int64_t* aN) +{ + int64_t vsize, resident; + XMappingIter(vsize, resident); + if (vsize == -1) { + return NS_ERROR_FAILURE; + } + *aN = vsize; + return NS_OK; +} + +static MOZ_MUST_USE nsresult +ResidentDistinguishedAmount(int64_t* aN) +{ + int64_t vsize, resident; + XMappingIter(vsize, resident); + if (resident == -1) { + return NS_ERROR_FAILURE; + } + *aN = resident; + return NS_OK; +} + +static MOZ_MUST_USE nsresult +ResidentFastDistinguishedAmount(int64_t* aN) +{ + return ResidentDistinguishedAmount(aN); +} + #elif defined(XP_MACOSX) #include <mach/mach_init.h> @@ -1066,9 +1145,13 @@ ResidentPeakDistinguishedAmount(int64_t* aN) if (0 == getrusage(RUSAGE_SELF, &usage)) { // The units for ru_maxrrs: // - Mac: bytes + // - Solaris: pages? But some sources it actually always returns 0, so + // check for that // - Linux, {Net/Open/Free}BSD, DragonFly: KiB #ifdef XP_MACOSX *aN = usage.ru_maxrss; +#elif defined(XP_SOLARIS) + *aN = usage.ru_maxrss * getpagesize(); #else *aN = usage.ru_maxrss * 1024; #endif diff --git a/xpcom/base/nsTraceRefcnt.cpp b/xpcom/base/nsTraceRefcnt.cpp index da51305a9..48448dbd9 100644 --- a/xpcom/base/nsTraceRefcnt.cpp +++ b/xpcom/base/nsTraceRefcnt.cpp @@ -657,7 +657,7 @@ InitLog(const char* aEnvVar, const char* aMsg, FILE** aResult) fname.Append('_'); fname.Append((char*)XRE_ChildProcessTypeToString(XRE_GetProcessType())); fname.AppendLiteral("_pid"); - fname.AppendInt((uint32_t)getpid()); + fname.AppendInt(getpid()); if (hasLogExtension) { fname.AppendLiteral(".log"); } diff --git a/xpcom/ds/nsMathUtils.h b/xpcom/ds/nsMathUtils.h index cbbd38611..e3f423c8f 100644 --- a/xpcom/ds/nsMathUtils.h +++ b/xpcom/ds/nsMathUtils.h @@ -11,6 +11,11 @@ #include <cmath> #include <float.h> +#ifdef XP_SOLARIS +#include <math.h> +#include <ieeefp.h> +#endif + /* * round */ diff --git a/xpcom/glue/FileUtils.cpp b/xpcom/glue/FileUtils.cpp index 699812461..53fe68708 100644 --- a/xpcom/glue/FileUtils.cpp +++ b/xpcom/glue/FileUtils.cpp @@ -532,7 +532,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset, if (!aOutFd) { CloseHandle(fd); } -#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX) +#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX) || defined(XP_SOLARIS) if (!aFilePath) { if (aOutFd) { *aOutFd = -1; diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 272153bba..06706235d 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -1591,6 +1591,22 @@ nsLocalFile::IsExecutable(bool* aResult) // Then check the execute bit. *aResult = (access(mPath.get(), X_OK) == 0); +#ifdef XP_SOLARIS + // On Solaris, access will always return 0 for root user, however + // the file is only executable if S_IXUSR | S_IXGRP | S_IXOTH is set. + // See bug 351950, https://bugzilla.mozilla.org/show_bug.cgi?id=351950 + if (*aResult) { + struct STAT buf; + + *aResult = (STAT(mPath.get(), &buf) == 0); + if (*aResult || errno == EACCES) { + *aResult = *aResult && (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)); + return NS_OK; + } + + return NSRESULT_FOR_ERRNO(); + } +#endif if (*aResult || errno == EACCES) { return NS_OK; } diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build index d455ed854..8ee7b3181 100644 --- a/xpcom/reflect/xptcall/md/unix/moz.build +++ b/xpcom/reflect/xptcall/md/unix/moz.build @@ -46,6 +46,21 @@ if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'): 'xptcstubs_ipf64.cpp' ] +# Without the need to accomodate the Sun compiler, Solaris/GCC support is pretty +# standard, actually. Not all that different from Linux. + +if CONFIG['OS_ARCH'] == 'SunOS': + if CONFIG['OS_TEST'] == 'x86_64': + SOURCES += [ + 'xptcinvoke_asm_x86_64_unix.S', + 'xptcinvoke_x86_64_solaris.cpp', + 'xptcstubs_x86_64_linux.cpp' + ] + elif '86' in CONFIG['OS_TEST']: + SOURCES += [ + 'xptcinvoke_gcc_x86_unix.cpp', + 'xptcstubs_gcc_x86_unix.cpp' + ] if CONFIG['OS_TEST'] == 'alpha': if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD'): @@ -186,7 +201,11 @@ if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'sparc': 'xptcstubs_sparc_openbsd.cpp', ] -if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD') and CONFIG['OS_TEST'] == 'sparc64': +# Mozilla discovered at some point that Solaris and Linux can also use these +# files for 64-bit SPARC with no ill effects, so basically the entire mess that +# was there before is no longer needed. + +if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD', 'SunOS') and CONFIG['OS_TEST'] == 'sparc64': SOURCES += [ 'xptcinvoke_asm_sparc64_openbsd.s', 'xptcinvoke_sparc64_openbsd.cpp', @@ -194,6 +213,17 @@ if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD') and CONFIG['OS_TEST'] == 'sparc64 'xptcstubs_sparc64_openbsd.cpp', ] +# As for the 32-bit SPARC build? That would look like the Linux version with +# one file changed. + +if CONFIG['OS_ARCH'] == 'SunOS' and CONFIG['OS_TEST'] == 'sparc': + SOURCES += [ + 'xptcinvoke_asm_sparc_solaris_GCC3.s', + 'xptcinvoke_sparc_solaris.cpp', + 'xptcstubs_asm_sparc_solaris.s', + 'xptcstubs_sparc_solaris.cpp', + ] + if CONFIG['OS_ARCH'] == 'Linux': if CONFIG['OS_TEST'] == 's390': SOURCES += [ diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s new file mode 100644 index 000000000..54adcd147 --- /dev/null +++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s @@ -0,0 +1,52 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Platform specific code to invoke XPCOM methods on native objects for + * solaris/sparc with gcc 3 ABI. + */ + .global NS_InvokeByIndex +/* + * NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, + * uint32_t paramCount, nsXPTCVariant* params); + */ +NS_InvokeByIndex: + save %sp,-(64 + 32),%sp ! room for the register window and + ! struct pointer, rounded up to 0 % 32 + mov %i2,%o0 ! paramCount + call invoke_count_words ! returns the required stack size in %o0 + mov %i3,%o1 ! params + + sll %o0,2,%l0 ! number of bytes + sub %sp,%l0,%sp ! create the additional stack space + + mov %sp,%o0 ! pointer for copied args + add %o0,72,%o0 ! step past the register window, the + ! struct result pointer and the 'this' slot + mov %i2,%o1 ! paramCount + call invoke_copy_to_stack + mov %i3,%o2 ! params +! +! calculate the target address from the vtable +! + ld [%i0],%l1 ! *that --> vTable + sll %i1,2,%i1 ! multiply index by 4 + add %i1,%l1,%l1 ! l1 now points to vTable entry + ld [%l1],%l0 ! target address + +.L5: ld [%sp + 88],%o5 +.L4: ld [%sp + 84],%o4 +.L3: ld [%sp + 80],%o3 +.L2: ld [%sp + 76],%o2 +.L1: ld [%sp + 72],%o1 +.L0: + jmpl %l0,%o7 ! call the routine +! always have a 'this', from the incoming 'that' + mov %i0,%o0 + + mov %o0,%i0 ! propagate return value + ret + restore diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S new file mode 100644 index 000000000..131cfc334 --- /dev/null +++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S @@ -0,0 +1,122 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# Darwin gives a leading '_' to symbols defined in C code. +#ifdef XP_DARWIN +#define SYM(x) _ ## x +#define CFI_STARTPROC +#define CFI_ENDPROC +#define CFI_DEF_CFA_OFFSET(offset) +#define CFI_OFFSET(reg, offset) +#define CFI_DEF_CFA_REGISTER(reg) +#define CFI_DEF_CFA(reg, offset) +#else +#define SYM(x) x +#define CFI_STARTPROC .cfi_startproc +#define CFI_ENDPROC .cfi_endproc +#define CFI_DEF_CFA_OFFSET(offset) .cfi_def_cfa_offset offset +#define CFI_OFFSET(reg, offset) .cfi_offset reg, offset +#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg +#define CFI_DEF_CFA(reg, offset) .cfi_def_cfa reg, offset +#endif + +.intel_syntax noprefix + +# nsresult NS_InvokeByIndex(nsISupports* this, uint32_t aVtableIndex, +# uint32_t argc, nsXPTCVariant* argv); +.text +.global SYM(NS_InvokeByIndex) +#ifndef XP_DARWIN +.type NS_InvokeByIndex, @function +#endif +.align 4 +SYM(NS_InvokeByIndex): + CFI_STARTPROC + push rbp + CFI_DEF_CFA_OFFSET(16) + CFI_OFFSET(6, -16) + mov rbp, rsp + CFI_DEF_CFA_REGISTER(6) + +# save r12 and r13 because we use them and they are callee saved. + push r12 + push r13 + CFI_OFFSET(12, -24) + CFI_OFFSET(13, -32) + +# save this and the vtable index because we need them after setting up the +# stack. + mov r12, rdi + mov r13, rsi + +# allocate space for stack arguments, in theory we only need 8 * (argc - 5) +# bytes because at least 5 arguments will go in registers, but for now it is +# just simpler to allocate 8 * argc bytes. Note that we treat the this +# pointer specially. + lea eax, [edx * 8] + sub rsp, rax + +# If there is an odd number of args the stack can be misaligned so realign it. + and rsp, 0xfffffffffffffff0 + +# pass the stack slot area to InvokeCopyToStack. + mov r8, rsp + +# setup space for the register slots: there are 5 integer ones and 8 floating +# point ones. So we need 104 bytes of space, but we allocate 112 to keep rsp +# aligned to 16 bytes. + sub rsp, 112 + +# the first argument to InvokeCopyToStack is the integer register area, and the +# second is the floating point area. + mov rdi, rsp + lea rsi, [rsp + 40] + +# The 3rd and 4th arguments to InvokeCopyToStack are already in the right +# registers. So now we can just call InvokeCopyToStack. + call SYM(InvokeCopyToStack) + +# setup this + mov rdi, r12 + +# copy the integer arguments into place. + mov rsi, [rsp] + mov rdx, [rsp + 8] + mov rcx, [rsp + 16] + mov r8, [rsp + 24] + mov r9, [rsp + 32] + +# copy the float arguments into place + movsd xmm0, [rsp + 40] + movsd xmm1, [rsp + 48] + movsd xmm2, [rsp + 56] + movsd xmm3, [rsp + 64] + movsd xmm4, [rsp + 72] + movsd xmm5, [rsp + 80] + movsd xmm6, [rsp + 88] + movsd xmm7, [rsp + 96] + +# get rid of the scratch space for registers + add rsp, 112 + +# load the function pointer and call + lea eax, [r13d * 8] + add rax, [rdi] + call [rax] + +# r12 and r13 were pushed relative to the old stack pointer which is now the +# frame pointer. + mov r12, [rbp - 0x8] + mov r13, [rbp - 0x10] + + mov rsp, rbp + pop rbp + CFI_DEF_CFA(7, 8) + ret + CFI_ENDPROC + +#ifndef XP_DARWIN +// Magic indicating no need for an executable stack +.section .note.GNU-stack, "", @progbits ; .previous +#endif diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc64_openbsd.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc64_openbsd.cpp index 050f9414d..1b5039ed9 100644 --- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc64_openbsd.cpp +++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc64_openbsd.cpp @@ -30,9 +30,9 @@ invoke_copy_to_stack(uint64_t* d, uint32_t paramCount, nsXPTCVariant* s) { if (regCount < 5) regCount++; - if (l_s->IsPtrData()) + if (l_s->IsIndirect()) { - *l_d = (uint64_t)l_s->ptr; + *l_d = (uint64_t) &l_s->val; continue; } switch (l_s->type) diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp new file mode 100644 index 000000000..c1b679779 --- /dev/null +++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp @@ -0,0 +1,141 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Platform specific code to invoke XPCOM methods on native objects */ + +#include "xptcprivate.h" + +/* solaris defines __sparc for workshop compilers and + linux defines __sparc__ */ + +#if !defined(__sparc) && !defined(__sparc__) +#error "This code is for Sparc only" +#endif + +typedef unsigned nsXPCVariant; + +extern "C" uint32_t +invoke_count_words(uint32_t paramCount, nsXPTCVariant* s) +{ + uint32_t result = 0; + for(uint32_t i = 0; i < paramCount; i++, s++) + { + if(s->IsPtrData()) + { + result++; + continue; + } + switch(s->type) + { + case nsXPTType::T_I8 : + case nsXPTType::T_I16 : + case nsXPTType::T_I32 : + result++; + break; + case nsXPTType::T_I64 : + result+=2; + break; + case nsXPTType::T_U8 : + case nsXPTType::T_U16 : + case nsXPTType::T_U32 : + result++; + break; + case nsXPTType::T_U64 : + result+=2; + break; + case nsXPTType::T_FLOAT : + result++; + break; + case nsXPTType::T_DOUBLE : + result+=2; + break; + case nsXPTType::T_BOOL : + case nsXPTType::T_CHAR : + case nsXPTType::T_WCHAR : + result++; + break; + default: + // all the others are plain pointer types + result++; + break; + } + } + // nuts, I know there's a cooler way of doing this, but it's late + // now and it'll probably come to me in the morning. + if (result & 0x3) result += 4 - (result & 0x3); // ensure q-word alignment + return result; +} + +extern "C" uint32_t +invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s) +{ +/* + We need to copy the parameters for this function to locals and use them + from there since the parameters occupy the same stack space as the stack + we're trying to populate. +*/ + uint32_t *l_d = d; + nsXPTCVariant *l_s = s; + uint32_t l_paramCount = paramCount; + uint32_t regCount = 0; // return the number of registers to load from the stack + + typedef struct { + uint32_t hi; + uint32_t lo; + } DU; // have to move 64 bit entities as 32 bit halves since + // stack slots are not guaranteed 16 byte aligned + + for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++) + { + if (regCount < 5) regCount++; + if(l_s->IsPtrData()) + { + if(l_s->type == nsXPTType::T_JSVAL) + { + // On SPARC, we need to pass a pointer to HandleValue + *((void**)l_d) = &l_s->ptr; + } else + { + *((void**)l_d) = l_s->ptr; + } + continue; + } + switch(l_s->type) + { + case nsXPTType::T_I8 : *((int32_t*) l_d) = l_s->val.i8; + break; + case nsXPTType::T_I16 : *((int32_t*) l_d) = l_s->val.i16; + break; + case nsXPTType::T_I32 : *((int32_t*) l_d) = l_s->val.i32; + break; + case nsXPTType::T_I64 : + case nsXPTType::T_U64 : + case nsXPTType::T_DOUBLE : *((uint32_t*) l_d++) = ((DU *)l_s)->hi; + if (regCount < 5) regCount++; + *((uint32_t*) l_d) = ((DU *)l_s)->lo; + break; + case nsXPTType::T_U8 : *((uint32_t*) l_d) = l_s->val.u8; + break; + case nsXPTType::T_U16 : *((uint32_t*) l_d) = l_s->val.u16; + break; + case nsXPTType::T_U32 : *((uint32_t*) l_d) = l_s->val.u32; + break; + case nsXPTType::T_FLOAT : *((float*) l_d) = l_s->val.f; + break; + case nsXPTType::T_BOOL : *((uint32_t*) l_d) = l_s->val.b; + break; + case nsXPTType::T_CHAR : *((uint32_t*) l_d) = l_s->val.c; + break; + case nsXPTType::T_WCHAR : *((int32_t*) l_d) = l_s->val.wc; + break; + default: + // all the others are plain pointer types + *((void**)l_d) = l_s->val.p; + break; + } + } + return regCount; +} + diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp new file mode 100644 index 000000000..a9db2a693 --- /dev/null +++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Platform specific code to invoke XPCOM methods on native objects + +#include "xptcprivate.h" + +// 6 integral parameters are passed in registers, but 1 is |this| which isn't +// considered here. +const uint32_t GPR_COUNT = 5; + +// 8 floating point parameters are passed in SSE registers +const uint32_t FPR_COUNT = 8; + +extern "C" void +InvokeCopyToStack(uint64_t * gpregs, double * fpregs, + uint32_t paramCount, nsXPTCVariant * s, + uint64_t* d) +{ + uint32_t nr_gpr = 0u; // skip one GP register for 'that' + uint32_t nr_fpr = 0u; + uint64_t value = 0u; + + for (uint32_t i = 0; i < paramCount; i++, s++) { + if (s->IsPtrData()) + value = (uint64_t) s->ptr; + else { + switch (s->type) { + case nsXPTType::T_FLOAT: break; + case nsXPTType::T_DOUBLE: break; + case nsXPTType::T_I8: value = s->val.i8; break; + case nsXPTType::T_I16: value = s->val.i16; break; + case nsXPTType::T_I32: value = s->val.i32; break; + case nsXPTType::T_I64: value = s->val.i64; break; + case nsXPTType::T_U8: value = s->val.u8; break; + case nsXPTType::T_U16: value = s->val.u16; break; + case nsXPTType::T_U32: value = s->val.u32; break; + case nsXPTType::T_U64: value = s->val.u64; break; + case nsXPTType::T_BOOL: value = s->val.b; break; + case nsXPTType::T_CHAR: value = s->val.c; break; + case nsXPTType::T_WCHAR: value = s->val.wc; break; + default: value = (uint64_t) s->val.p; break; + } + } + + if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) { + if (nr_fpr < FPR_COUNT) + fpregs[nr_fpr++] = s->val.d; + else { + *((double *)d) = s->val.d; + d++; + } + } + else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) { + if (nr_fpr < FPR_COUNT) + // The value in %xmm register is already prepared to + // be retrieved as a float. Therefore, we pass the + // value verbatim, as a double without conversion. + fpregs[nr_fpr++] = s->val.d; + else { + *((float *)d) = s->val.f; + d++; + } + } + else { + if (nr_gpr < GPR_COUNT) + gpregs[nr_gpr++] = value; + else + *d++ = value; + } + } +} diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s new file mode 100644 index 000000000..9b448d7c7 --- /dev/null +++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + .global SharedStub + +/* + in the frame for the function that called SharedStub are the + rest of the parameters we need + +*/ + +SharedStub: +! we don't create a new frame yet, but work within the frame of the calling +! function to give ourselves the other parameters we want + + mov %o0, %o1 ! shuffle the index up to 2nd place + mov %i0, %o0 ! the original 'this' + add %fp, 72, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this') +! save off the original incoming parameters that arrived in +! registers, the ABI guarantees the space for us to do this + st %i1, [%fp + 72] + st %i2, [%fp + 76] + st %i3, [%fp + 80] + st %i4, [%fp + 84] + st %i5, [%fp + 88] +! now we can build our own stack frame + save %sp,-(64 + 32),%sp ! room for the register window and + ! struct pointer, rounded up to 0 % 32 +! our function now appears to have been called +! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args) +! so we can just copy these through + + mov %i0, %o0 + mov %i1, %o1 + mov %i2, %o2 + call PrepareAndDispatch + nop + mov %o0,%i0 ! propagate return value + b .LL1 + nop +.LL1: + ret + restore + + .size SharedStub, .-SharedStub + .type SharedStub, #function diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc64_openbsd.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc64_openbsd.cpp index b8a09c97e..e28a03794 100644 --- a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc64_openbsd.cpp +++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc64_openbsd.cpp @@ -85,8 +85,13 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args) extern "C" nsresult SharedStub(int, int*); +/* + * Avoid GCC stack protector to wipe out imput registers since the compiler + * thinks the function takes no arguments. + */ + #define STUB_ENTRY(n) \ -nsresult nsXPTCStubBase::Stub##n() \ +nsresult __attribute__((__optimize__("no-stack-protector"))) nsXPTCStubBase::Stub##n() \ { \ int dummy; /* defeat tail-call optimization */ \ return SharedStub(n, &dummy); \ diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp new file mode 100644 index 000000000..61f3df4ff --- /dev/null +++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp @@ -0,0 +1,112 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Implement shared vtbl methods. */ + +#include "xptcprivate.h" +#include "xptiprivate.h" + +#if defined(sparc) || defined(__sparc__) + +extern "C" nsresult ATTRIBUTE_USED +PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) +{ + + typedef struct { + uint32_t hi; + uint32_t lo; + } DU; // have to move 64 bit entities as 32 bit halves since + // stack slots are not guaranteed 16 byte aligned + +#define PARAM_BUFFER_COUNT 16 + + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; + nsXPTCMiniVariant* dispatchParams = nullptr; + const nsXPTMethodInfo* info; + uint8_t paramCount; + uint8_t i; + nsresult result = NS_ERROR_FAILURE; + + NS_ASSERTION(self,"no self"); + + self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info); + NS_ASSERTION(info,"no interface info"); + + paramCount = info->GetParamCount(); + + // setup variant array pointer + if(paramCount > PARAM_BUFFER_COUNT) + dispatchParams = new nsXPTCMiniVariant[paramCount]; + else + dispatchParams = paramBuffer; + NS_ASSERTION(dispatchParams,"no place for params"); + + uint32_t* ap = args; + for(i = 0; i < paramCount; i++, ap++) + { + const nsXPTParamInfo& param = info->GetParam(i); + const nsXPTType& type = param.GetType(); + nsXPTCMiniVariant* dp = &dispatchParams[i]; + + if(param.IsOut() || !type.IsArithmetic()) + { + if (type == nsXPTType::T_JSVAL) + dp->val.p = *((void**) *ap); + else + dp->val.p = (void*) *ap; + continue; + } + // else + switch(type) + { + case nsXPTType::T_I8 : dp->val.i8 = *((int32_t*) ap); break; + case nsXPTType::T_I16 : dp->val.i16 = *((int32_t*) ap); break; + case nsXPTType::T_I32 : dp->val.i32 = *((int32_t*) ap); break; + case nsXPTType::T_DOUBLE : + case nsXPTType::T_U64 : + case nsXPTType::T_I64 : ((DU *)dp)->hi = ((DU *)ap)->hi; + ((DU *)dp)->lo = ((DU *)ap)->lo; + ap++; + break; + case nsXPTType::T_U8 : dp->val.u8 = *((uint32_t*)ap); break; + case nsXPTType::T_U16 : dp->val.u16 = *((uint32_t*)ap); break; + case nsXPTType::T_U32 : dp->val.u32 = *((uint32_t*)ap); break; + case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *((uint32_t*)ap); break; + case nsXPTType::T_CHAR : dp->val.c = *((uint32_t*)ap); break; + case nsXPTType::T_WCHAR : dp->val.wc = *((int32_t*) ap); break; + default: + NS_ERROR("bad type"); + break; + } + } + + result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams); + + if(dispatchParams != paramBuffer) + delete [] dispatchParams; + + return result; +} + +extern "C" nsresult SharedStub(int, int*); + +#define STUB_ENTRY(n) \ +nsresult nsXPTCStubBase::Stub##n() \ +{ \ + int dummy; /* defeat tail-call optimization */ \ + return SharedStub(n, &dummy); \ +} + +#define SENTINEL_ENTRY(n) \ +nsresult nsXPTCStubBase::Sentinel##n() \ +{ \ + NS_ERROR("nsXPTCStubBase::Sentinel called"); \ + return NS_ERROR_NOT_IMPLEMENTED; \ +} + +#include "xptcstubsdef.inc" + +#endif /* sparc || __sparc__ */ diff --git a/xpcom/reflect/xptcall/status.html b/xpcom/reflect/xptcall/status.html index deb4da92e..996159c82 100644 --- a/xpcom/reflect/xptcall/status.html +++ b/xpcom/reflect/xptcall/status.html @@ -241,6 +241,20 @@ a port. <TR> <TD bgcolor="green"><font color="white"><b>Done</b></font></TD> +<TD>SunOS x86</TD> +<TD> +<img alt="Contributed code!" title="Contributed code!" src="http://tinderbox.mozilla.org/star.gif"> +<a href="mailto:aljones@lbl.gov">Arthur Jones <aljones@lbl.gov></a><BR> +<font color="red"><b>?</b></font> +<a href="mailto:ppokorny@mindspring.com">Philip Pokorny <ppokorny@mindspring.com></a><BR> +</TD> +<TD> +The word I hear is that this is working and done +</TD> +</TR> + +<TR> +<TD bgcolor="green"><font color="white"><b>Done</b></font></TD> <TD>Irix</TD> <TD><img alt="Contributed code!" title="Contributed code!" src="http://tinderbox.mozilla.org/star.gif"> <a href="mailto:jasonh@m7.engr.sgi.com">Jason Heirtzler <jasonh@m7.engr.sgi.com></a><BR> diff --git a/xpcom/string/nsTSubstring.h b/xpcom/string/nsTSubstring.h index 53b4fb9a8..537889d5c 100644 --- a/xpcom/string/nsTSubstring.h +++ b/xpcom/string/nsTSubstring.h @@ -10,6 +10,14 @@ #include "mozilla/IntegerTypeTraits.h" #include "mozilla/Span.h" +// Solaris defines pid_t to be long on ILP32 and int on LP64. I checked in +// sys/types.h. AMD64 and SPARC64 builds don't need this fix at all, +// while all 32-bit builds do. + +#if defined(XP_SOLARIS) && !defined(__LP64__) +#include <unistd.h> +#endif + #ifndef MOZILLA_INTERNAL_API #error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead. #endif @@ -587,6 +595,17 @@ public: const char* fmt = aRadix == 10 ? "%d" : aRadix == 8 ? "%o" : "%x"; AppendPrintf(fmt, aInteger); } +#if defined(XP_SOLARIS) && !defined(__LP64__) + void AppendInt(pid_t aInteger) + { + AppendPrintf("%lu", aInteger); + } + void AppendInt(pid_t aInteger, int aRadix) + { + const char* fmt = aRadix == 10 ? "%lu" : aRadix == 8 ? "%lo" : "%lx"; + AppendPrintf(fmt, aInteger); + } +#endif void AppendInt(uint32_t aInteger) { AppendPrintf("%u", aInteger); diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index 241fad39d..eb967870a 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -112,7 +112,9 @@ nsThreadPool::PutEvent(already_AddRefed<nsIRunnable> aEvent, uint32_t aFlags) bool killThread = false; { MutexAutoLock lock(mMutex); - if (mThreads.Count() < (int32_t)mThreadLimit) { + if (mShutdown) { + killThread = true; // we're in shutdown, kill the thread + } else if (mThreads.Count() < (int32_t)mThreadLimit) { mThreads.AppendObject(thread); } else { killThread = true; // okay, we don't need this thread anymore |