Ho ho ho, it's a lump of hg coal. Merge.
--HG-- rename : js/src/js.cpp => js/src/shell/js.cpp
1
.hgtags
@ -26,3 +26,4 @@ d7d64f68423b68a671f623f123e90057ebc49dac UPDATE_PACKAGING_R6
|
||||
0000000000000000000000000000000000000000 THUNDERBIRD_3_0a3_RELEASE
|
||||
0cd41f5990807fb6ab52cb59ba3c8e8247281045 GECKO_1_9_1_BASE
|
||||
8df5a90281cd4d75835e4b7696da200555eed15f GECKO_1_9_1_BASE
|
||||
8a601ed6bc4c7b3d1e35aa9e81f257512d984bd5 FENNEC_A2
|
||||
|
@ -563,6 +563,9 @@ nsApplicationAccessibleWrap::Init()
|
||||
// it will overwrite gail_util
|
||||
g_type_class_unref(g_type_class_ref(MAI_TYPE_UTIL));
|
||||
|
||||
// Init atk-bridge now
|
||||
PR_SetEnv("NO_AT_BRIDGE=0");
|
||||
|
||||
// load and initialize atk-bridge library
|
||||
rv = LoadGtkModule(sAtkBridge);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -431,7 +431,7 @@ pref("intl.charsetmenu.browser.more2", "chrome://global/locale/intl.properties"
|
||||
pref("intl.charsetmenu.browser.more3", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more4", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.more5", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.unicode", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charsetmenu.browser.unicode", "UTF-8, UTF-16LE, UTF-16BE, UTF-32, UTF-32LE, UTF-32BE");
|
||||
pref("intl.charset.detector", "chrome://global/locale/intl.properties");
|
||||
pref("intl.charset.default", "chrome://global-platform/locale/intl.properties");
|
||||
pref("font.language.group", "chrome://global/locale/intl.properties");
|
||||
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
@ -45,6 +45,10 @@ include $(DEPTH)/config/autoconf.mk
|
||||
MODULE = test_browser_feeds
|
||||
XPCSHELL_TESTS = unit
|
||||
|
||||
DIRS = \
|
||||
chrome \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = test_bug408328.html \
|
||||
|
61
browser/components/feeds/test/chrome/Makefile.in
Normal file
@ -0,0 +1,61 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla.org.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2005
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = browser/components/feeds/test/chrome
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# sample_feed.atom was copied from toolkit/components/places/tests/chrome
|
||||
_HTTP_FILES = \
|
||||
sample_feed.atom \
|
||||
$(NULL)
|
||||
|
||||
_CHROME_FILES = \
|
||||
test_423060.xul \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_HTTP_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_CHROME_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
|
||||
|
23
browser/components/feeds/test/chrome/sample_feed.atom
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
|
||||
<title>Example Feed</title>
|
||||
<link href="http://example.org/"/>
|
||||
<updated>2003-12-13T18:30:02Z</updated>
|
||||
|
||||
<author>
|
||||
<name>John Doe</name>
|
||||
</author>
|
||||
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
||||
|
||||
<entry>
|
||||
|
||||
<title>Atom-Powered Robots Run Amok</title>
|
||||
<link href="http://example.org/2003/12/13/atom03"/>
|
||||
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
||||
<updated>2003-12-13T18:30:02Z</updated>
|
||||
|
||||
<summary>Some text.</summary>
|
||||
</entry>
|
||||
|
||||
</feed>
|
@ -57,7 +57,8 @@ RequestExecutionLevel user
|
||||
!system 'echo ; > shortcuts.ini'
|
||||
!system 'echo ; > summary.ini'
|
||||
|
||||
; USE_UAC_PLUGIN is temporary until Thunderbird has been updated to use the UAC plugin
|
||||
; USE_UAC_PLUGIN is temporary until all applications have been updated to use
|
||||
; the UAC plugin
|
||||
!define USE_UAC_PLUGIN
|
||||
|
||||
Var TmpVal
|
||||
@ -72,7 +73,6 @@ Var AddDesktopSC
|
||||
!include FileFunc.nsh
|
||||
!include LogicLib.nsh
|
||||
!include MUI.nsh
|
||||
!include TextFunc.nsh
|
||||
!include WinMessages.nsh
|
||||
!include WinVer.nsh
|
||||
!include WordFunc.nsh
|
||||
@ -83,11 +83,6 @@ Var AddDesktopSC
|
||||
!insertmacro StrFilter
|
||||
!insertmacro WordReplace
|
||||
|
||||
; NSIS provided macros that we have overridden
|
||||
!include overrides.nsh
|
||||
!insertmacro LocateNoDetails
|
||||
!insertmacro TextCompareNoDetails
|
||||
|
||||
; The following includes are custom.
|
||||
!include branding.nsi
|
||||
!include defines.nsi
|
||||
@ -105,7 +100,6 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
|
||||
!insertmacro ChangeMUIHeaderImage
|
||||
!insertmacro CheckForFilesInUse
|
||||
!insertmacro CleanUpdatesDir
|
||||
!insertmacro CloseApp
|
||||
!insertmacro CopyFilesFromDir
|
||||
!insertmacro CreateRegKey
|
||||
!insertmacro GetPathFromString
|
||||
@ -289,10 +283,9 @@ Section "-Application" APP_IDX
|
||||
ClearErrors
|
||||
ReadRegStr $R0 HKLM "Software\Apple Computer, Inc.\QuickTime" "InstallDir"
|
||||
${Unless} ${Errors}
|
||||
Push $R0
|
||||
${GetPathFromRegStr}
|
||||
Pop $R0
|
||||
${Unless} ${Errors}
|
||||
${GetLongPath} $R0 "$R0"
|
||||
${Unless} $R0 == ""
|
||||
ClearErrors
|
||||
GetFullPathName $R0 "$R0\Plugins\nsIQTScriptablePlugin.xpt"
|
||||
${Unless} ${Errors}
|
||||
${LogHeader} "Copying QuickTime Scriptable Component"
|
||||
@ -368,8 +361,12 @@ Section "-Application" APP_IDX
|
||||
${FixClassKeys}
|
||||
|
||||
; On install always add the FirefoxHTML and FirefoxURL keys.
|
||||
; An empty string is used for the 5th param because FirefoxHTML is not a
|
||||
; protocol handler.
|
||||
; An empty string is used for the 5th param because FirefoxHTML and FirefoxURL
|
||||
; are not protocol handlers.
|
||||
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
|
||||
StrCpy $2 "$\"$8$\" -requestPending -osint -url $\"%1$\""
|
||||
StrCpy $3 "$\"%1$\",,0,0,,,,"
|
||||
|
||||
${AddDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" \
|
||||
"${DDEApplication}" "$3" "WWW_OpenURL"
|
||||
|
||||
|
@ -52,7 +52,8 @@ RequestExecutionLevel user
|
||||
|
||||
!addplugindir ./
|
||||
|
||||
; USE_UAC_PLUGIN is temporary until Thunderbird has been updated to use the UAC plugin
|
||||
; USE_UAC_PLUGIN is temporary until all applications have been updated to use
|
||||
; the UAC plugin
|
||||
!define USE_UAC_PLUGIN
|
||||
|
||||
; prevents compiling of the reg write logging.
|
||||
@ -65,7 +66,6 @@ Var TmpVal
|
||||
!include FileFunc.nsh
|
||||
!include LogicLib.nsh
|
||||
!include MUI.nsh
|
||||
!include TextFunc.nsh
|
||||
!include WinMessages.nsh
|
||||
!include WinVer.nsh
|
||||
!include WordFunc.nsh
|
||||
|
@ -84,11 +84,12 @@ APP_VERSION := $(shell cat $(srcdir)/../config/version.txt)
|
||||
PWD := $(shell pwd)
|
||||
core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
|
||||
|
||||
# ZIP_IN is defaulted to be compatible with the files the wget-en-US target
|
||||
# pulls. You may override ZIP_IN if you provide your own files. You also _must_
|
||||
# override ZIP_IN when MOZ_PKG_PRETTYNAMES is defined - the default will not
|
||||
# These are defaulted to be compatible with the files the wget-en-US target
|
||||
# pulls. You may override them if you provide your own files. You _must_
|
||||
# override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
|
||||
# work in that case.
|
||||
ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
|
||||
WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
|
||||
|
||||
DEFINES += \
|
||||
-DAB_CD=$(AB_CD) \
|
||||
@ -240,7 +241,6 @@ endif
|
||||
chmod 0755 $(WIN32_INSTALLER_OUT)
|
||||
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
repackage-win32-installer-%: WIN32_INSTALLER_IN=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
|
||||
repackage-win32-installer-%: $(WIN32_INSTALLER_IN) libs-%
|
||||
@$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN=$(WIN32_INSTALLER_IN)
|
||||
else
|
||||
@ -250,7 +250,7 @@ endif
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS
|
||||
else
|
||||
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)
|
||||
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)
|
||||
endif
|
||||
|
||||
$(STAGEDIST): AB_CD:=en-US
|
||||
@ -318,7 +318,6 @@ endif
|
||||
$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
|
||||
mv -f "$(DIST)/l10n-stage/$(PACKAGE)" "$(DIST)/$(PACKAGE)"
|
||||
|
||||
repackage-zip-%: ZIP_IN=$(_ABS_DIST)/$(PACKAGE)
|
||||
repackage-zip-%: $(ZIP_IN) $(STAGEDIST) libs-%
|
||||
@$(MAKE) repackage-zip AB_CD=$* ZIP_IN=$(ZIP_IN)
|
||||
|
||||
@ -330,7 +329,7 @@ langpack-%: libs-%
|
||||
$(NSINSTALL) -D $(DIST)/$(PKG_LANGPACK_PATH)
|
||||
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) -I$(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/defines.inc -I$(LOCALE_SRCDIR)/defines.inc $(srcdir)/generic/install.rdf > $(FINAL_TARGET)/install.rdf
|
||||
cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
|
||||
$(ZIP) -r9D $(LANGPACK_FILE) install.rdf chrome/$(AB_CD).jar chrome.manifest
|
||||
$(ZIP) -r9D $(LANGPACK_FILE) install.rdf chrome chrome.manifest -x chrome/$(AB_CD).manifest
|
||||
|
||||
# This is a generic target that will make a langpack, repack ZIP (+tarball)
|
||||
# builds, and repack an installer if applicable. It is called from the
|
||||
@ -425,6 +424,17 @@ endif
|
||||
# Set the permissions that the folders will have in ftp once uploaded
|
||||
chmod -vR 775 $(UPLOAD_DIR)
|
||||
|
||||
l10n-upload-%: AB_CD=$*
|
||||
l10n-upload-%:
|
||||
$(PYTHON) $(topsrcdir)/build/upload.py --base-path $(DIST) "$(DIST)/$(PACKAGE)" $(DIST)/$(LANGPACK)
|
||||
ifdef MOZ_MAKE_COMPLETE_MAR
|
||||
$(PYTHON) $(topsrcdir)/build/upload.py --base-path $(DIST) $(DIST)/$(COMPLETE_MAR)
|
||||
endif
|
||||
ifeq (WINNT, $(OS_ARCH))
|
||||
$(PYTHON) $(topsrcdir)/build/upload.py --base-path $(DIST) "$(INSTALLER_PACKAGE)"
|
||||
endif
|
||||
|
||||
|
||||
merge-%:
|
||||
ifdef LOCALE_MERGEDIR
|
||||
$(RM) -rf $(LOCALE_MERGEDIR)
|
||||
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 708 B |
Before Width: | Height: | Size: 840 B After Width: | Height: | Size: 757 B |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 791 B |
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 363 B |
@ -57,6 +57,7 @@
|
||||
|
||||
import sys, os
|
||||
from optparse import OptionParser
|
||||
from subprocess import Popen, PIPE
|
||||
from util import check_call
|
||||
|
||||
def RequireEnvironmentVariable(v):
|
||||
@ -104,7 +105,10 @@ def AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key):
|
||||
if port is not None:
|
||||
cmdline.append("-P%d" % port)
|
||||
if ssh_key is not None:
|
||||
cmdline.extend(["-i", WindowsPathToMsysPath(ssh_key)])
|
||||
# Don't interpret ~ paths - ssh can handle that on its own
|
||||
if not ssh_key.startswith('~'):
|
||||
ssh_key = WindowsPathToMsysPath(ssh_key)
|
||||
cmdline.extend(["-o", "IdentityFile=%s" % ssh_key])
|
||||
|
||||
def DoSSHCommand(command, user, host, port=None, ssh_key=None):
|
||||
"""Execute command on user@host using ssh. Optionally use
|
||||
@ -112,7 +116,12 @@ def DoSSHCommand(command, user, host, port=None, ssh_key=None):
|
||||
cmdline = ["ssh"]
|
||||
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
|
||||
cmdline.extend(["%s@%s" % (user, host), command])
|
||||
check_call(cmdline)
|
||||
cmd = Popen(cmdline, stdout=PIPE)
|
||||
retcode = cmd.wait()
|
||||
if retcode != 0:
|
||||
raise Exception("Command %s returned non-zero exit code: %i" % \
|
||||
(cmdline, retcode))
|
||||
return cmd.stdout.read().strip()
|
||||
|
||||
def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None):
|
||||
"""Upload file to user@host:remote_path using scp. Optionally use
|
||||
@ -135,13 +144,19 @@ def GetRemotePath(path, local_file, base_path):
|
||||
dir = dir[len(base_path)+1:].replace('\\','/')
|
||||
return path + dir
|
||||
|
||||
def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None, base_path=None, post_upload_command=None):
|
||||
def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None, base_path=None, upload_to_temp_dir=False, post_upload_command=None):
|
||||
"""Upload each file in the list files to user@host:path. Optionally pass
|
||||
port and ssh_key to the ssh commands. If base_path is not None, upload
|
||||
files including their path relative to base_path. If post_upload_command
|
||||
is not None, execute that command on the remote host after uploading
|
||||
all files, passing it the upload path, and the full paths to all files
|
||||
uploaded. If verbose is True, print status updates while working."""
|
||||
files including their path relative to base_path. If upload_to_temp_dir is
|
||||
True files will be uploaded to a temporary directory on the remote server.
|
||||
Generally, you should have a post upload command specified in these cases
|
||||
that can move them around to their correct location(s).
|
||||
If post_upload_command is not None, execute that command on the remote host
|
||||
after uploading all files, passing it the upload path, and the full paths to
|
||||
all files uploaded.
|
||||
If verbose is True, print status updates while working."""
|
||||
if upload_to_temp_dir:
|
||||
path = DoSSHCommand("mktemp -d", user, host, port=port, ssh_key=ssh_key)
|
||||
if not path.endswith("/"):
|
||||
path += "/"
|
||||
if base_path is not None:
|
||||
@ -163,20 +178,28 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
|
||||
print "Running post-upload command: " + post_upload_command
|
||||
file_list = '"' + '" "'.join(remote_files) + '"'
|
||||
DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
|
||||
if upload_to_temp_dir:
|
||||
DoSSHCommand("rm -rf %s" % path, user, host, port=port, ssh_key=ssh_key)
|
||||
if verbose:
|
||||
print "Upload complete"
|
||||
|
||||
if __name__ == '__main__':
|
||||
host = RequireEnvironmentVariable('UPLOAD_HOST')
|
||||
user = RequireEnvironmentVariable('UPLOAD_USER')
|
||||
path = RequireEnvironmentVariable('UPLOAD_PATH')
|
||||
path = OptionalEnvironmentVariable('UPLOAD_PATH')
|
||||
upload_to_temp_dir = OptionalEnvironmentVariable('UPLOAD_TO_TEMP')
|
||||
port = OptionalEnvironmentVariable('UPLOAD_PORT')
|
||||
if port is not None:
|
||||
port = int(port)
|
||||
key = OptionalEnvironmentVariable('UPLOAD_SSH_KEY')
|
||||
post_upload_command = OptionalEnvironmentVariable('POST_UPLOAD_CMD')
|
||||
if (not path and not upload_to_temp_dir) or (path and upload_to_temp_dir):
|
||||
print "One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
|
||||
"defined."
|
||||
sys.exit(1)
|
||||
if sys.platform == 'win32':
|
||||
path = FixupMsysPath(path)
|
||||
if path is not None:
|
||||
path = FixupMsysPath(path)
|
||||
if post_upload_command is not None:
|
||||
post_upload_command = FixupMsysPath(post_upload_command)
|
||||
|
||||
@ -190,10 +213,10 @@ if __name__ == '__main__':
|
||||
sys.exit(1)
|
||||
try:
|
||||
UploadFiles(user, host, path, args, base_path=options.base_path,
|
||||
port=port, ssh_key=key, post_upload_command=post_upload_command,
|
||||
port=port, ssh_key=key, upload_to_temp_dir=upload_to_temp_dir,
|
||||
post_upload_command=post_upload_command,
|
||||
verbose=True)
|
||||
except IOError, (strerror):
|
||||
print strerror
|
||||
except Exception, (err):
|
||||
print err
|
||||
|
||||
|
@ -132,7 +132,6 @@ MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
|
||||
MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
|
||||
XPCOM_USE_LEA = @XPCOM_USE_LEA@
|
||||
JS_ULTRASPARC_OPTS = @JS_ULTRASPARC_OPTS@
|
||||
JS_STATIC_BUILD = @JS_STATIC_BUILD@
|
||||
MOZ_ENABLE_POSTSCRIPT = @MOZ_ENABLE_POSTSCRIPT@
|
||||
MOZ_INSTALLER = @MOZ_INSTALLER@
|
||||
MOZ_UPDATER = @MOZ_UPDATER@
|
||||
|
@ -73,6 +73,8 @@ CHECK_VARS := \
|
||||
SHORT_LIBNAME \
|
||||
XPI_PKGNAME \
|
||||
INSTALL_EXTENSION_ID \
|
||||
SHARED_LIBRARY_NAME \
|
||||
STATIC_LIBRARY_NAME \
|
||||
$(NULL)
|
||||
|
||||
# checks for internal spaces or trailing spaces in the variable
|
||||
@ -359,6 +361,18 @@ DSO_PIC_CFLAGS=
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef SHARED_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef STATIC_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
STATIC_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
# This comes from configure
|
||||
ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
139
config/mangle.c
@ -1,139 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
HANDLE hMangleFile;
|
||||
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(stderr, "MANGLE: <file>\n");
|
||||
}
|
||||
|
||||
BOOL MangleFile( const char *real_name, const char *mangle_name )
|
||||
{
|
||||
int len;
|
||||
DWORD dwWritten;
|
||||
char buffer[2048];
|
||||
|
||||
if( mangle_name && *mangle_name && strcmpi(real_name, mangle_name) ) {
|
||||
printf("Mangle: renaming %s to %s\n", real_name, mangle_name);
|
||||
|
||||
if( ! MoveFile(real_name, "X_MANGLE.TMP") ) {
|
||||
fprintf(stderr, "MANGLE: cannot rename %s to X_MANGLE.TMP\n",
|
||||
real_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( ! MoveFile("X_MANGLE.TMP", mangle_name) ) {
|
||||
MoveFile("X_MANGLE.TMP", real_name);
|
||||
fprintf(stderr, "MANGLE: cannot rename X_MANGLE.TMP to %s\n",
|
||||
mangle_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
len = sprintf(buffer, "mv %s %s\r\n", mangle_name, real_name);
|
||||
|
||||
if( (WriteFile( hMangleFile, buffer, len, &dwWritten, NULL ) == FALSE) ||
|
||||
(dwWritten != len) ) {
|
||||
fprintf(stderr, "MANGLE: error writing to UNMANGLE.BAT\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
WIN32_FIND_DATA find_data;
|
||||
HANDLE hFoundFile;
|
||||
|
||||
if( argc != 1 ) {
|
||||
Usage();
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
hMangleFile = CreateFile("unmangle.bat", /* name */
|
||||
GENERIC_READ|GENERIC_WRITE, /* access mode */
|
||||
0, /* share mode */
|
||||
NULL, /* security descriptor */
|
||||
CREATE_NEW, /* how to create */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file attributes */
|
||||
NULL ); /* template file */
|
||||
|
||||
if( hMangleFile == INVALID_HANDLE_VALUE ) {
|
||||
if( GetLastError() == ERROR_FILE_EXISTS ) {
|
||||
fprintf(stderr, "MANGLE: UNMANGLE.BAT already exists\n");
|
||||
} else {
|
||||
fprintf(stderr, "MANGLE: cannot open UNMANGLE.BAT\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( (hFoundFile = FindFirstFile("*.*", &find_data)) == INVALID_HANDLE_VALUE ) {
|
||||
fprintf(stderr, "MANGLE: cannot read directory\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
do {
|
||||
if( !MangleFile(find_data.cFileName, find_data.cAlternateFileName) ) {
|
||||
fprintf(stderr, "MANGLE: cannot rename %s to %s\n",
|
||||
find_data.cFileName, find_data.cAlternateFileName );
|
||||
|
||||
FindClose( hFoundFile );
|
||||
CloseHandle( hMangleFile );
|
||||
return 1;
|
||||
}
|
||||
} while( FindNextFile(hFoundFile, &find_data) );
|
||||
FindClose( hFoundFile );
|
||||
|
||||
{
|
||||
int len;
|
||||
DWORD dwWritten;
|
||||
char buffer[255];
|
||||
|
||||
len = sprintf(buffer, "del unmangle.bat\r\n");
|
||||
WriteFile ( hMangleFile, buffer, len, &dwWritten, NULL );
|
||||
}
|
||||
CloseHandle( hMangleFile );
|
||||
|
||||
return 0;
|
||||
}
|
@ -219,15 +219,15 @@ endif # ENABLE_TESTS
|
||||
#
|
||||
|
||||
ifndef LIBRARY
|
||||
ifdef LIBRARY_NAME
|
||||
ifdef STATIC_LIBRARY_NAME
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
ifdef SHORT_LIBNAME
|
||||
LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
STATIC_LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
endif # STATIC_LIBRARY_NAME
|
||||
endif # LIBRARY
|
||||
|
||||
ifndef HOST_LIBRARY
|
||||
ifdef HOST_LIBRARY_NAME
|
||||
@ -244,9 +244,9 @@ MKSHLIB = $(MKCSHLIB)
|
||||
endif
|
||||
|
||||
ifdef MAKE_FRAMEWORK
|
||||
SHARED_LIBRARY := $(LIBRARY_NAME)
|
||||
SHARED_LIBRARY := $(SHARED_LIBRARY_NAME)
|
||||
else
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
@ -254,7 +254,7 @@ DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
|
||||
endif
|
||||
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
@ -319,8 +319,8 @@ CODFILE=$(basename $(@F)).cod
|
||||
endif
|
||||
|
||||
ifdef MOZ_MAPINFO
|
||||
ifdef LIBRARY_NAME
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
ifdef SHARED_LIBRARY_NAME
|
||||
MAPFILE=$(SHARED_LIBRARY_NAME).map
|
||||
else
|
||||
MAPFILE=$(basename $(@F)).map
|
||||
endif # LIBRARY_NAME
|
||||
@ -333,15 +333,8 @@ endif
|
||||
|
||||
ifdef MAPFILE
|
||||
OS_LDFLAGS += -MAP:$(MAPFILE)
|
||||
#CFLAGS += -Fm$(MAPFILE)
|
||||
#CXXFLAGS += -Fm$(MAPFILE)
|
||||
endif
|
||||
|
||||
#ifdef CODFILE
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#endif
|
||||
|
||||
endif # !GNU_CC
|
||||
|
||||
ifdef ENABLE_CXX_EXCEPTIONS
|
||||
@ -841,13 +834,13 @@ ifdef LIBRARY_NAME
|
||||
ifdef EXPORT_LIBRARY
|
||||
ifdef IS_COMPONENT
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(LIBRARY_NAME)
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
|
||||
ifdef MODULE_NAME
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(LIBRARY_NAME)
|
||||
endif # BUILD_STATIC_LIBS
|
||||
else # !IS_COMPONENT
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
|
||||
endif # IS_COMPONENT
|
||||
endif # EXPORT_LIBRARY
|
||||
endif # LIBRARY_NAME
|
||||
@ -1183,7 +1176,7 @@ endif
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
|
||||
rm -f $@
|
||||
echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo PROTMODE >> $@
|
||||
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
|
||||
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
|
||||
|
@ -304,6 +304,8 @@ gtk/gtkclipboard.h
|
||||
gtk/gtkcontainer.h
|
||||
gtk/gtkdialog.h
|
||||
gtk/gtkentry.h
|
||||
gtk/gtkfilechooser.h
|
||||
gtk/gtkfilechooserdialog.h
|
||||
gtk/gtkfixed.h
|
||||
gtk/gtk.h
|
||||
gtk/gtkiconfactory.h
|
||||
@ -312,6 +314,7 @@ gtk/gtkimmulticontext.h
|
||||
gtk/gtkinvisible.h
|
||||
gtk/gtkmain.h
|
||||
gtk/gtkmessagedialog.h
|
||||
gtk/gtkmisc.h
|
||||
gtk/gtkobject.h
|
||||
gtk/gtkprinter.h
|
||||
gtk/gtkprintjob.h
|
||||
|
45
configure.in
@ -2958,17 +2958,6 @@ dnl NB - later gcc versions require -mmmx for this header to be successfully
|
||||
dnl included (or another option which implies it, such as -march=pentium-mmx)
|
||||
AC_CHECK_HEADERS(mmintrin.h)
|
||||
|
||||
AC_MSG_CHECKING(for ARM SIMD support)
|
||||
AC_TRY_COMPILE([],
|
||||
[asm("uqadd8 r1, r1, r2");],
|
||||
result="yes", result="no")
|
||||
AC_MSG_RESULT("$result")
|
||||
if test "$result" = "yes"; then
|
||||
AC_DEFINE(HAVE_ARM_SIMD)
|
||||
HAVE_ARM_SIMD=1
|
||||
fi
|
||||
AC_SUBST(HAVE_ARM_SIMD)
|
||||
|
||||
dnl Check whether the compiler supports the new-style C++ standard
|
||||
dnl library headers (i.e. <new>) or needs the old "new.h"
|
||||
AC_LANG_CPLUSPLUS
|
||||
@ -3158,6 +3147,17 @@ AC_SUBST(XLDFLAGS)
|
||||
AC_SUBST(XLIBS)
|
||||
AC_SUBST(XT_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(for ARM SIMD support)
|
||||
AC_TRY_COMPILE([],
|
||||
[asm("uqadd8 r1, r1, r2");],
|
||||
result="yes", result="no")
|
||||
AC_MSG_RESULT("$result")
|
||||
if test "$result" = "yes"; then
|
||||
AC_DEFINE(HAVE_ARM_SIMD)
|
||||
HAVE_ARM_SIMD=1
|
||||
fi
|
||||
AC_SUBST(HAVE_ARM_SIMD)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = pthread support
|
||||
dnl = Start by checking whether the system support pthreads
|
||||
@ -4379,7 +4379,6 @@ NECKO_COOKIES=1
|
||||
NECKO_DISK_CACHE=1
|
||||
NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
|
||||
NECKO_SMALL_BUFFERS=
|
||||
JS_STATIC_BUILD=
|
||||
XPC_IDISPATCH_SUPPORT=
|
||||
|
||||
|
||||
@ -4472,7 +4471,6 @@ basic)
|
||||
NECKO_SMALL_BUFFERS=1
|
||||
NS_DISABLE_LOGGING=1
|
||||
NS_PRINTING=
|
||||
JS_STATIC_BUILD=1
|
||||
;;
|
||||
|
||||
minimal)
|
||||
@ -4520,7 +4518,6 @@ minimal)
|
||||
NECKO_SMALL_BUFFERS=1
|
||||
NS_DISABLE_LOGGING=1
|
||||
NS_PRINTING=
|
||||
JS_STATIC_BUILD=1
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -7187,25 +7184,6 @@ else
|
||||
XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Force JS to be a static lib
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(js-static-build,
|
||||
[ --enable-js-static-build Force js to be a static lib],
|
||||
JS_STATIC_BUILD=1,
|
||||
JS_STATIC_BUILD= )
|
||||
|
||||
AC_SUBST(JS_STATIC_BUILD)
|
||||
|
||||
if test -n "$JS_STATIC_BUILD"; then
|
||||
AC_DEFINE(EXPORT_JS_API)
|
||||
|
||||
if test -z "$BUILD_STATIC_LIBS"; then
|
||||
AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
dnl = Standalone module options
|
||||
@ -8334,6 +8312,7 @@ if test -z "$MOZ_NATIVE_NSPR"; then
|
||||
ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
|
||||
ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
|
||||
fi
|
||||
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
|
||||
ac_configure_args="$ac_configure_args --includedir=$dist/include"
|
||||
ac_configure_args="$ac_configure_args --bindir=$dist/bin"
|
||||
ac_configure_args="$ac_configure_args --libdir=$dist/lib"
|
||||
|
@ -300,7 +300,7 @@ GK_ATOM(document, "document")
|
||||
GK_ATOM(DOMAttrModified, "DOMAttrModified")
|
||||
GK_ATOM(DOMCharacterDataModified, "DOMCharacterDataModified")
|
||||
GK_ATOM(DOMNodeInserted, "DOMNodeInserted")
|
||||
GK_ATOM(DOMNodeInsertedIntoDocument, "DOMNodeInsertedInfoDocument")
|
||||
GK_ATOM(DOMNodeInsertedIntoDocument, "DOMNodeInsertedIntoDocument")
|
||||
GK_ATOM(DOMNodeRemoved, "DOMNodeRemoved")
|
||||
GK_ATOM(DOMNodeRemovedFromDocument, "DOMNodeRemovedFromDocument")
|
||||
GK_ATOM(DOMSubtreeModified, "DOMSubtreeModified")
|
||||
|
@ -121,11 +121,11 @@ nsImageLoadingContent::DestroyImageLoadingContent()
|
||||
{
|
||||
// Cancel our requests so they won't hold stale refs to us
|
||||
if (mCurrentRequest) {
|
||||
mCurrentRequest->Cancel(NS_ERROR_FAILURE);
|
||||
mCurrentRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
mCurrentRequest = nsnull;
|
||||
}
|
||||
if (mPendingRequest) {
|
||||
mPendingRequest->Cancel(NS_ERROR_FAILURE);
|
||||
mPendingRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
mPendingRequest = nsnull;
|
||||
}
|
||||
}
|
||||
|
@ -270,6 +270,8 @@ _TEST_FILES = test_bug5141.html \
|
||||
test_bug444322.html \
|
||||
bug444322.txt \
|
||||
bug444322.js \
|
||||
test_bug455629.html \
|
||||
bug455629-helper.svg \
|
||||
$(NULL)
|
||||
|
||||
# Disabled for now. Mochitest isn't reliable enough for these.
|
||||
|
6
content/base/test/bug455629-helper.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="scale(0.5)">
|
||||
<foreignObject id="f" width="100" height="100"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 159 B |
64
content/base/test/test_bug455629.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=455629
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 455629</title>
|
||||
<script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<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=455629">Mozilla Bug 455629</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
/** Test for Bug 455629 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var done = 0;
|
||||
function doTest(name) {
|
||||
var elem = $(name);
|
||||
var doc = elem.getSVGDocument();
|
||||
try {
|
||||
doc.foopy = 42;
|
||||
fail("Able to set cross origin property!");
|
||||
} catch (e) {
|
||||
ok(true, "unable to set non-allAccess property cross origin");
|
||||
}
|
||||
|
||||
if (elem instanceof HTMLObjectElement) {
|
||||
doc = elem.contentDocument;
|
||||
try {
|
||||
doc.foopy = 42;
|
||||
fail("Able to set cross origin property!");
|
||||
} catch (e) {
|
||||
ok(true, "unable to set non-allAccess property cross origin");
|
||||
}
|
||||
}
|
||||
|
||||
if (++done == 2) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<object id="obj"
|
||||
type="image/svg+xml"
|
||||
onload="doTest('obj')"
|
||||
data="http://example.org/tests/content/base/test/bug455629-helper.svg">
|
||||
</object>
|
||||
|
||||
<embed id="emb"
|
||||
type="image/svg+xml"
|
||||
onload="doTest('emb')"
|
||||
src="http://example.org/tests/content/base/test/bug455629-helper.svg">
|
||||
</embed>
|
||||
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -46,6 +46,14 @@ nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(nsPresContext* aPresContext,
|
||||
: nsDOMMouseEvent(aPresContext, aEvent ? aEvent :
|
||||
new nsMouseScrollEvent(PR_FALSE, 0, nsnull))
|
||||
{
|
||||
if (aEvent) {
|
||||
mEventIsInternal = PR_FALSE;
|
||||
} else {
|
||||
mEventIsInternal = PR_TRUE;
|
||||
mEvent->time = PR_Now();
|
||||
mEvent->refPoint.x = mEvent->refPoint.y = 0;
|
||||
}
|
||||
|
||||
if(mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
|
||||
nsMouseScrollEvent* mouseEvent = static_cast<nsMouseScrollEvent*>(mEvent);
|
||||
mDetail = mouseEvent->delta;
|
||||
|
@ -334,7 +334,7 @@ public:
|
||||
nsresult OpenContainer(const nsIParserNode& aNode);
|
||||
nsresult CloseContainer(const nsHTMLTag aTag, PRBool aMalformed);
|
||||
nsresult AddLeaf(const nsIParserNode& aNode);
|
||||
nsresult AddLeaf(nsGenericHTMLElement* aContent);
|
||||
nsresult AddLeaf(nsIContent* aContent);
|
||||
nsresult AddComment(const nsIParserNode& aNode);
|
||||
nsresult End();
|
||||
|
||||
@ -898,6 +898,7 @@ SinkContext::HaveNotifiedForCurrentContent() const
|
||||
nsIContent *
|
||||
SinkContext::Node::Add(nsIContent *child)
|
||||
{
|
||||
NS_ASSERTION(mContent, "No parent to insert/append into!");
|
||||
if (mInsertionPoint != -1) {
|
||||
NS_ASSERTION(mNumFlushed == mContent->GetChildCount(),
|
||||
"Inserting multiple children without flushing.");
|
||||
@ -1153,7 +1154,7 @@ SinkContext::AddLeaf(const nsIParserNode& aNode)
|
||||
}
|
||||
|
||||
nsresult
|
||||
SinkContext::AddLeaf(nsGenericHTMLElement* aContent)
|
||||
SinkContext::AddLeaf(nsIContent* aContent)
|
||||
{
|
||||
NS_ASSERTION(mStackPos > 0, "leaf w/o container");
|
||||
if (mStackPos <= 0) {
|
||||
@ -1470,13 +1471,8 @@ SinkContext::FlushText(PRBool* aDidFlush, PRBool aReleaseLast)
|
||||
mLastTextNodeSize += mTextLength;
|
||||
mTextLength = 0;
|
||||
|
||||
// Add text to its parent
|
||||
NS_ASSERTION(mStackPos > 0, "leaf w/o container");
|
||||
if (mStackPos <= 0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
DidAddContent(mStack[mStackPos - 1].Add(mLastTextNode));
|
||||
rv = AddLeaf(mLastTextNode);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
didFlush = PR_TRUE;
|
||||
}
|
||||
@ -2889,13 +2885,8 @@ nsresult
|
||||
HTMLContentSink::ProcessLINKTag(const nsIParserNode& aNode)
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
nsGenericHTMLElement* parent = nsnull;
|
||||
|
||||
if (mCurrentContext) {
|
||||
parent = mCurrentContext->mStack[mCurrentContext->mStackPos - 1].mContent;
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
// Create content object
|
||||
nsCOMPtr<nsIContent> element;
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
@ -2923,7 +2914,8 @@ HTMLContentSink::ProcessLINKTag(const nsIParserNode& aNode)
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
parent->AppendChildTo(element, PR_FALSE);
|
||||
|
||||
mCurrentContext->AddLeaf(element); // <link>s are leaves
|
||||
|
||||
if (ssle) {
|
||||
ssle->SetEnableUpdates(PR_TRUE);
|
||||
|
12
content/mathml/content/crashtests/462929-1.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
|
||||
var a = document.createElementNS("http://www.w3.org/2000/svg", "foo");
|
||||
var b = document.createElementNS("http://www.w3.org/1998/Math/MathML", "math");
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
1
content/mathml/content/crashtests/crashtests.list
Normal file
@ -0,0 +1 @@
|
||||
load 462929-1.html
|
@ -725,6 +725,21 @@ nsXBLBinding::GenerateAnonymousContent()
|
||||
if (ni->NamespaceID() != kNameSpaceID_XUL ||
|
||||
(localName != nsGkAtoms::observes &&
|
||||
localName != nsGkAtoms::_template)) {
|
||||
// Undo InstallAnonymousContent
|
||||
PRUint32 childCount = mContent->GetChildCount();
|
||||
#ifdef MOZ_XUL
|
||||
nsCOMPtr<nsIXULDocument> xuldoc(do_QueryInterface(doc));
|
||||
#endif
|
||||
for (PRUint32 k = 0; k < childCount; ++k) {
|
||||
nsIContent* child = mContent->GetChildAt(k);
|
||||
child->UnbindFromTree();
|
||||
#ifdef MOZ_XUL
|
||||
if (xuldoc) {
|
||||
xuldoc->RemoveSubtreeFromDocument(child);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Kill all anonymous content.
|
||||
mContent = nsnull;
|
||||
bindingManager->SetContentListFor(mBoundElement, nsnull);
|
||||
|
@ -103,7 +103,7 @@ PRBool
|
||||
nsXBLMouseEventHandler::EventMatched(nsIDOMEvent* aEvent)
|
||||
{
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouse(do_QueryInterface(aEvent));
|
||||
return mProtoHandler->MouseEventMatched(mouse);
|
||||
return mouse && mProtoHandler->MouseEventMatched(mouse);
|
||||
}
|
||||
|
||||
nsXBLKeyEventHandler::nsXBLKeyEventHandler(nsIAtom* aEventType, PRUint8 aPhase,
|
||||
|
@ -191,7 +191,7 @@ private:
|
||||
txOwningExpandedNameMap<txXSLKey> mKeys;
|
||||
|
||||
// Array of all txStripSpaceTests, sorted in acending order
|
||||
nsTPtrArray<txStripSpaceTest> mStripSpaceTests;
|
||||
nsTArray<nsAutoPtr<txStripSpaceTest> > mStripSpaceTests;
|
||||
|
||||
// Default templates
|
||||
nsAutoPtr<txInstruction> mContainerTemplate;
|
||||
|
@ -46,6 +46,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = test_bug319374.xhtml \
|
||||
test_bug440974.html \
|
||||
test_bug427060.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
54
content/xslt/tests/mochitest/test_bug427060.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=427060
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 427060</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/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=427060">Mozilla Bug 427060</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 427060 **/
|
||||
|
||||
var xmldoc, xsltdoc;
|
||||
[ xmldoc, xsltdoc ] = [ new DOMParser().parseFromString(String(xml), "text/xml") for each (xml in [
|
||||
|
||||
<opml version="1.0"><body></body></opml> ,
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/opml">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<base target="_blank"></base>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
]) ];
|
||||
|
||||
var processor = new XSLTProcessor;
|
||||
processor.importStylesheet(xsltdoc);
|
||||
try
|
||||
{
|
||||
var result = processor.transformToDocument(xmldoc);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
}
|
||||
ok(result && result instanceof Document, "XSLT transform should have created a document");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
13
dom/src/base/crashtests/462947.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
|
||||
navigator.mimeTypes.length;
|
||||
navigator.mimeTypes.length;
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
</html>
|
@ -7,4 +7,5 @@ load 359432-1.xhtml
|
||||
load 369413-1.html
|
||||
load 372554-1.html
|
||||
load 404869-1.xul
|
||||
load 462947.html
|
||||
load 439206-1.html
|
||||
|
@ -46,6 +46,7 @@ DIRS += \
|
||||
dom-level0 \
|
||||
dom-level1-core \
|
||||
dom-level2-core \
|
||||
dom-level2-html \
|
||||
ajax \
|
||||
bugs \
|
||||
chrome \
|
||||
@ -54,9 +55,5 @@ DIRS += \
|
||||
geolocation \
|
||||
$(NULL)
|
||||
|
||||
# dom-level2-html disabled due to failures on multiple platforms
|
||||
# (bug 427878)
|
||||
# dom-level2-html \
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
@ -134,6 +134,9 @@ _TEST_FILES_A = \
|
||||
test_HTMLCollection12.html \
|
||||
$(NULL)
|
||||
|
||||
# This test is failing on all platforms -- bug 471139
|
||||
# test_HTMLDocument12.html \
|
||||
#
|
||||
_TEST_FILES_B = \
|
||||
test_HTMLDirectoryElement01.html \
|
||||
test_HTMLDivElement01.html \
|
||||
@ -148,7 +151,6 @@ _TEST_FILES_B = \
|
||||
test_HTMLDocument09.html \
|
||||
test_HTMLDocument10.html \
|
||||
test_HTMLDocument11.html \
|
||||
test_HTMLDocument12.html \
|
||||
test_HTMLDocument13.html \
|
||||
test_HTMLDocument14.html \
|
||||
test_HTMLDocument15.html \
|
||||
|
@ -1,4 +1,6 @@
|
||||
layoutdebug.jar:
|
||||
% content layoutdebug %content/layoutdebug/
|
||||
% locale layoutdebug en-US %locale/en-US/layoutdebug/
|
||||
content/layoutdebug/contents.rdf (content/contents.rdf)
|
||||
content/layoutdebug/layoutdebug.xul (content/layoutdebug.xul)
|
||||
content/layoutdebug/layoutdebug.js (content/layoutdebug.js)
|
||||
|
@ -158,7 +158,8 @@ _compute_transform (cairo_win32_scaled_font_t *scaled_font,
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
if (NEARLY_ZERO (sc->yx) && NEARLY_ZERO (sc->xy)) {
|
||||
if (NEARLY_ZERO (sc->yx) && NEARLY_ZERO (sc->xy) &&
|
||||
!NEARLY_ZERO (sc->xx) && !NEARLY_ZERO (sc->yy)) {
|
||||
scaled_font->preserve_axes = TRUE;
|
||||
scaled_font->x_scale = sc->xx;
|
||||
scaled_font->swap_x = (sc->xx < 0);
|
||||
@ -166,7 +167,8 @@ _compute_transform (cairo_win32_scaled_font_t *scaled_font,
|
||||
scaled_font->swap_y = (sc->yy < 0);
|
||||
scaled_font->swap_axes = FALSE;
|
||||
|
||||
} else if (NEARLY_ZERO (sc->xx) && NEARLY_ZERO (sc->yy)) {
|
||||
} else if (NEARLY_ZERO (sc->xx) && NEARLY_ZERO (sc->yy) &&
|
||||
!NEARLY_ZERO (sc->yx) && !NEARLY_ZERO (sc->xy)) {
|
||||
scaled_font->preserve_axes = TRUE;
|
||||
scaled_font->x_scale = sc->yx;
|
||||
scaled_font->swap_x = (sc->yx < 0);
|
||||
|
@ -240,7 +240,7 @@ nsThebesDeviceContext::SetDPI()
|
||||
dpi = 96;
|
||||
|
||||
#elif defined(MOZ_WIDGET_QT)
|
||||
// TODO: get real DPI here with Qt methods
|
||||
// TODO: get real DPI here with Qt methods
|
||||
dpi = 96;
|
||||
#else
|
||||
#error undefined platform dpi
|
||||
@ -445,8 +445,8 @@ nsThebesDeviceContext::CheckFontExistence(const nsString& aFaceName)
|
||||
NS_IMETHODIMP
|
||||
nsThebesDeviceContext::GetDepth(PRUint32& aDepth)
|
||||
{
|
||||
nsCOMPtr<nsIScreen> primaryScreen;
|
||||
if (mDepth == 0) {
|
||||
nsCOMPtr<nsIScreen> primaryScreen;
|
||||
mScreenManager->GetPrimaryScreen(getter_AddRefs(primaryScreen));
|
||||
primaryScreen->GetColorDepth(reinterpret_cast<PRInt32 *>(&mDepth));
|
||||
}
|
||||
|
@ -1608,7 +1608,7 @@ public:
|
||||
// The value should be lower value of first font's metrics and the bad font's metrics.
|
||||
// Otherwise, this returns from first font's metrics.
|
||||
enum { UNDERLINE_OFFSET_NOT_SET = PR_INT16_MAX };
|
||||
gfxFloat GetUnderlineOffset() {
|
||||
virtual gfxFloat GetUnderlineOffset() {
|
||||
if (mUnderlineOffset == UNDERLINE_OFFSET_NOT_SET)
|
||||
mUnderlineOffset = GetFontAt(0)->GetMetrics().underlineOffset;
|
||||
return mUnderlineOffset;
|
||||
|
@ -333,17 +333,23 @@ public:
|
||||
// for use with Windows T2Embed API AddFontResource type API's
|
||||
// effectively hide existing fonts with matching names aHeaderLen is
|
||||
// the size of the header buffer on input, the actual size of the
|
||||
// EOT header on output aIsCFF returns whether the font has PS style
|
||||
// glyphs or not (as opposed to TrueType glyphs)
|
||||
// EOT header on output
|
||||
static nsresult
|
||||
MakeEOTHeader(const PRUint8 *aFontData, PRUint32 aFontDataLength,
|
||||
nsTArray<PRUint8> *aHeader, PRBool *aIsCFF);
|
||||
nsTArray<PRUint8> *aHeader);
|
||||
#endif
|
||||
|
||||
// checks for valid SFNT table structure, returns true if valid
|
||||
// does *not* guarantee that all font data is valid
|
||||
static PRBool
|
||||
ValidateSFNTHeaders(const PRUint8 *aFontData, PRUint32 aFontDataLength);
|
||||
ValidateSFNTHeaders(const PRUint8 *aFontData, PRUint32 aFontDataLength,
|
||||
PRBool *aIsCFF = nsnull);
|
||||
|
||||
// create a new name table and build a new font with that name table
|
||||
// appended on the end, returns true on success
|
||||
static nsresult
|
||||
RenameFont(const nsAString& aName, const PRUint8 *aFontData,
|
||||
PRUint32 aFontDataLength, nsTArray<PRUint8> *aNewFont);
|
||||
|
||||
static inline bool IsJoiner(PRUint32 ch) {
|
||||
return (ch == 0x200C ||
|
||||
|
@ -370,6 +370,8 @@ public:
|
||||
nsTArray<nsRefPtr<FontEntry> > *list);
|
||||
|
||||
void UpdateFontList();
|
||||
virtual gfxFloat GetUnderlineOffset();
|
||||
|
||||
|
||||
protected:
|
||||
void InitFontList();
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "nsIPrefLocalizedString.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIStreamBufferAccess.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
#define NO_RANGE_FOUND 126 // bit 126 in the font unicode ranges is required to be 0
|
||||
|
||||
@ -477,6 +477,7 @@ void gfxFontUtils::GetPrefsFontList(const char *aPrefName, nsTArray<nsString>& a
|
||||
#pragma pack(1)
|
||||
|
||||
struct AutoSwap_PRUint16 {
|
||||
AutoSwap_PRUint16(PRUint16 aValue) { value = NS_SWAP16(aValue); }
|
||||
operator PRUint16() const { return NS_SWAP16(value); }
|
||||
operator PRUint32() const { return NS_SWAP16(value); }
|
||||
operator PRUint64() const { return NS_SWAP16(value); }
|
||||
@ -484,17 +485,20 @@ struct AutoSwap_PRUint16 {
|
||||
};
|
||||
|
||||
struct AutoSwap_PRInt16 {
|
||||
AutoSwap_PRInt16(PRInt16 aValue) { value = NS_SWAP16(aValue); }
|
||||
operator PRInt16() const { return NS_SWAP16(value); }
|
||||
operator PRUint32() const { return NS_SWAP16(value); }
|
||||
PRInt16 value;
|
||||
};
|
||||
|
||||
struct AutoSwap_PRUint32 {
|
||||
AutoSwap_PRUint32(PRUint32 aValue) { value = NS_SWAP32(aValue); }
|
||||
operator PRUint32() const { return NS_SWAP32(value); }
|
||||
PRUint32 value;
|
||||
};
|
||||
|
||||
struct AutoSwap_PRUint64 {
|
||||
AutoSwap_PRUint64(PRUint64 aValue) { value = NS_SWAP64(aValue); }
|
||||
operator PRUint64() const { return NS_SWAP64(value); }
|
||||
PRUint64 value;
|
||||
};
|
||||
@ -557,8 +561,10 @@ struct NameRecord {
|
||||
enum {
|
||||
NAME_ID_FAMILY = 1,
|
||||
NAME_ID_STYLE = 2,
|
||||
NAME_ID_UNIQUE = 3,
|
||||
NAME_ID_FULL = 4,
|
||||
NAME_ID_VERSION = 5,
|
||||
NAME_ID_POSTSCRIPT = 6,
|
||||
PLATFORM_ID_UNICODE = 0, // Mac OS uses this typically
|
||||
PLATFORM_ID_MICROSOFT = 3,
|
||||
ENCODING_ID_MICROSOFT_UNICODEBMP = 1, // with Microsoft platformID, BMP-only Unicode encoding
|
||||
@ -637,7 +643,9 @@ CopySwapUTF16(const PRUint16 *aInBuf, PRUint16 *aOutBuf, PRUint32 aLen)
|
||||
}
|
||||
|
||||
PRBool
|
||||
gfxFontUtils::ValidateSFNTHeaders(const PRUint8 *aFontData, PRUint32 aFontDataLength)
|
||||
gfxFontUtils::ValidateSFNTHeaders(const PRUint8 *aFontData,
|
||||
PRUint32 aFontDataLength,
|
||||
PRBool *aIsCFF)
|
||||
{
|
||||
NS_ASSERTION(aFontData && aFontDataLength != 0, "null font data");
|
||||
|
||||
@ -655,6 +663,9 @@ gfxFontUtils::ValidateSFNTHeaders(const PRUint8 *aFontData, PRUint32 aFontDataLe
|
||||
NS_WARNING("invalid font (SFNT version)");
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (aIsCFF)
|
||||
*aIsCFF = (sfntVersion == 'OTTO');
|
||||
|
||||
// iterate through the table headers to find the head, name and OS/2 tables
|
||||
PRBool foundHead = PR_FALSE, foundOS2 = PR_FALSE, foundName = PR_FALSE;
|
||||
@ -670,11 +681,13 @@ gfxFontUtils::ValidateSFNTHeaders(const PRUint8 *aFontData, PRUint32 aFontDataLe
|
||||
}
|
||||
|
||||
// table directory entries begin immediately following SFNT header
|
||||
const TableDirEntry *dirEntry = reinterpret_cast<const TableDirEntry*>(aFontData + sizeof(SFNTHeader));
|
||||
const TableDirEntry *dirEntry =
|
||||
reinterpret_cast<const TableDirEntry*>(aFontData + sizeof(SFNTHeader));
|
||||
PRUint32 checksum = 0;
|
||||
|
||||
// checksum for font = (checksum of header) + (checksum of tables)
|
||||
const AutoSwap_PRUint32 *headerData = reinterpret_cast<const AutoSwap_PRUint32*>(aFontData);
|
||||
const AutoSwap_PRUint32 *headerData =
|
||||
reinterpret_cast<const AutoSwap_PRUint32*>(aFontData);
|
||||
|
||||
// header length is in bytes, checksum calculated in longwords
|
||||
for (i = 0; i < (headerLen >> 2); i++, headerData++) {
|
||||
@ -798,6 +811,149 @@ gfxFontUtils::ValidateSFNTHeaders(const PRUint8 *aFontData, PRUint32 aFontDataLe
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
gfxFontUtils::RenameFont(const nsAString& aName, const PRUint8 *aFontData,
|
||||
PRUint32 aFontDataLength, nsTArray<PRUint8> *aNewFont)
|
||||
{
|
||||
NS_ASSERTION(aNewFont, "null font data array");
|
||||
|
||||
PRUint64 dataLength(aFontDataLength);
|
||||
|
||||
// new name table
|
||||
static const PRUint32 neededNameIDs[] = {NameRecord::NAME_ID_FAMILY,
|
||||
NameRecord::NAME_ID_STYLE,
|
||||
NameRecord::NAME_ID_UNIQUE,
|
||||
NameRecord::NAME_ID_FULL,
|
||||
NameRecord::NAME_ID_POSTSCRIPT};
|
||||
|
||||
// calculate new name table size
|
||||
PRUint16 nameCount = NS_ARRAY_LENGTH(neededNameIDs);
|
||||
|
||||
// leave room for null-terminator
|
||||
PRUint16 nameStrLength = (aName.Length() + 1) * sizeof(PRUnichar);
|
||||
|
||||
// round name table size up to 4-byte multiple
|
||||
PRUint32 nameTableSize = (sizeof(NameHeader) +
|
||||
sizeof(NameRecord) * nameCount +
|
||||
nameStrLength +
|
||||
3) & ~3;
|
||||
|
||||
if (dataLength + nameTableSize > PR_UINT32_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRUint32 adjFontDataSize = aFontDataLength + nameTableSize;
|
||||
|
||||
// create new buffer: old font data plus new name table
|
||||
if (!aNewFont->AppendElements(adjFontDataSize))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// copy the old font data
|
||||
PRUint8 *newFontData = reinterpret_cast<PRUint8*>(aNewFont->Elements());
|
||||
|
||||
memcpy(newFontData, aFontData, aFontDataLength);
|
||||
|
||||
// null out the last 4 bytes for checksum calculations
|
||||
memset(newFontData + adjFontDataSize - 4, 0, 4);
|
||||
|
||||
NameHeader *nameHeader = reinterpret_cast<NameHeader*>(newFontData +
|
||||
aFontDataLength);
|
||||
|
||||
// -- name header
|
||||
nameHeader->format = 0;
|
||||
nameHeader->count = nameCount;
|
||||
nameHeader->stringOffset = sizeof(NameHeader) + nameCount * sizeof(NameRecord);
|
||||
|
||||
// -- name records
|
||||
PRUint32 i;
|
||||
NameRecord *nameRecord = reinterpret_cast<NameRecord*>(nameHeader + 1);
|
||||
|
||||
for (i = 0; i < nameCount; i++, nameRecord++) {
|
||||
nameRecord->platformID = NameRecord::PLATFORM_ID_MICROSOFT;
|
||||
nameRecord->encodingID = NameRecord::ENCODING_ID_MICROSOFT_UNICODEBMP;
|
||||
nameRecord->languageID = NameRecord::LANG_ID_MICROSOFT_EN_US;
|
||||
nameRecord->nameID = neededNameIDs[i];
|
||||
nameRecord->offset = 0;
|
||||
nameRecord->length = nameStrLength;
|
||||
}
|
||||
|
||||
// -- string data, located after the name records, stored in big-endian form
|
||||
PRUnichar *strData = reinterpret_cast<PRUnichar*>(nameRecord);
|
||||
|
||||
const PRUnichar *nameStr = aName.BeginReading();
|
||||
const PRUnichar *nameStrEnd = aName.EndReading();
|
||||
while (nameStr < nameStrEnd) {
|
||||
PRUnichar ch = *nameStr++;
|
||||
*strData++ = NS_SWAP16(ch);
|
||||
}
|
||||
*strData = 0; // add null termination
|
||||
|
||||
// adjust name table header to point to the new name table
|
||||
SFNTHeader *sfntHeader = reinterpret_cast<SFNTHeader*>(newFontData);
|
||||
|
||||
// table directory entries begin immediately following SFNT header
|
||||
TableDirEntry *dirEntry =
|
||||
reinterpret_cast<TableDirEntry*>(newFontData + sizeof(SFNTHeader));
|
||||
|
||||
PRUint32 numTables = sfntHeader->numTables;
|
||||
PRBool foundName = PR_FALSE;
|
||||
|
||||
for (i = 0; i < numTables; i++, dirEntry++) {
|
||||
if (dirEntry->tag == 'name') {
|
||||
foundName = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// function only called if font validates, so this should always be true
|
||||
NS_ASSERTION(foundName, "attempt to rename font with no name table");
|
||||
|
||||
// note: dirEntry now points to name record
|
||||
|
||||
// recalculate name table checksum
|
||||
PRUint32 checkSum = 0;
|
||||
AutoSwap_PRUint32 *nameData = reinterpret_cast<AutoSwap_PRUint32*> (nameHeader);
|
||||
AutoSwap_PRUint32 *nameDataEnd = nameData + (nameTableSize >> 2);
|
||||
|
||||
while (nameData < nameDataEnd)
|
||||
checkSum = checkSum + *nameData++;
|
||||
|
||||
// adjust name table entry to point to new name table
|
||||
dirEntry->offset = aFontDataLength;
|
||||
dirEntry->length = nameTableSize;
|
||||
dirEntry->checkSum = checkSum;
|
||||
|
||||
// fix up checksums
|
||||
PRUint32 checksum = 0;
|
||||
|
||||
// checksum for font = (checksum of header) + (checksum of tables)
|
||||
PRUint32 headerLen = sizeof(SFNTHeader) + sizeof(TableDirEntry) * numTables;
|
||||
const AutoSwap_PRUint32 *headerData =
|
||||
reinterpret_cast<const AutoSwap_PRUint32*>(newFontData);
|
||||
|
||||
// header length is in bytes, checksum calculated in longwords
|
||||
for (i = 0; i < (headerLen >> 2); i++, headerData++) {
|
||||
checksum += *headerData;
|
||||
}
|
||||
|
||||
PRUint32 headOffset = 0;
|
||||
dirEntry = reinterpret_cast<TableDirEntry*>(newFontData + sizeof(SFNTHeader));
|
||||
|
||||
for (i = 0; i < numTables; i++, dirEntry++) {
|
||||
if (dirEntry->tag == 'head') {
|
||||
headOffset = dirEntry->offset;
|
||||
}
|
||||
checksum += dirEntry->checkSum;
|
||||
}
|
||||
|
||||
NS_ASSERTION(headOffset != 0, "no head table for font");
|
||||
|
||||
HeadTable *headData = reinterpret_cast<HeadTable*>(newFontData + headOffset);
|
||||
|
||||
headData->checkSumAdjustment = HeadTable::HEAD_CHECKSUM_CALC_CONST - checksum;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Embedded OpenType (EOT) handling
|
||||
// needed for dealing with downloadable fonts on Windows
|
||||
//
|
||||
@ -892,21 +1048,17 @@ DumpEOTHeader(PRUint8 *aHeader, PRUint32 aHeaderLen)
|
||||
|
||||
nsresult
|
||||
gfxFontUtils::MakeEOTHeader(const PRUint8 *aFontData, PRUint32 aFontDataLength,
|
||||
nsTArray<PRUint8> *aHeader, PRBool *aIsCFF)
|
||||
nsTArray<PRUint8> *aHeader)
|
||||
{
|
||||
|
||||
NS_ASSERTION(aFontData && aFontDataLength != 0, "null font data");
|
||||
NS_ASSERTION(aHeader, "null header");
|
||||
NS_ASSERTION(aHeader->Length() == 0, "non-empty header passed in");
|
||||
NS_ASSERTION(aIsCFF, "null boolean ptr");
|
||||
|
||||
// assume TrueType
|
||||
*aIsCFF = PR_FALSE;
|
||||
|
||||
if (!aHeader->AppendElements(sizeof(EOTFixedHeader)))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
EOTFixedHeader *eotHeader = reinterpret_cast<EOTFixedHeader*> (aHeader->Elements());
|
||||
EOTFixedHeader *eotHeader = reinterpret_cast<EOTFixedHeader*>(aHeader->Elements());
|
||||
memset(eotHeader, 0, sizeof(EOTFixedHeader));
|
||||
|
||||
PRUint32 fontDataSize = aFontDataLength;
|
||||
@ -975,7 +1127,6 @@ gfxFontUtils::MakeEOTHeader(const PRUint8 *aFontData, PRUint32 aFontDataLength,
|
||||
|
||||
case 'CFF ': // PS-style cubic glyph table
|
||||
foundGlyphs = PR_TRUE;
|
||||
*aIsCFF = PR_TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -85,7 +85,9 @@ public:
|
||||
|
||||
protected:
|
||||
// for use with data fonts
|
||||
MacOSFontEntry(ATSUFontID aFontID, PRUint16 aWeight, PRUint16 aStretch, PRUint32 aItalicStyle, gfxUserFontData *aUserFontData);
|
||||
MacOSFontEntry(const nsAString& aPostscriptName, ATSUFontID aFontID,
|
||||
PRUint16 aWeight, PRUint16 aStretch, PRUint32 aItalicStyle,
|
||||
gfxUserFontData *aUserFontData);
|
||||
|
||||
PRUint32 mTraits;
|
||||
MacOSFamilyEntry *mFamily;
|
||||
|
@ -2,12 +2,13 @@
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: BSD
|
||||
*
|
||||
* Copyright (C) 2006 Mozilla Corporation. All rights reserved.
|
||||
* Copyright (C) 2006-2008 Mozilla Corporation. All rights reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vladimir Vukicevic <vladimir@pobox.com>
|
||||
* Masayuki Nakano <masayuki@d-toybox.com>
|
||||
* John Daggett <jdaggett@mozilla.com>
|
||||
* Jonathan Kew <jfkthame@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
@ -117,7 +118,7 @@ gfxQuartzFontCache::GenerateFontListKey(const nsAString& aKeyName, nsAString& aR
|
||||
#pragma mark-
|
||||
|
||||
MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
|
||||
PRInt32 aAppleWeight, PRUint32 aTraits, MacOSFamilyEntry *aFamily)
|
||||
PRInt32 aAppleWeight, PRUint32 aTraits, MacOSFamilyEntry *aFamily)
|
||||
: gfxFontEntry(aPostscriptName), mTraits(aTraits), mFamily(aFamily), mATSUFontID(0),
|
||||
mATSUIDInitialized(0)
|
||||
{
|
||||
@ -127,10 +128,12 @@ MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
|
||||
mFixedPitch = (mTraits & NSFixedPitchFontMask ? 1 : 0);
|
||||
}
|
||||
|
||||
MacOSFontEntry::MacOSFontEntry(ATSUFontID aFontID, PRUint16 aWeight, PRUint16 aStretch, PRUint32 aItalicStyle, gfxUserFontData *aUserFontData)
|
||||
MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName, ATSUFontID aFontID,
|
||||
PRUint16 aWeight, PRUint16 aStretch, PRUint32 aItalicStyle,
|
||||
gfxUserFontData *aUserFontData)
|
||||
{
|
||||
// xxx - stretch is basically ignored for now
|
||||
|
||||
|
||||
mATSUIDInitialized = PR_TRUE;
|
||||
mATSUFontID = aFontID;
|
||||
mUserFontData = aUserFontData;
|
||||
@ -143,23 +146,7 @@ MacOSFontEntry::MacOSFontEntry(ATSUFontID aFontID, PRUint16 aWeight, PRUint16 aS
|
||||
(mFixedPitch ? NSFixedPitchFontMask : 0) |
|
||||
(mWeight >= 600 ? NSBoldFontMask : NSUnboldFontMask);
|
||||
|
||||
// get the postscript name
|
||||
OSStatus err;
|
||||
NSString *psname = NULL;
|
||||
|
||||
// now lookup the Postscript name
|
||||
err = ATSFontGetPostScriptName((ATSFontRef) aFontID, kATSOptionFlagsDefault, (CFStringRef*) (&psname));
|
||||
if (err == noErr) {
|
||||
GetStringForNSString(psname, mName);
|
||||
[psname release];
|
||||
} else {
|
||||
mIsValid = PR_FALSE;
|
||||
#ifdef DEBUG
|
||||
char warnBuf[1024];
|
||||
sprintf(warnBuf, "ATSFontGetPostScriptName err = %d", (PRInt32)err);
|
||||
NS_WARNING(warnBuf);
|
||||
#endif
|
||||
}
|
||||
mName = aPostscriptName;
|
||||
}
|
||||
|
||||
const nsString&
|
||||
@ -706,7 +693,7 @@ const PRUint32 kNonNormalTraits = NSItalicFontMask | NSBoldFontMask | NSNarrowFo
|
||||
void
|
||||
gfxQuartzFontCache::InitFontList()
|
||||
{
|
||||
ATSGeneration currentGeneration = ATSGeneration();
|
||||
ATSGeneration currentGeneration = ATSGetGeneration();
|
||||
|
||||
// need to ignore notifications after adding each font
|
||||
if (mATSGeneration == currentGeneration)
|
||||
@ -1338,73 +1325,106 @@ gfxQuartzFontCache::MakePlatformFont(const gfxFontEntry *aProxyEntry,
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
ATSUFontID fontID;
|
||||
ATSFontRef fontRef;
|
||||
ATSFontContainerRef containerRef;
|
||||
|
||||
err = ATSFontActivateFromMemory(const_cast<PRUint8*>(aFontData), aLength,
|
||||
kPrivateATSFontContextPrivate,
|
||||
kATSFontFormatUnspecified,
|
||||
NULL,
|
||||
kATSOptionFlagsDoNotNotify,
|
||||
&containerRef);
|
||||
// we get occasional failures when multiple fonts are activated in quick succession
|
||||
// if the ATS font cache is damaged; to work around this, we can retry the activation
|
||||
const PRUint32 kMaxRetries = 3;
|
||||
PRUint32 retryCount = 0;
|
||||
while (retryCount++ < kMaxRetries) {
|
||||
err = ATSFontActivateFromMemory(const_cast<PRUint8*>(aFontData), aLength,
|
||||
kPrivateATSFontContextPrivate,
|
||||
kATSFontFormatUnspecified,
|
||||
NULL,
|
||||
kATSOptionFlagsDoNotNotify,
|
||||
&containerRef);
|
||||
mATSGeneration = ATSGetGeneration();
|
||||
|
||||
if (err != noErr) {
|
||||
if (err != noErr) {
|
||||
#if DEBUG
|
||||
char warnBuf[1024];
|
||||
const gfxProxyFontEntry *proxyEntry =
|
||||
static_cast<const gfxProxyFontEntry*> (aProxyEntry);
|
||||
sprintf(warnBuf, "downloaded font error, ATSFontActivateFromMemory err: %d for (%s)",
|
||||
PRInt32(err),
|
||||
NS_ConvertUTF16toUTF8(proxyEntry->mFamily->Name()).get());
|
||||
NS_WARNING(warnBuf);
|
||||
char warnBuf[1024];
|
||||
const gfxProxyFontEntry *proxyEntry =
|
||||
static_cast<const gfxProxyFontEntry*> (aProxyEntry);
|
||||
sprintf(warnBuf, "downloaded font error, ATSFontActivateFromMemory err: %d for (%s)",
|
||||
PRInt32(err),
|
||||
NS_ConvertUTF16toUTF8(proxyEntry->mFamily->Name()).get());
|
||||
NS_WARNING(warnBuf);
|
||||
#endif
|
||||
return nsnull;
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
mATSGeneration = ATSGeneration();
|
||||
|
||||
// ignoring containers with multiple fonts, use the first face only for now
|
||||
err = ATSFontFindFromContainer(containerRef, kATSOptionFlagsDefault, 1,
|
||||
(ATSFontRef*)&fontID, NULL);
|
||||
if (err != noErr) {
|
||||
// ignoring containers with multiple fonts, use the first face only for now
|
||||
err = ATSFontFindFromContainer(containerRef, kATSOptionFlagsDefault, 1,
|
||||
&fontRef, NULL);
|
||||
if (err != noErr) {
|
||||
#if DEBUG
|
||||
char warnBuf[1024];
|
||||
const gfxProxyFontEntry *proxyEntry =
|
||||
static_cast<const gfxProxyFontEntry*> (aProxyEntry);
|
||||
sprintf(warnBuf, "downloaded font error, ATSFontFindFromContainer err: %d for (%s)",
|
||||
PRInt32(err),
|
||||
NS_ConvertUTF16toUTF8(proxyEntry->mFamily->Name()).get());
|
||||
NS_WARNING(warnBuf);
|
||||
char warnBuf[1024];
|
||||
const gfxProxyFontEntry *proxyEntry =
|
||||
static_cast<const gfxProxyFontEntry*> (aProxyEntry);
|
||||
sprintf(warnBuf, "downloaded font error, ATSFontFindFromContainer err: %d for (%s)",
|
||||
PRInt32(err),
|
||||
NS_ConvertUTF16toUTF8(proxyEntry->mFamily->Name()).get());
|
||||
NS_WARNING(warnBuf);
|
||||
#endif
|
||||
ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
|
||||
return nsnull;
|
||||
}
|
||||
ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// font entry will own this
|
||||
MacOSUserFontData *userFontData = new MacOSUserFontData(containerRef);
|
||||
|
||||
if (!userFontData) {
|
||||
ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
|
||||
return nsnull;
|
||||
}
|
||||
// now lookup the Postscript name; this may fail if the font cache is bad
|
||||
OSStatus err;
|
||||
NSString *psname = NULL;
|
||||
nsAutoString postscriptName;
|
||||
err = ATSFontGetPostScriptName(fontRef, kATSOptionFlagsDefault, (CFStringRef*) (&psname));
|
||||
if (err == noErr) {
|
||||
GetStringForNSString(psname, postscriptName);
|
||||
[psname release];
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
char warnBuf[1024];
|
||||
const gfxProxyFontEntry *proxyEntry =
|
||||
static_cast<const gfxProxyFontEntry*> (aProxyEntry);
|
||||
sprintf(warnBuf, "ATSFontGetPostScriptName err = %d for (%s), retries = %d", (PRInt32)err,
|
||||
NS_ConvertUTF16toUTF8(proxyEntry->mFamily->Name()).get(), retryCount);
|
||||
NS_WARNING(warnBuf);
|
||||
#endif
|
||||
ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
|
||||
// retry the activation a couple of times if this fails
|
||||
// (may be a transient failure due to ATS font cache issues)
|
||||
continue;
|
||||
}
|
||||
|
||||
PRUint16 w = aProxyEntry->mWeight;
|
||||
NS_ASSERTION(w >= 100 && w <= 900, "bogus font weight value!");
|
||||
// font entry will own this
|
||||
MacOSUserFontData *userFontData = new MacOSUserFontData(containerRef);
|
||||
|
||||
MacOSFontEntry *newFontEntry =
|
||||
new MacOSFontEntry(fontID, w, aProxyEntry->mStretch,
|
||||
(PRUint32(aProxyEntry->mItalic) ?
|
||||
FONT_STYLE_ITALIC :
|
||||
FONT_STYLE_NORMAL),
|
||||
userFontData);
|
||||
if (!userFontData) {
|
||||
ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (!newFontEntry) {
|
||||
delete userFontData;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// if something is funky about this font, delete immediately
|
||||
if (newFontEntry && !newFontEntry->mIsValid) {
|
||||
PRUint16 w = aProxyEntry->mWeight;
|
||||
NS_ASSERTION(w >= 100 && w <= 900, "bogus font weight value!");
|
||||
|
||||
// create the font entry
|
||||
MacOSFontEntry *newFontEntry =
|
||||
new MacOSFontEntry(postscriptName,
|
||||
FMGetFontFromATSFontRef(fontRef),
|
||||
w, aProxyEntry->mStretch,
|
||||
(PRUint32(aProxyEntry->mItalic) ?
|
||||
FONT_STYLE_ITALIC :
|
||||
FONT_STYLE_NORMAL),
|
||||
userFontData);
|
||||
|
||||
if (!newFontEntry) {
|
||||
delete userFontData;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// if we succeeded (which should always be the case), return the new font
|
||||
if (newFontEntry->mIsValid)
|
||||
return newFontEntry;
|
||||
|
||||
// if something is funky about this font, delete immediately
|
||||
#if DEBUG
|
||||
char warnBuf[1024];
|
||||
const gfxProxyFontEntry *proxyEntry =
|
||||
@ -1414,10 +1434,17 @@ gfxQuartzFontCache::MakePlatformFont(const gfxFontEntry *aProxyEntry,
|
||||
NS_WARNING(warnBuf);
|
||||
#endif
|
||||
delete newFontEntry;
|
||||
return nsnull;
|
||||
|
||||
// We don't retry from here; the ATS font cache issue would have caused failure earlier
|
||||
// so if we get here, there's something else bad going on within our font data structures.
|
||||
// Currently, there should be no way to reach here, as fontentry creation cannot fail
|
||||
// except by memory allocation failure.
|
||||
NS_WARNING("invalid font entry for a newly activated font");
|
||||
break;
|
||||
}
|
||||
|
||||
return newFontEntry;
|
||||
// if we get here, the activation failed (even with possible retries); can't use this font
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
||||
|
@ -981,6 +981,17 @@ gfxWindowsFontGroup::InitFontList()
|
||||
mFonts.AppendElements(mFontEntries.Length());
|
||||
}
|
||||
|
||||
// force the underline offset to get recalculated
|
||||
mUnderlineOffset = UNDERLINE_OFFSET_NOT_SET;
|
||||
}
|
||||
|
||||
gfxFloat
|
||||
gfxWindowsFontGroup::GetUnderlineOffset()
|
||||
{
|
||||
if (mUnderlineOffset != UNDERLINE_OFFSET_NOT_SET)
|
||||
return mUnderlineOffset;
|
||||
|
||||
// not yet initialized, need to calculate
|
||||
if (!mStyle.systemFont) {
|
||||
for (PRUint32 i = 0; i < mFontEntries.Length(); ++i) {
|
||||
if (mFontEntries[i]->mIsBadUnderlineFont) {
|
||||
@ -992,6 +1003,10 @@ gfxWindowsFontGroup::InitFontList()
|
||||
}
|
||||
}
|
||||
|
||||
if (mUnderlineOffset == UNDERLINE_OFFSET_NOT_SET)
|
||||
mUnderlineOffset = GetFontAt(0)->GetMetrics().underlineOffset;
|
||||
|
||||
return mUnderlineOffset;
|
||||
}
|
||||
|
||||
static PRBool
|
||||
@ -1351,7 +1366,7 @@ public:
|
||||
mAlternativeString(nsnull), mScriptItem(aItem),
|
||||
mScript(aItem->a.eScript), mGroup(aGroup),
|
||||
mNumGlyphs(0), mMaxGlyphs(ESTIMATE_MAX_GLYPHS(aLength)),
|
||||
mFontSelected(PR_FALSE)
|
||||
mFontSelected(PR_FALSE), mForceGDIPlace(PR_FALSE)
|
||||
{
|
||||
NS_ASSERTION(mMaxGlyphs < 65535, "UniscribeItem is too big, ScriptShape() will fail!");
|
||||
mGlyphs.SetLength(mMaxGlyphs);
|
||||
@ -1404,6 +1419,19 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
// Uniscribe can't do shaping with some fonts, so it sets the
|
||||
// fNoGlyphIndex flag in the SCRIPT_ANALYSIS structure to indicate
|
||||
// this. This occurs with CFF fonts loaded with
|
||||
// AddFontMemResourceEx but it's not clear what the other cases
|
||||
// are, so just log a warning for now.
|
||||
// see http://msdn.microsoft.com/en-us/library/ms776520(VS.85).aspx
|
||||
|
||||
if (sa.fNoGlyphIndex) {
|
||||
mForceGDIPlace = PR_TRUE;
|
||||
NS_WARNING("Uniscribe refuses to shape with given font");
|
||||
return ShapeGDI();
|
||||
}
|
||||
|
||||
if (rv == E_PENDING) {
|
||||
if (shapeDC == mDC) {
|
||||
// we already tried this once, something failed, give up
|
||||
@ -1528,6 +1556,9 @@ public:
|
||||
mOffsets.SetLength(mNumGlyphs);
|
||||
mAdvances.SetLength(mNumGlyphs);
|
||||
|
||||
if (mForceGDIPlace)
|
||||
return PlaceGDI();
|
||||
|
||||
PRBool allCJK = PR_TRUE;
|
||||
|
||||
// Some fonts don't get along with Uniscribe so we'll use GDI to
|
||||
@ -1771,6 +1802,11 @@ private:
|
||||
|
||||
PRPackedBool mFontSelected;
|
||||
|
||||
// when shaping, Uniscribe refuses to shape with some fonts
|
||||
// (e.g. CFF fonts loaded with AddFontMemResourceEx), so need
|
||||
// to force GDI placement
|
||||
PRPackedBool mForceGDIPlace;
|
||||
|
||||
nsTArray<gfxTextRange> mRanges;
|
||||
};
|
||||
|
||||
|
@ -633,21 +633,15 @@ gfxWindowsPlatform::LookupLocalFont(const nsAString& aFontName)
|
||||
return data.mFontEntry;
|
||||
}
|
||||
|
||||
// make a unique font name, limited on Windows to 31 two-byte characters
|
||||
static void MakeUniqueFontName(PRUnichar aName[LF_FACESIZE])
|
||||
static void MakeUniqueFontName(nsAString& aName)
|
||||
{
|
||||
char buf[50];
|
||||
|
||||
static PRUint32 fontCount = 0;
|
||||
++fontCount;
|
||||
|
||||
char buf[LF_FACESIZE];
|
||||
|
||||
sprintf(buf, "mozfont%8.8x%8.8x", ::GetTickCount(), fontCount); // slightly retarded, figure something better later...
|
||||
|
||||
nsCAutoString fontName(buf);
|
||||
|
||||
PRUint32 nameLen = PR_MIN(fontName.Length(), LF_FACESIZE - 1);
|
||||
memcpy(aName, nsPromiseFlatString(NS_ConvertUTF8toUTF16(fontName)).get(), nameLen * 2);
|
||||
aName[nameLen] = 0;
|
||||
aName.AssignASCII(buf);
|
||||
}
|
||||
|
||||
// from t2embapi.h, included in Platform SDK 6.1 but not 6.0
|
||||
@ -705,17 +699,22 @@ static void InitializeFontEmbeddingProcs()
|
||||
|
||||
class WinUserFontData : public gfxUserFontData {
|
||||
public:
|
||||
WinUserFontData(HANDLE aFontRef)
|
||||
: mFontRef(aFontRef)
|
||||
WinUserFontData(HANDLE aFontRef, PRBool aIsCFF)
|
||||
: mFontRef(aFontRef), mIsCFF(aIsCFF)
|
||||
{ }
|
||||
|
||||
virtual ~WinUserFontData()
|
||||
{
|
||||
ULONG pulStatus;
|
||||
TTDeleteEmbeddedFontPtr(mFontRef, 0, &pulStatus);
|
||||
if (mIsCFF) {
|
||||
RemoveFontMemResourceEx(mFontRef);
|
||||
} else {
|
||||
ULONG pulStatus;
|
||||
TTDeleteEmbeddedFontPtr(mFontRef, 0, &pulStatus);
|
||||
}
|
||||
}
|
||||
|
||||
HANDLE mFontRef;
|
||||
PRPackedBool mIsCFF;
|
||||
};
|
||||
|
||||
// used to control stream read by Windows TTLoadEmbeddedFont API
|
||||
@ -791,22 +790,55 @@ gfxWindowsPlatform::MakePlatformFont(const gfxProxyFontEntry *aProxyEntry,
|
||||
if (!TTLoadEmbeddedFontPtr || !TTDeleteEmbeddedFontPtr)
|
||||
return nsnull;
|
||||
|
||||
if (!gfxFontUtils::ValidateSFNTHeaders(aFontData, aLength))
|
||||
PRBool isCFF;
|
||||
if (!gfxFontUtils::ValidateSFNTHeaders(aFontData, aLength, &isCFF))
|
||||
return nsnull;
|
||||
|
||||
// create an eot header
|
||||
nsAutoTArray<PRUint8,2048> eotHeader;
|
||||
PRUint8 *buffer;
|
||||
PRUint32 eotlen;
|
||||
PRUnichar fontName[LF_FACESIZE];
|
||||
PRBool isCFF;
|
||||
|
||||
nsresult rv;
|
||||
HANDLE fontRef;
|
||||
PRInt32 ret;
|
||||
|
||||
{
|
||||
rv = gfxFontUtils::MakeEOTHeader(aFontData, aLength, &eotHeader, &isCFF);
|
||||
nsAutoString uniqueName;
|
||||
MakeUniqueFontName(uniqueName);
|
||||
|
||||
if (isCFF) {
|
||||
// Postscript-style glyphs, swizzle name table, load directly
|
||||
nsTArray<PRUint8> newFontData;
|
||||
|
||||
rv = gfxFontUtils::RenameFont(uniqueName, aFontData, aLength, &newFontData);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return nsnull;
|
||||
|
||||
DWORD numFonts = 0;
|
||||
|
||||
PRUint8 *fontData = reinterpret_cast<PRUint8*> (newFontData.Elements());
|
||||
PRUint32 fontLength = newFontData.Length();
|
||||
NS_ASSERTION(fontData, "null font data after renaming");
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/ms533942(VS.85).aspx
|
||||
// "A font that is added by AddFontMemResourceEx is always private
|
||||
// to the process that made the call and is not enumerable."
|
||||
fontRef = AddFontMemResourceEx(fontData, fontLength,
|
||||
0 /* reserved */, &numFonts);
|
||||
|
||||
if (!fontRef)
|
||||
return nsnull;
|
||||
|
||||
// only load fonts with a single face contained in the data
|
||||
if (fontRef && numFonts != 1) {
|
||||
RemoveFontMemResourceEx(fontRef);
|
||||
return nsnull;
|
||||
}
|
||||
} else {
|
||||
// TrueType-style glyphs, use EOT library
|
||||
nsAutoTArray<PRUint8,2048> eotHeader;
|
||||
PRUint8 *buffer;
|
||||
PRUint32 eotlen;
|
||||
|
||||
PRUint32 nameLen = PR_MIN(uniqueName.Length(), LF_FACESIZE - 1);
|
||||
nsPromiseFlatString fontName(Substring(uniqueName, 0, nameLen));
|
||||
|
||||
rv = gfxFontUtils::MakeEOTHeader(aFontData, aLength, &eotHeader);
|
||||
if (NS_FAILED(rv))
|
||||
return nsnull;
|
||||
|
||||
@ -814,27 +846,32 @@ gfxWindowsPlatform::MakePlatformFont(const gfxProxyFontEntry *aProxyEntry,
|
||||
eotlen = eotHeader.Length();
|
||||
buffer = reinterpret_cast<PRUint8*> (eotHeader.Elements());
|
||||
|
||||
PRInt32 ret;
|
||||
ULONG privStatus, pulStatus;
|
||||
MakeUniqueFontName(fontName);
|
||||
EOTFontStreamReader eotReader(aFontData, aLength, buffer, eotlen);
|
||||
|
||||
ret = TTLoadEmbeddedFontPtr(&fontRef, TTLOAD_PRIVATE, &privStatus,
|
||||
LICENSE_PREVIEWPRINT, &pulStatus,
|
||||
EOTFontStreamReader::ReadEOTStream,
|
||||
&eotReader, fontName, 0, 0);
|
||||
&eotReader, (PRUnichar*)(fontName.get()), 0, 0);
|
||||
if (ret != E_NONE)
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (ret != E_NONE)
|
||||
return nsnull;
|
||||
|
||||
// make a new font entry using the unique name
|
||||
WinUserFontData *winUserFontData = new WinUserFontData(fontRef);
|
||||
WinUserFontData *winUserFontData = new WinUserFontData(fontRef, isCFF);
|
||||
PRUint16 w = (aProxyEntry->mWeight == 0 ? 400 : aProxyEntry->mWeight);
|
||||
|
||||
return FontEntry::CreateFontEntry(nsDependentString(fontName),
|
||||
FontEntry *fe = FontEntry::CreateFontEntry(uniqueName,
|
||||
gfxWindowsFontType(isCFF ? GFX_FONT_TYPE_PS_OPENTYPE : GFX_FONT_TYPE_TRUETYPE) /*type*/,
|
||||
PRUint32(aProxyEntry->mItalic ? FONT_STYLE_ITALIC : FONT_STYLE_NORMAL),
|
||||
w, winUserFontData);
|
||||
|
||||
if (fe && isCFF)
|
||||
fe->mForceGDI = PR_TRUE;
|
||||
|
||||
return fe;
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
@ -56,15 +56,18 @@ ifndef JS_MOZ_INSTALL
|
||||
NSDISTMODE = copy
|
||||
endif
|
||||
|
||||
MODULE = js
|
||||
LIBRARY_NAME = mozjs
|
||||
GRE_MODULE = 1
|
||||
ifdef JS_NATIVE_EDITLINE
|
||||
DIRS += editline
|
||||
endif
|
||||
|
||||
# editline needs to get built before the shell
|
||||
DIRS += shell
|
||||
|
||||
MODULE = js
|
||||
LIBRARY_NAME = mozjs
|
||||
STATIC_LIBRARY_NAME = js_static
|
||||
GRE_MODULE = 1
|
||||
|
||||
PROGRAM = js$(BIN_SUFFIX)
|
||||
# The shell uses some 'HIDDEN' symbols to produce statistics, so we
|
||||
# link directly against the .o files, not against the JS shared
|
||||
# library.
|
||||
PROGOBJS = js.$(OBJ_SUFFIX) $(OBJS)
|
||||
LIBS = $(NSPR_LIBS)
|
||||
|
||||
ifdef GNU_CXX
|
||||
@ -104,10 +107,12 @@ endif
|
||||
# other modules which are always built shared. Failure to do so results in
|
||||
# the js code getting copied into xpinstall and jsd as well as mozilla-bin,
|
||||
# and then the static data cells used for locking no longer work.
|
||||
#
|
||||
# In fact, we now build both a static and a shared library, as the
|
||||
# JS shell would like to link to the static library.
|
||||
|
||||
ifndef JS_STATIC_BUILD
|
||||
FORCE_SHARED_LIB = 1
|
||||
endif
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
ifeq (86,$(findstring 86,$(OS_TEST)))
|
||||
ifeq (64,$(findstring 64,$(OS_TEST)))
|
||||
@ -619,20 +624,22 @@ install:: $(INSTALLED_HEADERS)
|
||||
install:: $(SCRIPTS) $(PROGRAM)
|
||||
$(INSTALL) $(IFLAGS2) $^ $(bindir)
|
||||
|
||||
install:: $(LIBRARY)
|
||||
ifneq (,$(LIBRARY))
|
||||
$(INSTALL) $(IFLAGS1) $(LIBRARY) $(libdir)
|
||||
endif
|
||||
ifneq (,$(IMPORT_LIBRARY))
|
||||
$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(libdir)
|
||||
endif
|
||||
|
||||
# The Mozilla top-level makefiles use install-runtime-libs directly to
|
||||
# place an additional copy of the libraries in the 'dist/bin'
|
||||
# directory.
|
||||
install:: install-runtime-libs
|
||||
install-runtime-libs:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
|
||||
ifneq (,$(LIBRARY))
|
||||
$(INSTALL) $(IFLAGS1) $(LIBRARY) $(libdir)
|
||||
endif
|
||||
ifneq (,$(SHARED_LIBRARY))
|
||||
$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(libdir)
|
||||
endif
|
||||
ifneq (,$(IMPORT_LIBRARY))
|
||||
$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(libdir)
|
||||
endif
|
||||
|
||||
# Extra dependancies and rules for auto-generated headers
|
||||
host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl
|
||||
|
@ -64,7 +64,12 @@ mandir = @mandir@
|
||||
installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
|
||||
sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
|
||||
|
||||
DIST = $(DEPTH)/dist
|
||||
TOP_DIST = @TOP_DIST@
|
||||
ifneq (,$(filter /%,$(TOP_DIST)))
|
||||
DIST = $(TOP_DIST)
|
||||
else
|
||||
DIST = $(DEPTH)/$(TOP_DIST)
|
||||
endif
|
||||
|
||||
MOZ_JS_LIBS = @MOZ_JS_LIBS@
|
||||
|
||||
@ -101,7 +106,6 @@ MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
|
||||
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
|
||||
ENABLE_TESTS = @ENABLE_TESTS@
|
||||
JS_ULTRASPARC_OPTS = @JS_ULTRASPARC_OPTS@
|
||||
JS_STATIC_BUILD = @JS_STATIC_BUILD@
|
||||
|
||||
TAR=@TAR@
|
||||
|
||||
@ -264,6 +268,9 @@ NSPR_LIBS = @NSPR_LIBS@
|
||||
|
||||
USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
|
||||
|
||||
JS_NATIVE_EDITLINE = @JS_NATIVE_EDITLINE@
|
||||
EDITLINE_LIBS = @EDITLINE_LIBS@
|
||||
|
||||
# MKSHLIB_FORCE_ALL is used to force the linker to include all object
|
||||
# files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker
|
||||
# to normal behavior. Makefile's that create shared libraries out of
|
||||
|
@ -73,6 +73,8 @@ CHECK_VARS := \
|
||||
SHORT_LIBNAME \
|
||||
XPI_PKGNAME \
|
||||
INSTALL_EXTENSION_ID \
|
||||
SHARED_LIBRARY_NAME \
|
||||
STATIC_LIBRARY_NAME \
|
||||
$(NULL)
|
||||
|
||||
# checks for internal spaces or trailing spaces in the variable
|
||||
@ -359,6 +361,18 @@ DSO_PIC_CFLAGS=
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef SHARED_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef STATIC_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
STATIC_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
# This comes from configure
|
||||
ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
@ -219,15 +219,15 @@ endif # ENABLE_TESTS
|
||||
#
|
||||
|
||||
ifndef LIBRARY
|
||||
ifdef LIBRARY_NAME
|
||||
ifdef STATIC_LIBRARY_NAME
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
ifdef SHORT_LIBNAME
|
||||
LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
STATIC_LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
endif # STATIC_LIBRARY_NAME
|
||||
endif # LIBRARY
|
||||
|
||||
ifndef HOST_LIBRARY
|
||||
ifdef HOST_LIBRARY_NAME
|
||||
@ -244,9 +244,9 @@ MKSHLIB = $(MKCSHLIB)
|
||||
endif
|
||||
|
||||
ifdef MAKE_FRAMEWORK
|
||||
SHARED_LIBRARY := $(LIBRARY_NAME)
|
||||
SHARED_LIBRARY := $(SHARED_LIBRARY_NAME)
|
||||
else
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
@ -254,7 +254,7 @@ DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
|
||||
endif
|
||||
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
@ -319,8 +319,8 @@ CODFILE=$(basename $(@F)).cod
|
||||
endif
|
||||
|
||||
ifdef MOZ_MAPINFO
|
||||
ifdef LIBRARY_NAME
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
ifdef SHARED_LIBRARY_NAME
|
||||
MAPFILE=$(SHARED_LIBRARY_NAME).map
|
||||
else
|
||||
MAPFILE=$(basename $(@F)).map
|
||||
endif # LIBRARY_NAME
|
||||
@ -333,15 +333,8 @@ endif
|
||||
|
||||
ifdef MAPFILE
|
||||
OS_LDFLAGS += -MAP:$(MAPFILE)
|
||||
#CFLAGS += -Fm$(MAPFILE)
|
||||
#CXXFLAGS += -Fm$(MAPFILE)
|
||||
endif
|
||||
|
||||
#ifdef CODFILE
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#endif
|
||||
|
||||
endif # !GNU_CC
|
||||
|
||||
ifdef ENABLE_CXX_EXCEPTIONS
|
||||
@ -841,13 +834,13 @@ ifdef LIBRARY_NAME
|
||||
ifdef EXPORT_LIBRARY
|
||||
ifdef IS_COMPONENT
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(LIBRARY_NAME)
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
|
||||
ifdef MODULE_NAME
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(LIBRARY_NAME)
|
||||
endif # BUILD_STATIC_LIBS
|
||||
else # !IS_COMPONENT
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
|
||||
endif # IS_COMPONENT
|
||||
endif # EXPORT_LIBRARY
|
||||
endif # LIBRARY_NAME
|
||||
@ -1183,7 +1176,7 @@ endif
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
|
||||
rm -f $@
|
||||
echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo PROTMODE >> $@
|
||||
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
|
||||
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
|
||||
|
@ -304,6 +304,8 @@ gtk/gtkclipboard.h
|
||||
gtk/gtkcontainer.h
|
||||
gtk/gtkdialog.h
|
||||
gtk/gtkentry.h
|
||||
gtk/gtkfilechooser.h
|
||||
gtk/gtkfilechooserdialog.h
|
||||
gtk/gtkfixed.h
|
||||
gtk/gtk.h
|
||||
gtk/gtkiconfactory.h
|
||||
@ -312,6 +314,7 @@ gtk/gtkimmulticontext.h
|
||||
gtk/gtkinvisible.h
|
||||
gtk/gtkmain.h
|
||||
gtk/gtkmessagedialog.h
|
||||
gtk/gtkmisc.h
|
||||
gtk/gtkobject.h
|
||||
gtk/gtkprinter.h
|
||||
gtk/gtkprintjob.h
|
||||
|
@ -160,6 +160,17 @@ then
|
||||
fi
|
||||
MOZ_BUILD_ROOT=`pwd`
|
||||
|
||||
dnl Choose where to put the 'dist' directory.
|
||||
dnl ==============================================================
|
||||
|
||||
MOZ_ARG_WITH_STRING(dist-dir,
|
||||
[ --with-dist-dir=DIR Use DIR as 'dist' staging area. DIR may be
|
||||
relative to the top of SpiderMonkey build tree,
|
||||
or absolute.],
|
||||
TOP_DIST=$withval,
|
||||
TOP_DIST=dist)
|
||||
AC_SUBST(TOP_DIST)
|
||||
|
||||
dnl Default to MSVC for win32
|
||||
dnl ==============================================================
|
||||
if test -z "$CROSS_COMPILE"; then
|
||||
@ -2784,17 +2795,6 @@ dnl NB - later gcc versions require -mmmx for this header to be successfully
|
||||
dnl included (or another option which implies it, such as -march=pentium-mmx)
|
||||
AC_CHECK_HEADERS(mmintrin.h)
|
||||
|
||||
AC_MSG_CHECKING(for ARM SIMD support)
|
||||
AC_TRY_COMPILE([],
|
||||
[asm("uqadd8 r1, r1, r2");],
|
||||
result="yes", result="no")
|
||||
AC_MSG_RESULT("$result")
|
||||
if test "$result" = "yes"; then
|
||||
AC_DEFINE(HAVE_ARM_SIMD)
|
||||
HAVE_ARM_SIMD=1
|
||||
fi
|
||||
AC_SUBST(HAVE_ARM_SIMD)
|
||||
|
||||
dnl Check whether the compiler supports the new-style C++ standard
|
||||
dnl library headers (i.e. <new>) or needs the old "new.h"
|
||||
AC_LANG_CPLUSPLUS
|
||||
@ -2880,6 +2880,17 @@ if test "$MOZ_ARM_VFP"; then
|
||||
AC_DEFINE(NJ_ARM_VFP)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for ARM SIMD support)
|
||||
AC_TRY_COMPILE([],
|
||||
[asm("uqadd8 r1, r1, r2");],
|
||||
result="yes", result="no")
|
||||
AC_MSG_RESULT("$result")
|
||||
if test "$result" = "yes"; then
|
||||
AC_DEFINE(HAVE_ARM_SIMD)
|
||||
HAVE_ARM_SIMD=1
|
||||
fi
|
||||
AC_SUBST(HAVE_ARM_SIMD)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = pthread support
|
||||
dnl = Start by checking whether the system support pthreads
|
||||
@ -3797,7 +3808,6 @@ MOZ_ARG_HEADER(Application)
|
||||
BUILD_STATIC_LIBS=
|
||||
ENABLE_TESTS=1
|
||||
MOZ_DBGRINFO_MODULES=
|
||||
JS_STATIC_BUILD=
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
@ -4735,23 +4745,33 @@ MOZ_ARG_ENABLE_BOOL(static,
|
||||
BUILD_STATIC_LIBS=)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Force JS to be a static lib
|
||||
dnl = Link js shell to system readline
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(js-static-build,
|
||||
[ --enable-js-static-build Force js to be a static lib],
|
||||
JS_STATIC_BUILD=1,
|
||||
JS_STATIC_BUILD= )
|
||||
MOZ_ARG_ENABLE_BOOL(readline,
|
||||
[ --enable-readline Link js shell to system readline library],
|
||||
JS_WANT_READLINE=1,
|
||||
JS_WANT_READLINE= )
|
||||
|
||||
AC_SUBST(JS_STATIC_BUILD)
|
||||
|
||||
if test -n "$JS_STATIC_BUILD"; then
|
||||
AC_DEFINE(EXPORT_JS_API)
|
||||
|
||||
if test -z "$BUILD_STATIC_LIBS"; then
|
||||
AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
|
||||
fi
|
||||
JS_NATIVE_EDITLINE=
|
||||
EDITLINE_LIBS=
|
||||
|
||||
dnl Conveniently, Win32 sets SKIP_LIBRARY_CHECKS...
|
||||
if test -z "$SKIP_LIBRARY_CHECKS"; then
|
||||
if test -n "$JS_WANT_READLINE"; then
|
||||
AC_CHECK_LIB(readline, readline,
|
||||
EDITLINE_LIBS="-lreadline",
|
||||
AC_MSG_ERROR([No system readline library found.]))
|
||||
else
|
||||
dnl By default, we use editline
|
||||
JS_NATIVE_EDITLINE=1
|
||||
EDITLINE_LIBS='$(DEPTH)/editline/$(LIB_PREFIX)editline.$(LIB_SUFFIX)'
|
||||
fi
|
||||
|
||||
dnl Either way, we want to build with line editing support.
|
||||
AC_DEFINE(EDITLINE)
|
||||
fi
|
||||
AC_SUBST(JS_NATIVE_EDITLINE)
|
||||
AC_SUBST(EDITLINE_LIBS)
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
@ -5136,11 +5156,18 @@ mv confdefs.h.save confdefs.h
|
||||
|
||||
MAKEFILES="
|
||||
Makefile
|
||||
shell/Makefile
|
||||
config/Makefile
|
||||
config/autoconf.mk
|
||||
config/mkdepend/Makefile
|
||||
"
|
||||
|
||||
if test -n "$JS_NATIVE_EDITLINE"; then
|
||||
MAKEFILES="$MAKEFILES
|
||||
editline/Makefile
|
||||
"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Run a perl script to quickly create the makefiles.
|
||||
dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
|
||||
|
55
js/src/editline/Makefile.in
Normal file
@ -0,0 +1,55 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Spidermonkey build system.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# The Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2008
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ted Mielczarek <ted.mielczarek@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
LIBRARY_NAME = editline
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
CSRCS = editline.c sysunix.c
|
||||
|
||||
DEFINES += -DANSI_ARROWS -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX \
|
||||
-DHAVE_STDLIB -DUNIQUE_HISTORY
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -1266,7 +1266,7 @@ obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
}
|
||||
if (obj != callerScopeChain) {
|
||||
ok = js_CheckPrincipalsAccess(cx, obj,
|
||||
caller->script->principals,
|
||||
JS_StackFramePrincipals(cx, caller),
|
||||
cx->runtime->atomState.evalAtom);
|
||||
if (!ok)
|
||||
goto out;
|
||||
|
60
js/src/shell/Makefile.in
Normal file
@ -0,0 +1,60 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Spidermonkey build system.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# The Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2008
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ted Mielczarek <ted.mielczarek@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
PROGRAM = js$(BIN_SUFFIX)
|
||||
CPPSRCS = js.cpp
|
||||
|
||||
DEFINES += -DEXPORT_JS_API
|
||||
|
||||
LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX)
|
||||
|
||||
LOCAL_INCLUDES += -I$(topsrcdir) -I..
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# People expect the js shell to wind up in the top-level JS dir.
|
||||
libs::
|
||||
$(INSTALL) $(IFLAGS2) $(PROGRAM) $(DEPTH)
|
@ -1444,10 +1444,10 @@ return_tearoff:
|
||||
|
||||
if(XPCNativeWrapper::IsNativeWrapperClass(clazz))
|
||||
{
|
||||
if(pobj2)
|
||||
*pobj2 = cur;
|
||||
|
||||
return XPCNativeWrapper::GetWrappedNative(cur);
|
||||
unsafeObj =
|
||||
XPCNativeWrapper::GetWrappedNative(cur)->GetFlatJSObject();
|
||||
return GetWrappedNativeOfJSObject(cx, unsafeObj, funobj, pobj2,
|
||||
pTearOff);
|
||||
}
|
||||
|
||||
if(IsXPCSafeJSObjectWrapperClass(clazz) &&
|
||||
|
@ -10143,6 +10143,7 @@ nsCSSFrameConstructor::EndUpdate()
|
||||
RecalcQuotesAndCounters();
|
||||
NS_ASSERTION(mUpdateCount == 1, "Odd update count");
|
||||
}
|
||||
--mUpdateCount;
|
||||
if (mFocusSuppressCount) {
|
||||
NS_UnsuppressFocusEvent();
|
||||
--mFocusSuppressCount;
|
||||
|
@ -85,7 +85,10 @@ class nsCSSFrameConstructor
|
||||
{
|
||||
public:
|
||||
nsCSSFrameConstructor(nsIDocument *aDocument, nsIPresShell* aPresShell);
|
||||
~nsCSSFrameConstructor(void) { }
|
||||
~nsCSSFrameConstructor(void) {
|
||||
NS_ASSERTION(mUpdateCount == 0, "Dying in the middle of our own update?");
|
||||
NS_ASSERTION(mFocusSuppressCount == 0, "Focus suppression will be wrong");
|
||||
}
|
||||
|
||||
// Maintain global objects - gXBLService
|
||||
static nsIXBLService * GetXBLService();
|
||||
|
@ -1320,7 +1320,7 @@ DocumentViewerImpl::Close(nsISHEntry *aSHEntry)
|
||||
// out of band cleanup of webshell
|
||||
mDocument->SetScriptGlobalObject(nsnull);
|
||||
|
||||
if (!mSHEntry)
|
||||
if (!mSHEntry && mDocument)
|
||||
mDocument->RemovedFromDocShell();
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ nsImageLoader::~nsImageLoader()
|
||||
mPresContext = nsnull;
|
||||
|
||||
if (mRequest) {
|
||||
mRequest->Cancel(NS_ERROR_FAILURE);
|
||||
mRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ nsImageLoader::Destroy()
|
||||
mPresContext = nsnull;
|
||||
|
||||
if (mRequest) {
|
||||
mRequest->Cancel(NS_ERROR_FAILURE);
|
||||
mRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
mRequest = nsnull;
|
||||
@ -122,7 +122,7 @@ nsImageLoader::Load(imgIRequest *aImage)
|
||||
}
|
||||
|
||||
// Now cancel the old request so it won't hold a stale ref to us.
|
||||
mRequest->Cancel(NS_ERROR_FAILURE);
|
||||
mRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
mRequest = nsnull;
|
||||
}
|
||||
|
||||
|
@ -762,7 +762,6 @@ struct nsCallbackEventRequest
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
class nsPresShellEventCB;
|
||||
class nsAutoCauseReflowNotifier;
|
||||
|
||||
class PresShell : public nsIPresShell, public nsIViewObserver,
|
||||
public nsStubDocumentObserver,
|
||||
@ -1013,13 +1012,6 @@ protected:
|
||||
|
||||
void UnsuppressAndInvalidate();
|
||||
|
||||
void WillCauseReflow() {
|
||||
nsContentUtils::AddScriptBlocker();
|
||||
++mChangeNestCount;
|
||||
}
|
||||
nsresult DidCauseReflow();
|
||||
friend class nsAutoCauseReflowNotifier;
|
||||
|
||||
void WillDoReflow();
|
||||
void DidDoReflow();
|
||||
nsresult ProcessReflowCommands(PRBool aInterruptible);
|
||||
@ -1133,11 +1125,6 @@ protected:
|
||||
|
||||
PRPackedBool mIgnoreFrameDestruction;
|
||||
PRPackedBool mHaveShutDown;
|
||||
|
||||
// This is used to protect ourselves from triggering reflow while in the
|
||||
// middle of frame construction and the like... it really shouldn't be
|
||||
// needed, one hopes, but it is for now.
|
||||
PRUint32 mChangeNestCount;
|
||||
|
||||
nsIFrame* mCurrentEventFrame;
|
||||
nsCOMPtr<nsIContent> mCurrentEventContent;
|
||||
@ -1216,29 +1203,6 @@ private:
|
||||
nsPluginEnumCallback aCallback);
|
||||
};
|
||||
|
||||
class nsAutoCauseReflowNotifier
|
||||
{
|
||||
public:
|
||||
nsAutoCauseReflowNotifier(PresShell* aShell)
|
||||
: mShell(aShell)
|
||||
{
|
||||
mShell->WillCauseReflow();
|
||||
}
|
||||
~nsAutoCauseReflowNotifier()
|
||||
{
|
||||
// This check should not be needed. Currently the only place that seem
|
||||
// to need it is the code that deals with bug 337586.
|
||||
if (!mShell->mHaveShutDown) {
|
||||
mShell->DidCauseReflow();
|
||||
}
|
||||
else {
|
||||
nsContentUtils::RemoveScriptBlocker();
|
||||
}
|
||||
}
|
||||
|
||||
PresShell* mShell;
|
||||
};
|
||||
|
||||
class NS_STACK_CLASS nsPresShellEventCB : public nsDispatchingCallback
|
||||
{
|
||||
public:
|
||||
@ -2408,7 +2372,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
|
||||
MOZ_TIMER_START(mFrameCreationWatch);
|
||||
|
||||
{
|
||||
nsAutoCauseReflowNotifier reflowNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mFrameConstructor->BeginUpdate();
|
||||
|
||||
if (!rootFrame) {
|
||||
@ -2554,7 +2518,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
// the way don't have region accumulation issues?
|
||||
|
||||
{
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
WillDoReflow();
|
||||
|
||||
// Kick off a top-down reflow
|
||||
@ -3089,7 +3053,6 @@ PresShell::RestoreRootScrollPosition()
|
||||
// scrollable frame will cause it to reenter ScrollToRestoredPosition(), and
|
||||
// it'll get all confused.
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
++mChangeNestCount;
|
||||
|
||||
if (historyState) {
|
||||
nsIFrame* scrollFrame = GetRootScrollFrame();
|
||||
@ -3103,8 +3066,6 @@ PresShell::RestoreRootScrollPosition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--mChangeNestCount;
|
||||
}
|
||||
|
||||
void
|
||||
@ -3384,10 +3345,7 @@ PresShell::RecreateFramesFor(nsIContent* aContent)
|
||||
nsStyleChangeList changeList;
|
||||
changeList.AppendChange(nsnull, aContent, nsChangeHint_ReconstructFrame);
|
||||
|
||||
// Mark ourselves as not safe to flush while we're doing frame construction.
|
||||
++mChangeNestCount;
|
||||
nsresult rv = mFrameConstructor->ProcessRestyledFrames(changeList);
|
||||
--mChangeNestCount;
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
#ifdef ACCESSIBILITY
|
||||
@ -4487,29 +4445,21 @@ PresShell::HandlePostedReflowCallbacks()
|
||||
NS_IMETHODIMP
|
||||
PresShell::IsSafeToFlush(PRBool& aIsSafeToFlush)
|
||||
{
|
||||
// XXX technically we don't need to check anything but
|
||||
// nsContentUtils::IsSafeToRunScript here since that should be false
|
||||
// if any of the other flags are set.
|
||||
|
||||
aIsSafeToFlush = nsContentUtils::IsSafeToRunScript();
|
||||
#ifdef DEBUG
|
||||
// Not safe if we are reflowing or in the middle of frame construction
|
||||
aIsSafeToFlush = !mIsReflowing &&
|
||||
!mChangeNestCount;
|
||||
|
||||
if (aIsSafeToFlush) {
|
||||
// Not safe if we are painting
|
||||
nsIViewManager* viewManager = GetViewManager();
|
||||
if (viewManager) {
|
||||
PRBool isPainting = PR_FALSE;
|
||||
viewManager->IsPainting(isPainting);
|
||||
if (isPainting) {
|
||||
aIsSafeToFlush = PR_FALSE;
|
||||
}
|
||||
PRBool isSafeToFlush = !mIsReflowing;
|
||||
// Not safe if we are painting
|
||||
nsIViewManager* viewManager = GetViewManager();
|
||||
if (viewManager) {
|
||||
PRBool isPainting = PR_FALSE;
|
||||
viewManager->IsPainting(isPainting);
|
||||
if (isPainting) {
|
||||
isSafeToFlush = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(aIsSafeToFlush == nsContentUtils::IsSafeToRunScript(),
|
||||
"Someone forgot to block scripts");
|
||||
|
||||
NS_ASSERTION(!aIsSafeToFlush || isSafeToFlush, "Missing a script blocker!");
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -4622,7 +4572,7 @@ PresShell::CharacterDataChanged(nsIDocument *aDocument,
|
||||
NS_PRECONDITION(!mIsDocumentGone, "Unexpected CharacterDataChanged");
|
||||
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
|
||||
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
if (mCaret) {
|
||||
// Invalidate the caret's current location before we call into the frame
|
||||
@ -4664,7 +4614,7 @@ PresShell::ContentStatesChanged(nsIDocument* aDocument,
|
||||
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
|
||||
|
||||
if (mDidInitialReflow) {
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mFrameConstructor->ContentStatesChanged(aContent1, aContent2, aStateMask);
|
||||
VERIFY_STYLE_TREE;
|
||||
}
|
||||
@ -4686,7 +4636,7 @@ PresShell::AttributeChanged(nsIDocument* aDocument,
|
||||
// initial reflow to begin observing the document. That would
|
||||
// squelch any other inappropriate notifications as well.
|
||||
if (mDidInitialReflow) {
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mFrameConstructor->AttributeChanged(aContent, aNameSpaceID,
|
||||
aAttribute, aModType, aStateMask);
|
||||
VERIFY_STYLE_TREE;
|
||||
@ -4706,7 +4656,7 @@ PresShell::ContentAppended(nsIDocument *aDocument,
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
MOZ_TIMER_DEBUGLOG(("Start: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
|
||||
MOZ_TIMER_START(mFrameCreationWatch);
|
||||
|
||||
@ -4735,7 +4685,7 @@ PresShell::ContentInserted(nsIDocument* aDocument,
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
// Call this here so it only happens for real content mutations and
|
||||
// not cases when the frame constructor calls its own methods to force
|
||||
@ -4766,7 +4716,7 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
|
||||
// it can clean up any state related to the content.
|
||||
mPresContext->EventStateManager()->ContentRemoved(aChild);
|
||||
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
// Call this here so it only happens for real content mutations and
|
||||
// not cases when the frame constructor calls its own methods to force
|
||||
@ -4784,7 +4734,7 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
|
||||
nsresult
|
||||
PresShell::ReconstructFrames(void)
|
||||
{
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mFrameConstructor->BeginUpdate();
|
||||
nsresult rv = mFrameConstructor->ReconstructDocElementHierarchy();
|
||||
VERIFY_STYLE_TREE;
|
||||
@ -5591,7 +5541,7 @@ PresShell::HandleEvent(nsIView *aView,
|
||||
{
|
||||
NS_ASSERTION(aView, "null view");
|
||||
|
||||
if (mIsDestroying || mIsReflowing || mChangeNestCount) {
|
||||
if (mIsDestroying || !nsContentUtils::IsSafeToRunScript()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5603,9 +5553,6 @@ PresShell::HandleEvent(nsIView *aView,
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_ASSERTION(nsContentUtils::IsSafeToRunScript(),
|
||||
"How did we get here if it's not safe to run scripts?");
|
||||
|
||||
// Check for a theme change up front, since the frame type is irrelevant
|
||||
if (aEvent->message == NS_THEMECHANGED && mPresContext) {
|
||||
mPresContext->ThemeChanged();
|
||||
@ -6049,10 +5996,9 @@ PresShell::IsVisible()
|
||||
NS_IMETHODIMP_(void)
|
||||
PresShell::WillPaint()
|
||||
{
|
||||
// Don't reenter reflow and don't reflow during frame construction. Also
|
||||
// don't bother reflowing if some viewmanager in our tree is painting while
|
||||
// Don't bother reflowing if some viewmanager in our tree is painting while
|
||||
// we still have painting suppressed.
|
||||
if (mIsReflowing || mChangeNestCount || mPaintingSuppressed) {
|
||||
if (mPaintingSuppressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6264,25 +6210,6 @@ PresShell::PostReflowEvent()
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::DidCauseReflow()
|
||||
{
|
||||
NS_ASSERTION(mChangeNestCount != 0, "Unexpected call to DidCauseReflow()");
|
||||
if (--mChangeNestCount == 0) {
|
||||
// We may have had more reflow commands appended to the queue during
|
||||
// our reflow. Make sure these get processed at some point.
|
||||
|
||||
// XXXbz why is this really needed? ProcessReflowCommands handles posting
|
||||
// reflow events if there are reflow roots remaining, and FrameNeedsReflow
|
||||
// posts events as needed as well. I think we should remove this.
|
||||
PostReflowEvent();
|
||||
}
|
||||
|
||||
nsContentUtils::RemoveScriptBlocker();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::WillDoReflow()
|
||||
{
|
||||
@ -6632,9 +6559,7 @@ PresShell::Observe(nsISupports* aSubject,
|
||||
// construction.
|
||||
{
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
++mChangeNestCount;
|
||||
mFrameConstructor->ProcessRestyledFrames(changeList);
|
||||
--mChangeNestCount;
|
||||
}
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
@ -7214,9 +7139,10 @@ PresShell::VerifyIncrementalReflow()
|
||||
// Note that after we create the shell, we must make sure to destroy it
|
||||
sh->SetVerifyReflowEnable(PR_FALSE); // turn off verify reflow while we're reflowing the test frame tree
|
||||
vm->SetViewObserver((nsIViewObserver *)((PresShell*)sh.get()));
|
||||
WillCauseReflow();
|
||||
sh->InitialReflow(r.width, r.height);
|
||||
DidCauseReflow();
|
||||
{
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
sh->InitialReflow(r.width, r.height);
|
||||
}
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
sh->FlushPendingNotifications(Flush_Layout);
|
||||
sh->SetVerifyReflowEnable(PR_TRUE); // turn on verify reflow again now that we're done reflowing the test frame tree
|
||||
|
@ -22,10 +22,15 @@ SimpleTest.waitForExplicitFinish();
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var win = window.openDialog("data:text/html,<div style='height:200px; width:100px;'>");
|
||||
|
||||
// doesn't succeed on SeaMonkey currently, see bug 469331
|
||||
// mark it todo there instead
|
||||
var testfunc_h = (navigator.userAgent.match(/ SeaMonkey\//)) ? todo : ok;
|
||||
var testfunc_w = (navigator.userAgent.match(/Windows/)) ? ok : testfunc_h;
|
||||
|
||||
function loaded() {
|
||||
win.sizeToContent();
|
||||
ok(win.innerWidth >= 100, "innerWidth");
|
||||
ok(win.innerHeight >= 200, "innerHeight");
|
||||
testfunc_w(win.innerWidth >= 100, "innerWidth");
|
||||
testfunc_h(win.innerHeight >= 200, "innerHeight");
|
||||
win.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
20
layout/generic/crashtests/435529.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
|
||||
div {
|
||||
-moz-column-count: 2;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
div:first-letter {
|
||||
float: right;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body><div> <span>AB</span></div></body>
|
||||
|
||||
</html>
|
10
layout/generic/crashtests/436823.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="-moz-column-count: -1;"><div style="float: left;"><div><div style="float: left;">A B</div><div style="clear: both; height: 1px;"></div></div></div></div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -154,6 +154,8 @@ load 426272-1.html
|
||||
load 428263-1.html
|
||||
load 429981-1.html
|
||||
load 430352-1.html
|
||||
load 435529.html
|
||||
load 436823.html
|
||||
load 437156-1.html
|
||||
load 438259-1.html
|
||||
load 438509-1.html
|
||||
|
@ -99,6 +99,7 @@
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIPercentHeightObserver.h"
|
||||
#include "nsStyleStructInlines.h"
|
||||
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiPresUtils.h"
|
||||
@ -553,6 +554,16 @@ nsFrame::GetOffsets(PRInt32 &aStart, PRInt32 &aEnd) const
|
||||
/* virtual */ void
|
||||
nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
{
|
||||
// We have to start loading the border image before or during reflow,
|
||||
// because the border-image's width overrides only apply once the
|
||||
// image is loaded. Starting the load of the image means we'll get a
|
||||
// reflow when the image loads. (Otherwise, if the image loads
|
||||
// between reflow and paint, we never get the notification and our
|
||||
// size ends up wrong.)
|
||||
imgIRequest *borderImage = GetStyleBorder()->GetBorderImage();
|
||||
if (borderImage) {
|
||||
PresContext()->LoadBorderImage(borderImage, this);
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ nsMargin
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include "nsIPercentHeightObserver.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsStyleStructInlines.h"
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiUtils.h"
|
||||
#endif
|
||||
@ -287,17 +286,6 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
|
||||
|
||||
InitResizeFlags(aPresContext);
|
||||
|
||||
// We have to start loading the border image now, because the
|
||||
// border-image's width overrides only apply once the image is loaded.
|
||||
// Starting the load of the image means we'll get a reflow when the
|
||||
// image loads. (If we didn't do it now, and the image loaded between
|
||||
// reflow and paint, we'd never get the notification, and our size
|
||||
// would be wrong.)
|
||||
imgIRequest *borderImage = mStyleBorder->GetBorderImage();
|
||||
if (borderImage) {
|
||||
aPresContext->LoadBorderImage(borderImage, frame);
|
||||
}
|
||||
|
||||
NS_ASSERTION((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&
|
||||
!frame->IsFrameOfType(nsIFrame::eReplaced)) ||
|
||||
frame->GetType() == nsGkAtoms::textFrame ||
|
||||
|
@ -307,11 +307,11 @@ private:
|
||||
{
|
||||
// in case the pref service releases us later
|
||||
if (mLoadingImage) {
|
||||
mLoadingImage->Cancel(NS_ERROR_FAILURE);
|
||||
mLoadingImage->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
mLoadingImage = nsnull;
|
||||
}
|
||||
if (mBrokenImage) {
|
||||
mBrokenImage->Cancel(NS_ERROR_FAILURE);
|
||||
mBrokenImage->CancelAndForgetObserver(NS_ERROR_FAILURE);
|
||||
mBrokenImage = nsnull;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 87 B After Width: | Height: | Size: 73 B |
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 82 B |
3
layout/reftests/bugs/213834-1-ref.html
Normal file
@ -0,0 +1,3 @@
|
||||
<title>Bug 213834 reftest - reference</title>
|
||||
<pre>
|
||||
text text</pre>
|
3
layout/reftests/bugs/213834-1.html
Normal file
@ -0,0 +1,3 @@
|
||||
<title>Bug 213834 reftest - test</title>
|
||||
<pre>
|
||||
text<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQI12P4DwABAQEAG7buVgAAAABJRU5ErkJggg==" height="4px" width="10px"> text</pre>
|
10
layout/reftests/bugs/468473-1-ref.xul
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<window title="Missing repaint when using -moz-border-image on a XUL button"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<hbox>
|
||||
<button label="Button" style="min-width: 0; -moz-appearance: none; border: medium solid; padding: 0; margin: 0; visibility:hidden; border-width: 0 8px;"/>
|
||||
<box flex="1" style="background: green" />
|
||||
</hbox>
|
||||
|
||||
</window>
|
10
layout/reftests/bugs/468473-1.xul
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<window title="Missing repaint when using -moz-border-image on a XUL button"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<hbox>
|
||||
<button label="Button" style="min-width: 0; -moz-appearance: none; border-width: 0; padding: 0; margin: 0; visibility:hidden; -moz-border-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAARCAMAAADnhAzLAAAAsVBMVEUAAAAAAAAAAAD///////8QEBAAAAAHBwcQEBD///8GBgYAAAAAAAAAAAAAAAAODg4AAAA2NjYAAAAAAAAGBgYREREAAAAQEBAAAAA4ODiJiYkSEhIAAADExMQAAAAICAhra2stLS0ODg4JCQklJSX///8HBwcGBgb///////98fHz///////+hoaE4ODj////////e3t6np6dxcXFUVFROTk7///////////////////+i+RpeAAAAO3RSTlNKAEwHAlBRbU8Ff2heWVdcZyFPTX1MZE5VIGpIVFdOXFhVWFdaQWp4El1tIGp6YBhhjYNxbWwnVXeDhIrUVQ0AAACvSURBVHheXdDXDoJAEIXhMztL73ZRFBXE3vv7P5hrognrfzdfMjcHRJIT22q5bsuyE5ZEIIe7lecHYRj4XtVlhyA5inuNplA1G704Yglud0yBb8LstBn9uYla5ryPwRBawwFmI51GM4yFTmKMKfQUTKCnIP9/zJEVOhUZytSoi5GWWCxXNTNWywVovdnufrLbbtYEov3heDpfrtfL+XQ87OlDJG/3x/P1ej7uN6nON0ZMDbf0SRXfAAAAAElFTkSuQmCC) 0 8 / 0 8px;"/>
|
||||
<box flex="1" style="background: green" />
|
||||
</hbox>
|
||||
|
||||
</window>
|
@ -138,6 +138,7 @@ fails == 25888-3r.html 25888-3r-ref.html # bug 25888
|
||||
== 210876-1.html 210876-1-ref.html
|
||||
== 212563-1.html 212563-1-ref.html
|
||||
== 212563-2.html 212563-2-ref.html
|
||||
== 213834-1.html 213834-1-ref.html
|
||||
== 214077-1a.html 214077-1-ref.html
|
||||
== 214077-1b.html 214077-1-ref.html
|
||||
== 218473-1.html 218473-1-ref.html
|
||||
@ -996,3 +997,4 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512
|
||||
== 467084-1.html 467084-1-ref.html
|
||||
== 467084-2.html 467084-2-ref.html
|
||||
== 467460-1.html 467460-1-ref.html
|
||||
== 468473-1.xul 468473-1-ref.xul
|
||||
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 69 B |
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 96 B |
23
layout/reftests/font-face/download-2-big-otf.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
|
||||
@font-face {
|
||||
font-family: "MarkA";
|
||||
src: url(../fonts/markA.otf);
|
||||
}
|
||||
|
||||
body { font-family: "MarkA"; font-size: 50px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>A</p>
|
||||
|
||||
</body>
|
||||
</html>
|
23
layout/reftests/font-face/download-2-big.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
|
||||
@font-face {
|
||||
font-family: "MarkA";
|
||||
src: url(../fonts/markA.ttf);
|
||||
}
|
||||
|
||||
body { font-family: "MarkA"; font-size: 50px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>A</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -5,6 +5,8 @@
|
||||
HTTP(..) != download-1.html download-1-notref.html
|
||||
HTTP(..) == download-2.html download-2-ref.html
|
||||
HTTP(..) != download-2.html about:blank
|
||||
fails-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) == download-2-big.html download-2-big-otf.html # bug 470713
|
||||
HTTP(..) != download-2-big-otf.html about:blank
|
||||
HTTP(..) == fallback-to-system-1.html fallback-to-system-1-ref.html
|
||||
HTTP(..) == name-override-simple-1.html name-override-simple-1-ref.html
|
||||
HTTP(..) != name-override-simple-1.html download-1-notref.html
|
||||
@ -13,6 +15,7 @@ HTTP(..) == multiple-descriptor-1.html multiple-descriptor-1-ref.html
|
||||
HTTP(..) != multiple-descriptor-1.html multiple-descriptor-1-notref.html
|
||||
HTTP(..) == src-list-1.html src-list-1-ref.html
|
||||
HTTP(..) == src-list-2.html src-list-2-ref.html
|
||||
fails-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) == src-list-2-big-otf.html src-list-2-big-ref.html # bug 470713
|
||||
fails HTTP(..) == src-list-format-1.html src-list-format-1-ref.html # bug 465452
|
||||
fails HTTP(..) == src-list-format-2.html src-list-format-2-ref.html # bug 465452
|
||||
HTTP(..) == src-list-format-3.html src-list-format-3-ref.html
|
||||
|
23
layout/reftests/font-face/src-list-2-big-otf.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
|
||||
@font-face {
|
||||
font-family: "One";
|
||||
src: url(../fonts/markA.otf), url(../fonts/markB.otf);
|
||||
}
|
||||
|
||||
body { font-family: "One"; font-size: 50px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>ABC</p>
|
||||
|
||||
</body>
|
||||
</html>
|
23
layout/reftests/font-face/src-list-2-big-ref.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
|
||||
@font-face {
|
||||
font-family: "MarkD";
|
||||
src: url(../fonts/markD.ttf);
|
||||
}
|
||||
|
||||
body { font-family: MarkD; font-size: 50px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>DBC</p>
|
||||
|
||||
</body>
|
||||
</html>
|