Merge mozilla-central to tracemonkey.

This commit is contained in:
Robert Sayre 2010-04-04 14:15:05 -04:00
commit 0f3df923db
321 changed files with 3746 additions and 2042 deletions

View file

@ -6,8 +6,7 @@ Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
function test() {
// Add a permission entry
var pm = Cc["@mozilla.org/permissionmanager;1"]
.getService(Ci.nsIPermissionManager);
var pm = Services.perms;
pm.add(makeURI("http://example.com"), "testing", pm.ALLOW_ACTION);
// Sanity check

View file

@ -42,8 +42,6 @@ function test() {
// initialization
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
let pbCmd = document.getElementById("Tools:PrivateBrowsing");
waitForExplicitFinish();
@ -71,16 +69,16 @@ function test() {
ok(!pbCmd.hasAttribute("disabled"),
"The private browsing command should be re-enabled after exiting the private browsing mode");
os.removeObserver(observer, "private-browsing");
os.removeObserver(observer, "private-browsing-transition-complete");
Services.obs.removeObserver(observer, "private-browsing");
Services.obs.removeObserver(observer, "private-browsing-transition-complete");
finish();
}, 100);
}
break;
}
}
os.addObserver(observer, "private-browsing", false);
os.addObserver(observer, "private-browsing-transition-complete", false);
Services.obs.addObserver(observer, "private-browsing", false);
Services.obs.addObserver(observer, "private-browsing-transition-complete", false);
pb.privateBrowsingEnabled = true;
}

View file

@ -42,8 +42,6 @@ function test() {
// initialization
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
waitForExplicitFinish();
function openLocation(url, autofilled, callback) {
@ -75,12 +73,12 @@ function test() {
break;
case "domwindowclosed":
ww.unregisterNotification(arguments.callee);
Services.ww.unregisterNotification(arguments.callee);
break;
}
}
ww.registerNotification(observer);
Services.ww.registerNotification(observer);
gPrefService.setIntPref("general.open_location.last_window_choice", 0);
openDialog("chrome://browser/content/openLocation.xul", "_blank",
"chrome,titlebar", window);

View file

@ -34,8 +34,6 @@
*
* ***** END LICENSE BLOCK ***** */
let gSS = Services.search;
let gObs = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
function test() {
waitForExplicitFinish();

View file

@ -48,12 +48,13 @@
@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
#ifdef XP_MACOSX
@BINPATH@/XUL
@BINPATH@/mozilla-runtime@BIN_SUFFIX@
#else
@BINPATH@/@DLL_PREFIX@xul@DLL_SUFFIX@
#endif
#ifdef MOZ_IPC
@BINPATH@/mozilla-runtime@BIN_SUFFIX@
#endif
#endif
#ifdef WINCE
@BINPATH@/mozce_shunt.dll
#elifdef XP_WIN32

View file

@ -56,8 +56,9 @@ else if (systemLocale == "fr-FR")
else
locales = [ "en-US", systemLocale, "fr-FR" ];
do_get_profile();
var workingDir = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile);
var manifest = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
manifest.initWithFile(workingDir);
manifest.append("test_bug519468.manifest");
@ -78,6 +79,7 @@ registerManifests(MANIFESTS);
var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry)
.QueryInterface(Ci.nsIToolkitChromeRegistry);
chromeReg.checkForNewChrome();
var prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService)
@ -116,5 +118,4 @@ function run_test()
test.package = "testmatchos";
test_locale(test);
}
manifest.remove(false);
}

View file

@ -137,6 +137,26 @@ export::
GARBAGE_DIRS += system_wrappers
endif
ifdef WRAP_STL_INCLUDES
ifdef GCC_VERSION
stl_compiler = gcc
else
stl_compiler = msvc
endif
endif
ifdef stl_compiler
stl-wrappers-sentinel: $(srcdir)/make-stl-wrappers.py $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers $(GLOBAL_DEPS)
$(PYTHON) $(srcdir)/make-stl-wrappers.py stl_wrappers $(stl_compiler) $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers
$(PYTHON) $(srcdir)/nsinstall.py stl_wrappers $(DIST)
touch stl-wrappers-sentinel
export:: stl-wrappers-sentinel
GARBAGE += stl-wrappers-sentinel
GARBAGE_DIRS += stl_wrappers
endif
install::
$(SYSINSTALL) $(IFLAGS1) $(DEPTH)/mozilla-config.h $(DESTDIR)$(includedir)

View file

@ -118,7 +118,6 @@ USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
MOZ_MAIL_NEWS = @MOZ_MAIL_NEWS@
MOZ_CALENDAR = @MOZ_CALENDAR@
MOZ_PLAINTEXT_EDITOR_ONLY = @MOZ_PLAINTEXT_EDITOR_ONLY@
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
@ -359,6 +358,9 @@ HAVE_GCC3_ABI = @HAVE_GCC3_ABI@
INTEL_CC = @INTEL_CC@
INTEL_CXX = @INTEL_CXX@
STL_FLAGS = @STL_FLAGS@
WRAP_STL_INCLUDES = @WRAP_STL_INCLUDES@
HOST_CC = @HOST_CC@
HOST_CXX = @HOST_CXX@
HOST_CFLAGS = @HOST_CFLAGS@

View file

@ -526,7 +526,7 @@ OS_COMPILE_CMMFLAGS += -fobjc-exceptions
endif
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS)
COMPILE_CXXFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS)
COMPILE_CXXFLAGS = $(VISIBILITY_FLAGS) $(STL_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS)
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS)
COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS)

View file

@ -0,0 +1,85 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* ***** 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 Code.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Chris Jones <jones.chris.g@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#ifndef mozilla_${HEADER}_h
#define mozilla_${HEADER}_h
#if __EXCEPTIONS
# error "STL code can only be used with -fno-exceptions"
#endif
// See if we're in code that can use mozalloc. NB: this duplicates
// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
// can't build with that being included before base/basictypes.h.
#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
# include <new> // to give mozalloc std::bad_alloc
# include <stdlib.h> // to give mozalloc malloc/free decls
# include <string.h>
# include "mozilla/mozalloc.h"
#else
# error "STL code can only be used with infallible ::operator new()"
#endif
#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
// Enable checked iterators and other goodies
//
// FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
// Figure out how to resolve this with -fno-rtti. Maybe build with
// -frtti in DEBUG builds?
//
// # define _GLIBCXX_DEBUG 1
#endif
#pragma GCC visibility push(default)
#include_next <${HEADER}>
#pragma GCC visibility pop
// gcc calls a __throw_*() function from bits/functexcept.h when it
// wants to "throw an exception". functexcept exists nominally to
// support -fno-exceptions, but since we'll always use the system
// libstdc++, and it's compiled with exceptions, then in practice
// these __throw_*() functions will always throw exceptions (shades of
// -fshort-wchar). We don't want that and so define our own inlined
// __throw_*().
#ifndef mozilla_functexcept_h
# include "mozilla/functexcept.h"
#endif
#endif // if mozilla_${HEADER}_h

View file

@ -0,0 +1,87 @@
# ***** 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
# The Mozilla Foundation
# Portions created by the Initial Developer are Copyright (C) 2010
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Jones <jones.chris.g@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 *****
import os, re, string, sys
def find_in_path(file, searchpath):
for dir in searchpath.split(os.pathsep):
f = os.path.join(dir, file)
if os.path.exists(f):
return f
return ''
def header_path(header, compiler):
if compiler == 'gcc':
# we use include_next on gcc
return header
elif compiler == 'msvc':
return find_in_path(header, os.environ.get('INCLUDE', ''))
else:
# hope someone notices this ...
raise NotImplementedError, compiler
def is_comment(line):
return re.match(r'\s*#.*', line)
def main(outdir, compiler, template_file, header_list_file):
if not os.path.isdir(outdir):
os.mkdir(outdir)
template = open(template_file, 'r').read()
for header in open(header_list_file, 'r'):
header = header.rstrip()
if 0 == len(header) or is_comment(header):
continue
path = header_path(header, compiler)
try:
f = open(os.path.join(outdir, header), 'w')
f.write(string.Template(template).substitute(HEADER=header,
HEADER_PATH=path))
finally:
f.close()
if __name__ == '__main__':
if 5 != len(sys.argv):
print >>sys.stderr, """Usage:
python %s OUT_DIR ('msvc'|'gcc') TEMPLATE_FILE HEADER_LIST_FILE
"""% (sys.argv[0])
sys.exit(1)
main(*sys.argv[1:])

View file

@ -0,0 +1,96 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* ***** 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 Code.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Chris Jones <jones.chris.g@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#ifndef mozilla_${HEADER}_h
#define mozilla_${HEADER}_h
#if _HAS_EXCEPTIONS
# error "STL code can only be used with -fno-exceptions"
#endif
// See if we're in code that can use mozalloc. NB: this duplicates
// code in nscore.h because nscore.h pulls in prtypes.h, and chromium
// can't build with that being included before base/basictypes.h.
#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
# include <new> // to give mozalloc std::bad_alloc
# include <stdlib.h> // to give mozalloc malloc/free decls
# include <string.h>
# include "mozilla/mozalloc.h"
#else
# error "STL code can only be used with infallible ::operator new()"
#endif
#ifdef DEBUG
// From
// http://msdn.microsoft.com/en-us/library/aa985982%28VS.80%29.aspx
// and
// http://msdn.microsoft.com/en-us/library/aa985965%28VS.80%29.aspx
// there appear to be two types of STL container checking. The
// former is enabled by -D_DEBUG (which is implied by -DDEBUG), and
// looks to be full generation/mutation checked iterators as done by
// _GLIBCXX_DEBUG. The latter appears to just be bounds checking, and
// is enabled by the following macros. It appears that the _DEBUG
// iterators subsume _SECURE_SCL, and the following settings are
// default anyway, so we'll just leave this commented out.
//# define _SECURE_SCL 1
//# define _SECURE_SCL_THROWS 0
#else
// Note: _SECURE_SCL iterators are on by default in opt builds. We
// could leave them on, but since gcc doesn't, we might as well
// preserve that behavior for perf reasons. nsTArray is in the same
// camp as gcc. Can revisit later.
//
// FIXME/bug 551254: because we're not wrapping all the STL headers we
// use, undefining this here can cause some headers to be built with
// iterator checking and others not. Turning this off until we have a
// better plan.
//# undef _SECURE_SCL
#endif
// We know that code won't be able to catch exceptions, but that's OK
// because we're not throwing them.
#pragma warning( push )
#pragma warning( disable : 4530 )
#include <${HEADER_PATH}>
#pragma warning( pop )
#endif // if mozilla_${HEADER}_h

19
config/stl-headers Normal file
View file

@ -0,0 +1,19 @@
#
# This file contains a list the of STL headers that have been reviewed
# for exception safety and approved. See
#
# https://bugzilla.mozilla.org/show_bug.cgi?id=551254
#
# At build time, each header listed here is converted into a "wrapper
# header" that is installed into dist/stl_includes.
#
# If you would like to request a new STL header <foo> be added, please
# file a Core:XPCOM bug with a title like "STL: Review exception
# safety of <foo> for gcc and MSVC".
#
# FIXME: these headers haven't been reviewed yet, but we use them
# unsafely in modules/libpr0n, so we might as well prevent it from
# throwing exceptions
algorithm
vector

View file

@ -759,6 +759,9 @@ EOF
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
WRAP_STL_INCLUDES=1
;;
esac
@ -807,6 +810,9 @@ AC_SUBST(GNU_CXX)
AC_SUBST(INTEL_CC)
AC_SUBST(INTEL_CXX)
AC_SUBST(STL_FLAGS)
AC_SUBST(WRAP_STL_INCLUDES)
dnl ========================================================
dnl Checks for programs.
dnl ========================================================
@ -3126,6 +3132,8 @@ EOF
"$ac_cv_have_visibility_class_bug" = "no"; then
VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
WRAP_SYSTEM_INCLUDES=1
STL_FLAGS='-I$(DIST)/stl_wrappers'
WRAP_STL_INCLUDES=1
else
VISIBILITY_FLAGS='-fvisibility=hidden'
fi # have visibility pragma bug
@ -4976,6 +4984,8 @@ cairo-qt)
MOZ_WIDGET_TOOLKIT=qt
MOZ_ENABLE_QT=1
MOZ_ENABLE_XREMOTE=1
MOZ_WEBGL=1
MOZ_WEBGL_GLX=1
USE_ELF_DYNSTR_GC=
NS_PRINTING=
@ -5084,10 +5094,10 @@ then
[ QTDIR=$withval])
if test -z "$QTDIR"; then
PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore)
PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
AC_CHECK_PROGS(HOST_MOC, moc, "")
else
MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtDBus -lQtXml"
MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtDBus -lQtXml -lQtOpenGL"
MOZ_QT_CFLAGS="-DQT_SHARED"
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
@ -5475,9 +5485,6 @@ case "${target}" in
powerpc-apple-darwin*)
MOZ_IPC=
;;
i386-apple-darwin*)
MOZ_IPC=
;;
*-wince*)
MOZ_IPC=
;;

View file

@ -1495,10 +1495,12 @@ public:
* origin is set to 'null'.
*
* The ASCII versions return a ASCII strings that are puny-code encoded,
* suitable for for example header values. The UTF versions return strings
* suitable for, for example, header values. The UTF versions return strings
* containing international characters.
*
* aPrincipal/aOrigin must not be null.
* @pre aPrincipal/aOrigin must not be null.
*
* @note this should be used for HTML5 origin determination.
*/
static nsresult GetASCIIOrigin(nsIPrincipal* aPrincipal,
nsCString& aOrigin);

View file

@ -115,8 +115,8 @@ class Link;
} // namespace mozilla
#define NS_IDOCUMENT_IID \
{ 0x94fb5716, 0xff00, 0x4b97, \
{ 0x90, 0x01, 0x91, 0x65, 0x1a, 0x5f, 0xbe, 0x64 } }
{ 0x5a428059, 0x4f29, 0x4d7c, \
{ 0x93, 0xae, 0x7c, 0x68, 0xd6, 0x5a, 0x86, 0x45 } }
// Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@ -985,7 +985,7 @@ public:
*
* @see nsIDOMWindowUtils::elementFromPoint
*/
virtual nsresult ElementFromPointHelper(PRInt32 aX, PRInt32 aY,
virtual nsresult ElementFromPointHelper(float aX, float aY,
PRBool aIgnoreRootScrollFrame,
PRBool aFlushLayout,
nsIDOMElement** aReturn) = 0;

View file

@ -2622,13 +2622,13 @@ nsDocument::GetActiveElement(nsIDOMElement **aElement)
}
NS_IMETHODIMP
nsDocument::ElementFromPoint(PRInt32 aX, PRInt32 aY, nsIDOMElement** aReturn)
nsDocument::ElementFromPoint(float aX, float aY, nsIDOMElement** aReturn)
{
return ElementFromPointHelper(aX, aY, PR_FALSE, PR_TRUE, aReturn);
}
nsresult
nsDocument::ElementFromPointHelper(PRInt32 aX, PRInt32 aY,
nsDocument::ElementFromPointHelper(float aX, float aY,
PRBool aIgnoreRootScrollFrame,
PRBool aFlushLayout,
nsIDOMElement** aReturn)

View file

@ -873,7 +873,7 @@ public:
virtual NS_HIDDEN_(nsresult) GetContentListFor(nsIContent* aContent,
nsIDOMNodeList** aResult);
virtual NS_HIDDEN_(nsresult) ElementFromPointHelper(PRInt32 aX, PRInt32 aY,
virtual NS_HIDDEN_(nsresult) ElementFromPointHelper(float aX, float aY,
PRBool aIgnoreRootScrollFrame,
PRBool aFlushLayout,
nsIDOMElement** aReturn);

View file

@ -104,13 +104,10 @@ nsXHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
// The previous version of the HTML serializer did implicit wrapping
// when there is no flags, so we keep wrapping in order to keep
// compatibility with the existing calling code
// XXXLJ perhaps we should remove these two default settings later ?
// XXXLJ perhaps should we remove this default settings later ?
if (aFlags & nsIDocumentEncoder::OutputFormatted ) {
aFlags = aFlags | nsIDocumentEncoder::OutputWrap;
}
else if (!(aFlags & nsIDocumentEncoder::OutputRaw)) {
aFlags = aFlags | nsIDocumentEncoder::OutputWrap;
}
nsresult rv;
rv = nsXMLContentSerializer::Init(aFlags, aWrapColumn, aCharSet, aIsCopying, aRewriteEncodingDeclaration);
@ -185,7 +182,9 @@ nsXHTMLContentSerializer::AppendText(nsIDOMText* aText,
PRInt32 lastNewlineOffset = kNotFound;
if (HasLongLines(data, lastNewlineOffset)) {
// We have long lines, rewrap
mDoWrap = PR_TRUE;
AppendToStringWrapped(data, aStr);
mDoWrap = PR_FALSE;
}
else {
AppendToStringConvertLF(data, aStr);

View file

@ -184,6 +184,7 @@ _TEST_FILES = test_bug5141.html \
file_htmlserializer_1_sibling_body.html \
file_htmlserializer_1_sibling_body_only_body.html \
file_htmlserializer_1_no_body.html \
file_htmlserializer_1_wrap.html \
test_bug424359-2.html \
file_htmlserializer_2.html \
test_bug431082.html \
@ -283,6 +284,7 @@ _TEST_FILES = test_bug5141.html \
file_xhtmlserializer_1_sibling_body.xhtml \
file_xhtmlserializer_1_sibling_body_only_body.xhtml \
file_xhtmlserializer_1_no_body.xhtml \
file_xhtmlserializer_1_wrap.xhtml \
test_bug422403-2.xhtml \
file_xhtmlserializer_2.xhtml \
file_xhtmlserializer_2_basic.xhtml \

View file

@ -3,10 +3,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -28,8 +26,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -43,5 +40,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head><body>
@ -8,10 +7,8 @@ charset=UTF-8">
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -33,8 +30,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -48,5 +44,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head><body>
@ -8,11 +7,8 @@ charset=UTF-8">
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a
href="http://mochi.test:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="http://mochi.test:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -34,8 +30,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -49,5 +44,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head><body>
@ -8,10 +7,8 @@ charset=UTF-8">
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -33,8 +30,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -48,6 +44,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p><body><p>this is
an other body element</p></body></body></html>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p><body><p>this is an other body element</p></body></body></html>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head></html>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head><body>
@ -8,10 +7,8 @@ charset=UTF-8">
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -33,8 +30,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -48,5 +44,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head><body>
@ -8,10 +7,8 @@ charset=UTF-8">
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -33,8 +30,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -52,5 +48,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test for html serializer</title>
</head><body><p>this is an other body element</p></body><body>
@ -8,10 +7,8 @@ charset=UTF-8">
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -33,8 +30,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -48,5 +44,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>

View file

@ -3,10 +3,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -28,8 +26,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -43,5 +40,4 @@ ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<title>Test for html serializer</title>
</head><body>
<p>Hello world</p> <p>
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
nostra, per inceptos hymenaeos. </p>
<ul><li>Nam tellus massa,éàèçù</li><li>
fringilla
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
<script type="text/javascript">
// a script which does nothing
function nothing() {
var hey="hello";
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
}
var a=3, b=4, c=7;
// here we test the non-serialization of xml character into javascript content
var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br>
Cras quis<br>
nisi at odio<br>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
lacus risus pulvinar ante.
</pre>
ut gravida eros leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>

View file

@ -1,11 +1,9 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset="><title>Test
for html serializer with entities</title>
<meta http-equiv="content-type" content="text/html; charset="><title>Test for html serializer with entities</title>
</head><body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support α and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support α and friends.</p>
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´
µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ

View file

@ -1,11 +1,9 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset="><title>Test
for html serializer with entities</title>
<meta http-equiv="content-type" content="text/html; charset="><title>Test for html serializer with entities</title>
</head><body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support &alpha; and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support &alpha; and friends.</p>
<p>latin1 &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml;
&copy; &ordf; &laquo; &not; &shy; &reg; &macr; &deg; &plusmn; &sup2;

View file

@ -1,11 +1,9 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset="><title>Test
for html serializer with entities</title>
<meta http-equiv="content-type" content="text/html; charset="><title>Test for html serializer with entities</title>
</head><body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support &alpha; and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support &alpha; and friends.</p>
<p>latin1 &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml;
&copy; &ordf; &laquo; &not; &shy; &reg; &macr; &deg; &plusmn; &sup2;

View file

@ -1,11 +1,9 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset="><title>Test
for html serializer with entities</title>
<meta http-equiv="content-type" content="text/html; charset="><title>Test for html serializer with entities</title>
</head><body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support α and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support α and friends.</p>
<p>latin1 &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml;
&copy; &ordf; &laquo; &not; &shy; &reg; &macr; &deg; &plusmn; &sup2;

View file

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testcase for IPv6 addresses</title>
</head><body>
<a href="http://[2001:4860:a003::68]/">Test</a>

View file

@ -3,10 +3,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -30,8 +28,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -46,10 +43,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -11,10 +11,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -38,8 +36,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -54,10 +51,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -11,11 +11,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a
href="http://mochi.test:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="http://mochi.test:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -39,8 +36,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -55,10 +51,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -11,10 +11,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -38,8 +36,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -54,10 +51,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -11,10 +11,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -38,8 +36,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -54,10 +51,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -11,10 +11,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -38,8 +36,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -58,10 +55,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -11,10 +11,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -38,8 +36,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -54,10 +51,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -3,10 +3,8 @@
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per conubia</a>
nostra, per inceptos hymenaeos. </p>
@ -30,8 +28,7 @@ var d = a < b && a > c;
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
@ -46,10 +43,8 @@ ut gravida eros <br />leo ut libero
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non

View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Test for html serializer</title>
</head>
<body>
<p>Hello world</p> <p>
Lorem ipsum dolor sit amet, <strong>consectetuer</strong>
adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum.
Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
ad
litora</span> torquent <a href="file_htmlserializer_1_result1.html">per
conubia</a>
nostra, per inceptos hymenaeos. </p>
<ul><li>Nam tellus massa,éàèçù</li><li>
fringilla
aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
<div> Duis tristique egestas ligula. Mauris quis felis. </div>
<script id="script" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
// a script which does nothing
function nothing() {
var hey="hello";
var aLongLine="consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere";
}
var a=3, b=4, c=7;
// here we test the non-serialization of xml character into javascript content
var d = a < b && a > c;
//]]>
</script>
<ol><li>Fusce
a ipsum</li><li> non lacus posuere aliquet.</li><li> Sed fermentum
posuere nulla</li><li> Donec tempor.</li></ol>
Donec sollicitudin tortor
<!-- test on
comments -->
<pre>lacinia <em>libero</em> ullamcorper laoreet.<br />
Cras quis<br />
nisi at odio<br />
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br />
lacus risus pulvinar ante.
</pre>
ut gravida eros <br />leo ut libero
<!-- empty element: end tag should be generated for backward compatibility with HTML -->
<p></p>
<noscript>
<p>Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
<p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus
aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
<pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em>
ullamcorper laoreet.<br/>
Cras quis<br/>
nisi at odio<br/>
consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non
urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci
luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at
pharetra rutrum, <br/>
lacus risus pulvinar ante.
</pre>
</body>
</html>

View file

@ -7,8 +7,7 @@
</head>
<body>
<p>The basic set is just " " &amp; &lt; &gt; " for interoperability with
older products that don't support α and friends.</p>
<p>The basic set is just " " &amp; &lt; &gt; " for interoperability with older products that don't support α and friends.</p>
<p>latin1 ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´
µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ

View file

@ -7,8 +7,7 @@
</head>
<body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support &alpha; and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support &alpha; and friends.</p>
<p>latin1 &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml;
&copy; &ordf; &laquo; &not; &shy; &reg; &macr; &deg; &plusmn; &sup2;

View file

@ -7,8 +7,7 @@
</head>
<body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support &alpha; and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support &alpha; and friends.</p>
<p>latin1 &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml;
&copy; &ordf; &laquo; &not; &shy; &reg; &macr; &deg; &plusmn; &sup2;

View file

@ -7,8 +7,7 @@
</head>
<body>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability
with older products that don't support α and friends.</p>
<p>The basic set is just &nbsp; &amp; &lt; &gt; " for interoperability with older products that don't support α and friends.</p>
<p>latin1 &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml;
&copy; &ordf; &laquo; &not; &shy; &reg; &macr; &deg; &plusmn; &sup2;

View file

@ -86,10 +86,9 @@ function testHtmlSerializer_1 () {
//------------ OutputWrap
// by default, this flag is set, so we should have the same result as
// when there are no flags.
encoder.init(doc, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputWrap);
out = encoder.encodeToString();
expected = loadFileContent("file_xhtmlserializer_1_wrap.xhtml");
is(out, expected, "test OutputWrap");
//------------ OutputFormatted

View file

@ -92,20 +92,20 @@ function testHtmlSerializer_1 () {
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = 'This is a <em xmlns=\"http://www.w3.org/1999/xhtml\">draggable</em> bit of\n text.';
expected = 'This is a <em xmlns=\"http://www.w3.org/1999/xhtml\">draggable</em> bit of text.';
is(out, expected, "test selection");
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(null);
encoder.setContainerNode(node);
out = encoder.encodeToString();
expected = 'This is a <em xmlns=\"http://www.w3.org/1999/xhtml\">draggable</em> bit of\n text.';
expected = 'This is a <em xmlns=\"http://www.w3.org/1999/xhtml\">draggable</em> bit of text.';
is(out, expected, "test container node");
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<div xmlns=\"http://www.w3.org/1999/xhtml\" id=\"draggable\" \nondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> \nbit of text.</div>";
expected = "<div xmlns=\"http://www.w3.org/1999/xhtml\" id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> bit of text.</div>";
is(out, expected, "test node");
node = document.getElementById('aList');
@ -116,20 +116,20 @@ function testHtmlSerializer_1 () {
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Lorem ipsum dolor</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">sit amet, <strong>consectetuer</strong>\n </li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">adipiscing elit</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Nam eu sapien. Sed viverra \nlacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. \nClass</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">aptent taciti</li>\n';
expected = '\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Lorem ipsum dolor</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">sit amet, <strong>consectetuer</strong> </li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">adipiscing elit</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">aptent taciti</li>\n';
is(out, expected, "test list selection");
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(null);
encoder.setContainerNode(node);
out = encoder.encodeToString();
expected = '\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Lorem ipsum dolor</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">sit amet, <strong>consectetuer</strong>\n </li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">adipiscing elit</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Nam eu sapien. Sed viverra \nlacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. \nClass</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">aptent taciti</li>\n';
expected = '\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Lorem ipsum dolor</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">sit amet, <strong>consectetuer</strong> </li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">adipiscing elit</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li xmlns=\"http://www.w3.org/1999/xhtml\">aptent taciti</li>\n';
is(out, expected, "test list container node");
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<ol xmlns=\"http://www.w3.org/1999/xhtml\" id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
expected = "<ol xmlns=\"http://www.w3.org/1999/xhtml\" id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
is(out, expected, "test list node");
var liList = node.getElementsByTagName("li");
@ -143,7 +143,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol xmlns=\"http://www.w3.org/1999/xhtml\" id="aList"><li>Lorem ipsum \ndolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol xmlns=\"http://www.w3.org/1999/xhtml\" id="aList"><li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the first child of the ol, and end after the element ol");
// selection start at the third child of the ol, and end after the element ol
@ -152,7 +152,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol xmlns=\"http://www.w3.org/1999/xhtml\" id="aList"><li>sit amet, <strong>consectetuer</strong>\n </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol xmlns=\"http://www.w3.org/1999/xhtml\" id="aList"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol");
@ -163,7 +163,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol xmlns=\"http://www.w3.org/1999/xhtml\" id="aList" start="5"><li>sit \namet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol xmlns=\"http://www.w3.org/1999/xhtml\" id="aList" start="5"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol + ol start at the value 5");
@ -174,7 +174,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<li xmlns=\"http://www.w3.org/1999/xhtml\">sit amet, <strong>consectetuer</strong>\n </li>\n ';
expected = '<li xmlns=\"http://www.w3.org/1999/xhtml\">sit amet, <strong>consectetuer</strong> </li>\n ';
is(out, expected, "test list selection with range: selection contains only some child of the ol");

View file

@ -91,10 +91,9 @@ function testHtmlSerializer_1 () {
//------------ OutputWrap
// by default, this flag is set, so we should have the same result as
// when there are no flags.
encoder.init(doc, "text/html", de.OutputLFLineBreak |de.OutputWrap);
out = encoder.encodeToString();
expected = loadFileContent("file_htmlserializer_1_wrap.html");
isRoughly(out, expected, "test OutputWrap");
//------------ OutputFormatted

View file

@ -111,7 +111,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em>\n bit of text.</div>";
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> bit of text.</div>";
is(out, expected, "test node");
node = document.getElementById('aList');
@ -122,20 +122,20 @@ function testHtmlSerializer_1 () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
is(out, expected, "test list selection");
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(null);
encoder.setContainerNode(node);
out = encoder.encodeToString();
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
is(out, expected, "test list container node");
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
expected = "<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
is(out, expected, "test list node");
var liList = node.getElementsByTagName("li");
@ -149,7 +149,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id="aList"><li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id="aList"><li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the first child of the ol, and end after the element ol");
// selection start at the third child of the ol, and end after the element ol
@ -158,7 +158,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id="aList"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id="aList"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol");
@ -169,7 +169,7 @@ function testHtmlSerializer_1 () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol start="5" id="aList"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol start="5" id="aList"><li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol + ol start at the value 5");

View file

@ -90,7 +90,7 @@ function testSerializer () {
encoder.init(doc, "text/html", de.OutputLFLineBreak);
encoder.setCharset("UTF-8");
result = encoder.encodeToString();
expected = '<html><head><meta http-equiv=\"content-type\" content=\"text/html; \ncharset=UTF-8\">\n <title>Test</title>\n';
expected = '<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n <title>Test</title>\n';
expected += ' <link rel=\"Top\" href=\"\"> ';
expected += ' </head><body>foo \n\n\n <p>Hello world</p>\n</body></html>';
is(result, expected, "serialization of a link element with content, inside an html document");

View file

@ -65,7 +65,7 @@ function testCopyPaste () {
transferable.getTransferData ("text/html", data, {} ) ;
is (data.value.QueryInterface(Components.interfaces.nsISupportsString).data,
"<div id=\"draggable\" title=\"title to have a long HTML line\">This is a <em>draggable</em>\n bit of text.</div>",
"<div id=\"draggable\" title=\"title to have a long HTML line\">This is a <em>draggable</em> bit of text.</div>",
"text/html value in the clipboard");
// let's paste now in the textarea and verify its content

View file

@ -40,7 +40,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em>\n bit of text.</div>";
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> bit of text.</div>";
is(out, expected, "test node");
var select = window.getSelection();
@ -49,7 +49,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = "<div style=\"display: none;\">\n\n<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em>\n bit of text.</div>\n\n</div>";
expected = "<div style=\"display: none;\">\n\n<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> bit of text.</div>\n\n</div>";
is(out, expected, "test selection");
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputAbsoluteLinks | de.OutputEncodeHTMLEntities | de.OutputSelectionOnly | de.OutputRaw);
@ -63,7 +63,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em>\n bit of text.</div>";
expected = "<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> bit of text.</div>";
is(out, expected, "test selection with additional data");
node = document.getElementById('aList');
@ -74,19 +74,19 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection");
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setContainerNode(node);
out = encoder.encodeToString();
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
is(out, expected, "test list container node");
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
expected = "<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
is(out, expected, "test list node");
var liList = node.getElementsByTagName("li");
@ -100,7 +100,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id="aList">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id="aList">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the first child of the ol, and end after the element ol");
// selection start at the third child of the ol, and end after the element ol
@ -109,7 +109,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id="aList"><li value=\"2\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id="aList"><li value=\"2\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol");
@ -120,7 +120,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol start=\"5\" id=\"aList\"><li value=\"6\">sit amet, <strong>consectetuer</strong>\n </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol start=\"5\" id=\"aList\"><li value=\"6\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol + ol start at the value 5");
// selection contains only some child of the ol
@ -154,7 +154,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id=\"aList\">\n <li value=\"8\">Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id=\"aList\">\n <li value=\"8\">Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
is(out, expected, "test list selection with a value on a LI");
//test Bug 436703

View file

@ -44,7 +44,7 @@ function testHtmlCopyEncoder () {
// right order but the html serializer serializes in the reverse order
// (because the html parser stores the attribute in the reverse order,
// see bug 213347 for reason).
expected = "<div ondragstart=\"doDragStartSelection(event)\" id=\"draggable\">This is a <em>draggable</em>\n <br>bit of text.</div>";
expected = "<div ondragstart=\"doDragStartSelection(event)\" id=\"draggable\">This is a <em>draggable</em> <br>bit of text.</div>";
is(out, expected, "test node");
var select = window.getSelection();
@ -53,7 +53,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html", de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = "<div style=\"display: none;\">\n\n<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em>\n <br>bit of text.</div>\n\n</div>";
expected = "<div style=\"display: none;\">\n\n<div id=\"draggable\" ondragstart=\"doDragStartSelection(event)\">This is a <em>draggable</em> <br>bit of text.</div>\n\n</div>";
todo_is(out, expected, "test selection");
node.nextSibling.data="\nfoo bar\n";
@ -77,13 +77,13 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html",de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setContainerNode(node);
out = encoder.encodeToString();
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
expected = '\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n';
is(out, expected, "test list container node");
encoder.init(document, "text/html",de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setNode(node);
out = encoder.encodeToString();
expected = "<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
expected = "<ol id=\"aList\">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>";
is(out, expected, "test list node");
var liList = node.getElementsByTagName("li");
@ -97,7 +97,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html",de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id="aList">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id="aList">\n <li>Lorem ipsum dolor</li>\n <li>sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
todo_is(out, expected, "test list selection with range: selection start at the first child of the ol, and end after the element ol");
// selection start at the third child of the ol, and end after the element ol
@ -106,7 +106,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html",de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol id="aList"><li value=\"2\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol id="aList"><li value=\"2\">sit amet, <strong>consectetuer</strong> </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
todo_is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol");
@ -117,7 +117,7 @@ function testHtmlCopyEncoder () {
encoder.init(document, "text/html",de.OutputLFLineBreak | de.OutputSelectionOnly);
encoder.setSelection(select);
out = encoder.encodeToString();
expected = '<ol start=\"5\" id=\"aList\"><li value=\"6\">sit amet, <strong>consectetuer</strong>\n </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus \naliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
expected = '<ol start=\"5\" id=\"aList\"><li value=\"6\">sit amet, <strong>consectetuer</strong>\n </li>\n <li>adipiscing elit</li>\n <li>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class</li>\n <li>aptent taciti</li>\n</ol>';
todo_is(out, expected, "test list selection with range: selection start at the third child of the ol, and end after the element ol + ol start at the value 5");

View file

@ -2028,19 +2028,14 @@ nsCanvasRenderingContext2D::SetFont(const nsAString& font)
return rv;
nsCOMArray<nsIStyleRule> parentRules;
parentRules.AppendObject(parentRule);
parentContext =
styleSet->ResolveStyleForRules(nsnull, nsnull,
nsCSSPseudoElements::ePseudo_NotPseudoElement,
nsnull, parentRules);
parentContext = styleSet->ResolveStyleForRules(nsnull, parentRules);
}
if (!parentContext)
return NS_ERROR_FAILURE;
nsRefPtr<nsStyleContext> sc =
styleSet->ResolveStyleForRules(parentContext, nsnull,
nsCSSPseudoElements::ePseudo_NotPseudoElement,
nsnull, rules);
styleSet->ResolveStyleForRules(parentContext, rules);
if (!sc)
return NS_ERROR_FAILURE;
const nsStyleFont* fontStyle = sc->GetStyleFont();

View file

@ -77,14 +77,19 @@ function link123HrefIs(href, testNum) {
var gGen;
function visitedDependentComputedStyle(win, elem, property) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
return utils.getVisitedDependentComputedStyle(elem, "", property);
}
function getColor(elem) {
return document.defaultView.getComputedStyle(elem, "").color;
return visitedDependentComputedStyle(document.defaultView, elem, "color");
}
function getFill(elem) {
return document.defaultView
.getComputedStyle(elem, "")
.getPropertyValue("fill");
return visitedDependentComputedStyle(document.defaultView, elem, "fill");
}
function setXlinkHref(elem, href) {

View file

@ -51,12 +51,18 @@ function continueTest() {
function checkLinkColor(aElmId, aExpectedColor, aMessage) {
// Because link coloring is asynchronous, we wait until we get the right
// result, or we will time out (resulting in a failure).
var getCS = document.defaultView.getComputedStyle;
while (getCS($(aElmId), "").color != aExpectedColor) {
function getColor() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = document.defaultView.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
return utils.getVisitedDependentComputedStyle($(aElmId), "", "color");
}
while (getColor() != aExpectedColor) {
setTimeout(continueTest, 10);
return false;
}
is(getCS($(aElmId), "").color, aExpectedColor, aMessage);
is(getColor(), aExpectedColor, aMessage);
return true;
}

View file

@ -72,6 +72,7 @@ _TEST_FILES = test_bug1682.html \
test_bug403868.xhtml \
test_bug404320.html \
$(warning test_bug435128.html disabled because it takes 60 seconds) \
test_bug463104.html \
test_bug468353.html \
test_form-parsing.html \
test_viewport.html \

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Noninteger coordinates test</title>
<script type="text/javascript" src="/MochiKit/packed.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>
<div id="a" style="position: fixed; left: 5.5px; top: 5.5px; width: 100px; height: 100px; background: blue"></div>
<p style="margin-top: 110px">
<script>
var a = document.getElementById("a");
isnot(a, document.elementFromPoint(5, 5), "a shouldn't be found");
isnot(a, document.elementFromPoint(5.25, 5.25), "a shouldn't be found");
is(a, document.elementFromPoint(5.5, 5.5), "a should be found");
is(a, document.elementFromPoint(5.75, 5.75), "a should be found");
is(a, document.elementFromPoint(6, 6), "a should be found");
is(a, document.elementFromPoint(105, 105), "a should be found");
is(a, document.elementFromPoint(105.25, 105.25), "a should be found");
isnot(a, document.elementFromPoint(105.5, 105.5), "a shouldn't be found");
isnot(a, document.elementFromPoint(105.75, 105.75), "a shouldn't be found");
isnot(a, document.elementFromPoint(106, 106), "a shouldn't be found");
</script>
</body>
</html>

View file

@ -89,7 +89,6 @@ float nsOggDecoder::GetDuration()
}
nsOggDecoder::nsOggDecoder() :
mMonitor("media.decoder"),
mDecoderPosition(0),
mPlaybackPosition(0),
mCurrentTime(0.0),
@ -97,6 +96,7 @@ nsOggDecoder::nsOggDecoder() :
mRequestedSeekTime(-1.0),
mDuration(-1),
mSeekable(PR_TRUE),
mMonitor("media.decoder"),
mPlayState(PLAY_STATE_PAUSED),
mNextState(PLAY_STATE_PAUSED),
mResourceLoaded(PR_FALSE),

View file

@ -69,7 +69,7 @@ namespace mozilla {
*
* MUCH PREFERRED to bare calls to Monitor.Exit and Enter.
*/
class NS_COM_GLUE NS_STACK_CLASS MonitorAutoExit
class MonitorAutoExit
{
public:
/**

View file

@ -1021,9 +1021,9 @@ void nsOggPlayStateMachine::RenderVideoFrame(VideoData* aData)
PRUint32 picXLimit;
PRUint32 picYLimit;
if (!AddOverflow(mInfo.mPicture.x, mInfo.mPicture.width, picXLimit) ||
picXLimit > PR_ABS(aData->mBuffer[0].stride) ||
picXLimit > PRUint32(PR_ABS(aData->mBuffer[0].stride)) ||
!AddOverflow(mInfo.mPicture.y, mInfo.mPicture.height, picYLimit) ||
picYLimit > PR_ABS(aData->mBuffer[0].height))
picYLimit > PRUint32(PR_ABS(aData->mBuffer[0].height)))
{
// The specified picture dimensions can't be contained inside the video
// frame, we'll stomp memory if we try to copy it. Fail.
@ -1049,10 +1049,9 @@ void nsOggPlayStateMachine::RenderVideoFrame(VideoData* aData)
unsigned char* cr = cb + (cbCrStride * PR_ABS(aData->mBuffer[1].height));
unsigned char* p = y;
unsigned yStride = mInfo.mPicture.width;
unsigned char* q = aData->mBuffer[0].data + mInfo.mPicture.x +
aData->mBuffer[0].stride * mInfo.mPicture.y;
for(unsigned i=0; i < mInfo.mPicture.height; ++i) {
for(PRInt32 i=0; i < mInfo.mPicture.height; ++i) {
NS_ASSERTION(q + mInfo.mPicture.width <
aData->mBuffer[0].data + aData->mBuffer[0].stride * aData->mBuffer[0].height,
"Y read must be in bounds");

View file

@ -70,8 +70,8 @@ public:
: mTime(aTime),
mDuration(aDuration),
mSamples(aSamples),
mAudioData(aData),
mChannels(aChannels)
mChannels(aChannels),
mAudioData(aData)
{
MOZ_COUNT_CTOR(SoundData);
}
@ -83,8 +83,8 @@ public:
: mTime(-1),
mDuration(aDuration),
mSamples(aSamples),
mAudioData(aData),
mChannels(aChannels)
mChannels(aChannels),
mAudioData(aData)
{
MOZ_COUNT_CTOR(SoundData);
}

View file

@ -324,7 +324,6 @@ protected:
nsSMILValue& aResult, PRBool& aCanCacheSoFar) const;
nsresult GetValues(const nsISMILAttr& aSMILAttr,
nsSMILValueArray& aResult);
void UpdateValuesArray();
void CheckKeyTimes(PRUint32 aNumValues);
void CheckKeySplines(PRUint32 aNumValues);

View file

@ -143,8 +143,8 @@ nsSMILCSSProperty::GetBaseValue() const
// (4) Populate our nsSMILValue from the computed style
if (didGetComputedVal) {
nsSMILCSSValueType::ValueFromString(mPropID, mElement,
computedStyleVal, baseValue);
nsSMILCSSValueType::ValueFromString(mPropID, mElement, computedStyleVal,
PR_FALSE, baseValue);
}
return baseValue;
}
@ -157,7 +157,8 @@ nsSMILCSSProperty::ValueFromString(const nsAString& aStr,
{
NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue);
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr,
PR_FALSE, aValue);
if (aValue.IsNull()) {
return NS_ERROR_FAILURE;
}

View file

@ -337,6 +337,7 @@ ValueFromStringHelper(nsCSSProperty aPropID,
nsIContent* aTargetElement,
nsPresContext* aPresContext,
const nsAString& aString,
PRBool aUseSVGMode,
nsStyleAnimation::Value& aStyleAnimValue)
{
// If value is negative, we'll strip off the "-" so the CSS parser won't
@ -351,8 +352,8 @@ ValueFromStringHelper(nsCSSProperty aPropID,
subStringBegin = (PRUint32)absValuePos; // Start parsing after '-' sign
}
nsDependentSubstring subString(aString, subStringBegin);
if (!nsStyleAnimation::ComputeValue(aPropID, aTargetElement,
subString, aStyleAnimValue)) {
if (!nsStyleAnimation::ComputeValue(aPropID, aTargetElement, subString,
aUseSVGMode, aStyleAnimValue)) {
return PR_FALSE;
}
if (isNegative) {
@ -375,6 +376,7 @@ void
nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
nsIContent* aTargetElement,
const nsAString& aString,
PRBool aUseSVGMode,
nsSMILValue& aValue)
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Outparam should be null-typed");
@ -386,7 +388,7 @@ nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
nsStyleAnimation::Value parsedValue;
if (ValueFromStringHelper(aPropID, aTargetElement, presContext,
aString, parsedValue)) {
aString, aUseSVGMode, parsedValue)) {
sSingleton.Init(aValue);
aValue.mU.mPtr = new ValueWrapper(aPropID, parsedValue, presContext);
if (!aValue.mU.mPtr) {

View file

@ -92,6 +92,8 @@ public:
* @param aTargetElement The target element to whom the property/value
* setting applies.
* @param aString The string to be parsed as a CSS value.
* @param aUseSVGMode A flag to indicate whether we should parse
* |aString| in SVG mode.
* @param [out] aValue The nsSMILValue to be populated. Should
* initially be null-typed.
* @pre aValue.IsNull()
@ -99,7 +101,9 @@ public:
*/
static void ValueFromString(nsCSSProperty aPropID,
nsIContent* aTargetElement,
const nsAString& aString, nsSMILValue& aValue);
const nsAString& aString,
PRBool aUseSVGMode,
nsSMILValue& aValue);
/**
* Creates a string representation of the given nsSMILValue.

View file

@ -57,6 +57,27 @@ ReleaseStringBufferPropertyValue(void* aObject, /* unused */
buf->Release();
}
nsresult
nsSMILMappedAttribute::ValueFromString(const nsAString& aStr,
const nsISMILAnimationElement* aSrcElement,
nsSMILValue& aValue,
PRBool& aCanCache) const
{
NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr,
PR_TRUE, aValue);
if (aValue.IsNull()) {
return NS_ERROR_FAILURE;
}
// XXXdholbert: For simplicity, just assume that all CSS values have to
// reparsed every sample. See note in nsSMILCSSProperty::ValueFromString.
aCanCache = PR_FALSE;
return NS_OK;
}
nsSMILValue
nsSMILMappedAttribute::GetBaseValue() const
{
@ -66,8 +87,8 @@ nsSMILMappedAttribute::GetBaseValue() const
baseStringValue);
nsSMILValue baseValue;
if (success) {
nsSMILCSSValueType::ValueFromString(mPropID, mElement,
baseStringValue, baseValue);
nsSMILCSSValueType::ValueFromString(mPropID, mElement, baseStringValue,
PR_TRUE, baseValue);
} else {
// Attribute is unset -- use computed value.
// FIRST: Temporarily clear animated value, to make sure it doesn't pollute

View file

@ -70,6 +70,10 @@ public:
nsSMILCSSProperty(aPropID, aElement) {}
// nsISMILAttr methods
virtual nsresult ValueFromString(const nsAString& aStr,
const nsISMILAnimationElement* aSrcElement,
nsSMILValue& aValue,
PRBool& aCanCache) const;
virtual nsSMILValue GetBaseValue() const;
virtual nsresult SetAnimValue(const nsSMILValue& aValue);
virtual void ClearAnimValue();

View file

@ -2,8 +2,8 @@
<head>
<title>Bug 293235 page1</title>
<style type="text/css">
a:visited { color: rgb(128, 0, 128); }
a:link { color: rgb(0, 0, 128); }
a:visited, a.forcevisited.forcevisited { color: rgb(128, 0, 128); }
a:link, a.forcelink.forcelink { color: rgb(0, 0, 128); }
a:focus { color: rgb(128, 0, 0); }
</style>
</head>

View file

@ -12,6 +12,7 @@
src=
"chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
</script>
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript"><![CDATA[
const Ci = Components.interfaces;
@ -74,9 +75,22 @@
yield;
// Now that we've been notified, we can check our link color.
is(TestWindow.getWindow().getComputedStyle($("link1"), "").color,
"rgb(0, 0, 128)",
"link not initially blue");
// Since we can't use getComputedStyle() for this because
// getComputedStyle lies about styles that result from :visited,
// we have to take snapshots.
// First, take two reference snapshots.
var link1 = $("link1");
link1.className = "forcelink";
var refLink = snapshotWindow(TestWindow.getWindow());
link1.className = "forcevisited";
var refVisited = snapshotWindow(TestWindow.getWindow());
link1.className = "";
function snapshotsEqual(snap1, snap2) {
return compareSnapshots(snap1, snap2, true)[0];
}
ok(!snapshotsEqual(refLink, refVisited), "references should not match");
ok(snapshotsEqual(refLink, snapshotWindow(TestWindow.getWindow())),
"link should initially be blue");
// Load the page that the link on the previous page points to.
doPageNavigation({
@ -109,9 +123,8 @@
yield;
// Now we can test the link color.
is(TestWindow.getWindow().getComputedStyle($("link1"), "").color,
"rgb(128, 0, 128)",
":visited link wrong color");
ok(snapshotsEqual(refVisited, snapshotWindow(TestWindow.getWindow())),
"visited link should be purple");
// Tell the framework the test is finished. Include the final 'yield'
// statement to prevent a StopIteration exception from being thrown.

View file

@ -66,6 +66,7 @@
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "nsLayoutUtils.h"
#include "nsComputedDOMStyle.h"
#if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK2)
#include <gdk/gdk.h>
@ -606,7 +607,7 @@ nsDOMWindowUtils::SendSimpleGestureEvent(const nsAString& aType,
}
NS_IMETHODIMP
nsDOMWindowUtils::ElementFromPoint(PRInt32 aX, PRInt32 aY,
nsDOMWindowUtils::ElementFromPoint(float aX, float aY,
PRBool aIgnoreRootScrollFrame,
PRBool aFlushLayout,
nsIDOMElement** aReturn)
@ -1224,3 +1225,26 @@ nsDOMWindowUtils::GetClassName(char **aName)
*aName = NS_strdup(JS_GET_CLASS(cx, JSVAL_TO_OBJECT(argv[0]))->name);
return *aName ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetVisitedDependentComputedStyle(
nsIDOMElement *aElement, const nsAString& aPseudoElement,
const nsAString& aPropertyName, nsAString& aResult)
{
aResult.Truncate();
if (!IsUniversalXPConnectCapable()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsCOMPtr<nsIDOMCSSStyleDeclaration> decl;
nsresult rv =
mWindow->GetComputedStyle(aElement, aPseudoElement, getter_AddRefs(decl));
NS_ENSURE_SUCCESS(rv, rv);
static_cast<nsComputedDOMStyle*>(decl.get())->SetExposeVisitedStyle(PR_TRUE);
rv = decl->GetPropertyValue(aPropertyName, aResult);
static_cast<nsComputedDOMStyle*>(decl.get())->SetExposeVisitedStyle(PR_FALSE);
return rv;
}

View file

@ -52,7 +52,7 @@ interface nsIDOMEvent;
interface nsITransferable;
interface nsIQueryContentEventResult;
[scriptable, uuid(00ca8d4f-61f1-4d9c-a7c1-82651b0cf02b)]
[scriptable, uuid(25ada920-d727-45b6-ac70-847a3aa9c7cf)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -298,8 +298,8 @@ interface nsIDOMWindowUtils : nsISupports {
* null for coordinates outside of the viewport.
* @param aFlushLayout flushes layout if true. Otherwise, no flush occurs.
*/
nsIDOMElement elementFromPoint(in long aX,
in long aY,
nsIDOMElement elementFromPoint(in float aX,
in float aY,
in boolean aIgnoreRootScrollFrame,
in boolean aFlushLayout);
@ -613,4 +613,22 @@ interface nsIDOMWindowUtils : nsISupports {
boolean sendSelectionSetEvent(in unsigned long aOffset,
in unsigned long aLength,
in boolean aReverse);
/**
* Perform the equivalent of:
* window.getComputedStyle(aElement, aPseudoElement).
* getPropertyValue(aPropertyName)
* except that, when the link whose presence in history is allowed to
* influence aElement's style is visited, get the value the property
* would have if allowed all properties to change as a result of
* :visited selectors (except for cases where getComputedStyle uses
* data from the frame).
*
* This is easier to implement than adding our property restrictions
* to this API, and is sufficient for the present testing
* requirements (which are essentially testing 'color').
*/
AString getVisitedDependentComputedStyle(in nsIDOMElement aElement,
in AString aPseudoElement,
in AString aPropertyName);
};

View file

@ -43,7 +43,7 @@
interface nsIBoxObject;
interface nsIDOMLocation;
[scriptable, uuid(B7E9211B-F29F-4E2D-9762-6BCBC64E5C05)]
[scriptable, uuid(42c27ca5-6065-42b6-ad9e-b748c1acd250)]
interface nsIDOMNSDocument : nsISupports
{
readonly attribute DOMString characterSet;
@ -87,9 +87,9 @@ interface nsIDOMNSDocument : nsISupports
* Callers from XUL documents should wait until the onload event has fired
* before calling this method.
*
* <a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8#documentlayout-elementfrompoint">preliminary spec</a>
* See <http://www.w3.org/TR/cssom-view/#the-documentview-interface>
*/
nsIDOMElement elementFromPoint(in long x, in long y);
nsIDOMElement elementFromPoint(in float x, in float y);
/**
* Release the current mouse capture if it is on an element within this

View file

@ -273,7 +273,9 @@ nsGeolocationRequest::Allow()
}
}
if (lastPosition && maximumAge > 0 && ( (PR_Now() / PR_USEC_PER_MSEC ) - maximumAge <= cachedPositionTime) ) {
if (lastPosition && maximumAge > 0 &&
( (PR_Now() / PR_USEC_PER_MSEC) - maximumAge <=
PRTime(cachedPositionTime) )) {
// okay, we can return a cached position
mAllowed = PR_TRUE;
@ -922,7 +924,7 @@ NS_IMETHODIMP
nsGeolocation::ClearWatch(PRInt32 aWatchId)
{
PRUint32 count = mWatchingCallbacks.Length();
if (aWatchId < 0 || count == 0 || aWatchId > count)
if (aWatchId < 0 || count == 0 || PRUint32(aWatchId) > count)
return NS_OK;
mWatchingCallbacks[aWatchId]->MarkCleared();

View file

@ -107,7 +107,11 @@ function popstateExpected(msg) {
}
function getColor(elem) {
return document.defaultView.getComputedStyle(elem, "").color;
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = document.defaultView.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
return utils.getVisitedDependentComputedStyle(elem, "", "color");
}
function getSHistory(theWindow)

View file

@ -205,7 +205,6 @@ MapPaperSizeToNativeEnum(LPDEVMODEW aDevMode,
#endif
const double kThreshold = 0.05;
PRBool foundEnum = PR_FALSE;
for (PRInt32 i=0;i<kNumPaperSizes;i++) {
double width = kPaperSizes[i].mWidth;
double height = kPaperSizes[i].mHeight;
@ -456,7 +455,7 @@ static void SetRadioOfGroup(HWND aDlg, int aRadId)
//--------------------------------------------------------
typedef struct {
char * mKeyStr;
const char * mKeyStr;
long mKeyId;
} PropKeyInfo;
@ -754,7 +753,6 @@ static HGLOBAL CreateGlobalDevModeAndInit(LPCWSTR aPrintName, nsIPrintSettings*
{
HGLOBAL hGlobalDevMode = NULL;
nsresult rv = NS_ERROR_FAILURE;
HANDLE hPrinter = NULL;
// const cast kludge for silly Win32 api's
LPWSTR printName = const_cast<wchar_t*>(aPrintName);
@ -863,7 +861,6 @@ ShowNativePrintDialog(HWND aHWnd,
//NS_ENSURE_ARG_POINTER(aHWnd);
NS_ENSURE_ARG_POINTER(aPrintSettings);
nsresult rv = NS_ERROR_FAILURE;
gDialogWasExtended = PR_FALSE;
HGLOBAL hGlobalDevMode = NULL;
@ -895,13 +892,12 @@ ShowNativePrintDialog(HWND aHWnd,
hDevNames = (HGLOBAL)::GlobalAlloc(GHND, sizeof(wchar_t) * (len + 1) +
sizeof(DEVNAMES));
DEVNAMES* pDevNames = (DEVNAMES*)::GlobalLock(hDevNames);
pDevNames->wDriverOffset = sizeof(DEVNAMES);
pDevNames->wDeviceOffset = sizeof(DEVNAMES);
pDevNames->wOutputOffset = sizeof(DEVNAMES)+len+1;
pDevNames->wDriverOffset = sizeof(DEVNAMES)/sizeof(wchar_t);
pDevNames->wDeviceOffset = sizeof(DEVNAMES)/sizeof(wchar_t);
pDevNames->wOutputOffset = sizeof(DEVNAMES)/sizeof(wchar_t)+len;
pDevNames->wDefault = 0;
wchar_t* device = &(((wchar_t*)pDevNames)[pDevNames->wDeviceOffset]);
wcscpy(device, printerName);
memcpy(pDevNames+1, printerName, (len + 1) * sizeof(wchar_t));
::GlobalUnlock(hDevNames);
// Create a Moveable Memory Object that holds a new DevMode

View file

@ -140,7 +140,7 @@ CPPSRCS += gfxDirectFBSurface.cpp
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
CPPSRCS += gfxQtPlatform.cpp gfxQPainterSurface.cpp
CPPSRCS += gfxQtPlatform.cpp gfxQPainterSurface.cpp gfxSharedImageSurface.cpp
CPPSRCS += gfxXlibSurface.cpp gfxQtNativeRenderer.cpp
ifdef MOZ_PANGO
CPPSRCS += gfxPangoFonts.cpp

46
ipc/app/fake/Makefile.in Normal file
View file

@ -0,0 +1,46 @@
# ***** 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 Corporation.
# Portions created by the Initial Developer are Copyright (C) 2010
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either 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
SIMPLE_PROGRAMS = mozilla-runtime
include $(topsrcdir)/config/rules.mk

View file

@ -0,0 +1,45 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
* ***** 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 Fake Mozilla Plugin App.
*
* The Initial Developer of the Original Code is
* Josh Aas <josh@mozilla.com>.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 <stdio.h>
int main()
{
printf ("All your process are belong to us.\n");
return 0;
}

View file

@ -60,7 +60,8 @@ DIRS += shell
endif
# FIXME: bug 515383 covers getting these working on wince
ifndef WINCE
# bug 530688 covers Android
ifneq (,$(filter-out WINCE ANDROID,$(OS_ARCH)))
ifdef ENABLE_TESTS
DIRS += jsapi-tests
endif

View file

@ -526,7 +526,7 @@ OS_COMPILE_CMMFLAGS += -fobjc-exceptions
endif
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS)
COMPILE_CXXFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS)
COMPILE_CXXFLAGS = $(VISIBILITY_FLAGS) $(STL_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS)
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS)
COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS)

View file

@ -206,6 +206,72 @@ MOZ_ARG_ENABLE_BOOL(compile-environment,
COMPILE_ENVIRONMENT=1,
COMPILE_ENVIRONMENT= )
dnl ========================================================
dnl = Android uses a very custom (hacky) toolchain; we need to do this
dnl = here, so that the compiler checks can succeed
dnl ========================================================
MOZ_ARG_WITH_STRING(android-ndk,
[ --with-android-ndk=DIR
location where the Android NDK can be found],
android_ndk=$withval)
MOZ_ARG_WITH_STRING(android-toolchain,
[ --with-android-toolchain=DIR
location of the android toolchain, default NDK/build/prebuilt/HOST/arm-eabi-4.4.0],
android_toolchain=$withval)
MOZ_ARG_WITH_STRING(android-platform,
[ --with-android-platform=DIR
location of platform dir, default NDK/build/platforms/android-5/arch-arm],
android_platform=$withval)
if test "$target" = "arm-android-eabi" ; then
if test -z "$android_ndk" ; then
AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
fi
if test -z "$android_toolchain" ; then
android_toolchain="$android_ndk"/build/prebuilt/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/arm-eabi-4.4.0
fi
if test -z "$android_platform" ; then
android_platform="$android_ndk"/build/platforms/android-5/arch-arm
fi
dnl set up compilers
AS="$android_toolchain"/bin/arm-eabi-as
CC="$android_toolchain"/bin/arm-eabi-gcc
CXX="$android_toolchain"/bin/arm-eabi-g++
CPP="$android_toolchain"/bin/arm-eabi-cpp
LD="$android_toolchain"/bin/arm-eabi-ld
AR="$android_toolchain"/bin/arm-eabi-ar
RANLIB="$android_toolchain"/bin/arm-eabi-ranlib
STRIP="$android_toolchain"/bin/arm-eabi-strip
CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions -march=armv5te -mthumb-interwork $CFLAGS"
CXXFLAGS="-mandroid -std=gnu++0x -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions -march=armv5te -mthumb-interwork $CXXFLAGS"
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
dnl prevent cross compile section from using these flags as host flags
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi
AC_DEFINE(ANDROID)
AC_DEFINE(FORCE_LITTLE_ENDIAN)
fi
dnl ========================================================
dnl Checks for compilers.
dnl ========================================================
@ -1206,9 +1272,7 @@ x86_64 | ia64)
;;
arm)
if test "$OS_ARCH" = "WINCE"; then
CPU_ARCH="$OS_TEST"
fi
CPU_ARCH=arm
;;
esac
@ -1250,8 +1314,8 @@ if test "$GNU_CC"; then
if test -z "$INTEL_CC"; then
# Don't use -Wcast-align with ICC
case "$CPU_ARCH" in
# And don't use it on hppa, ia64, sparc, since it's noisy there
hppa | ia64 | sparc)
# And don't use it on hppa, ia64, sparc, or arm since it's noisy there
hppa | ia64 | sparc | arm)
;;
*)
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
@ -1313,8 +1377,8 @@ if test "$GNU_CXX"; then
if test -z "$INTEL_CC"; then
# Don't use -Wcast-align with ICC
case "$CPU_ARCH" in
# And don't use it on hppa, ia64, sparc, since it's noisy there
hppa | ia64 | sparc)
# And don't use it on hppa, ia64, sparc, or arm since it's noisy there
hppa | ia64 | sparc | arm)
;;
*)
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
@ -2531,24 +2595,24 @@ sparc-*)
;;
esac
case "$target_os" in
linux*)
case "$target" in
*-linux*|*-android-eabi)
AC_DEFINE(AVMPLUS_UNIX)
AC_DEFINE(AVMPLUS_LINUX)
;;
darwin*)
*-darwin*)
AC_DEFINE(AVMPLUS_UNIX)
;;
solaris*)
*-solaris*)
AC_DEFINE(AVMPLUS_UNIX)
;;
freebsd*|kfreebsd*)
*-freebsd*|*-kfreebsd*)
AC_DEFINE(AVMPLUS_UNIX)
;;
*cygwin*|*mingw*|*mks*|*msvc*|*wince|*winmo)
*-cygwin*|*-mingw*|*-mks*|*-msvc*|*-wince|*-winmo)
AC_DEFINE(AVMPLUS_WIN32)
;;
*os2*)
*-os2*)
AC_DEFINE(AVMPLUS_OS2)
;;
*)
@ -3478,8 +3542,29 @@ dnl Put your C++ language/feature checks below
dnl ========================================================
AC_LANG_CPLUSPLUS
ARM_ABI_PREFIX=
HAVE_GCC3_ABI=
if test "$GNU_CC"; then
if test "$CPU_ARCH" = "arm" ; then
AC_CACHE_CHECK(for ARM EABI,
ac_cv_gcc_arm_eabi,
[AC_TRY_COMPILE([],
[
#if defined(__ARM_EABI__)
return 0;
#else
#error Not ARM EABI.
#endif
],
ac_cv_gcc_arm_eabi="yes",
ac_cv_gcc_arm_eabi="no")])
if test "$ac_cv_gcc_arm_eabi" = "yes"; then
ARM_ABI_PREFIX=eabi-
else
ARM_ABI_PREFIX=oabi-
fi
fi
AC_CACHE_CHECK(for gcc 3.0 ABI,
ac_cv_gcc_three_abi,
[AC_TRY_COMPILE([],
@ -3493,10 +3578,10 @@ if test "$GNU_CC"; then
ac_cv_gcc_three_abi="yes",
ac_cv_gcc_three_abi="no")])
if test "$ac_cv_gcc_three_abi" = "yes"; then
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
HAVE_GCC3_ABI=1
else
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc2}"
fi
fi
AC_SUBST(HAVE_GCC3_ABI)
@ -5099,6 +5184,7 @@ dnl JavaScript shell
dnl ========================================================
AC_HAVE_FUNCS(setlocale)
AC_HAVE_FUNCS(localeconv)
dnl ========================================================
dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW

View file

@ -44,7 +44,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef CROSS_COMPILE
#if defined(CROSS_COMPILE) && !defined(FORCE_BIG_ENDIAN) && !defined(FORCE_LITTLE_ENDIAN)
#include <prtypes.h>
#endif
@ -71,10 +71,10 @@ int main(int argc, char **argv)
printf("#undef IS_LITTLE_ENDIAN\n");
printf("#define IS_BIG_ENDIAN 1\n");
printf("#endif\n\n");
#elif defined(IS_LITTLE_ENDIAN)
#elif defined(IS_LITTLE_ENDIAN) || defined(FORCE_LITTLE_ENDIAN)
printf("#define IS_LITTLE_ENDIAN 1\n");
printf("#undef IS_BIG_ENDIAN\n\n");
#elif defined(IS_BIG_ENDIAN)
#elif defined(IS_BIG_ENDIAN) || defined(FORCE_BIG_ENDIAN)
printf("#undef IS_LITTLE_ENDIAN\n");
printf("#define IS_BIG_ENDIAN 1\n\n");
#else

View file

@ -732,6 +732,11 @@ js_InitRuntimeNumberState(JSContext *cx)
u.s.lo = 1;
number_constants[NC_MIN_VALUE].dval = u.d;
#ifndef HAVE_LOCALECONV
rt->thousandsSeparator = JS_strdup(cx, "'");
rt->decimalSeparator = JS_strdup(cx, ".");
rt->numGrouping = JS_strdup(cx, "\3\0");
#else
struct lconv *locale = localeconv();
rt->thousandsSeparator =
JS_strdup(cx, locale->thousands_sep ? locale->thousands_sep : "'");
@ -739,6 +744,7 @@ js_InitRuntimeNumberState(JSContext *cx)
JS_strdup(cx, locale->decimal_point ? locale->decimal_point : ".");
rt->numGrouping =
JS_strdup(cx, locale->grouping ? locale->grouping : "\3\0");
#endif
return rt->thousandsSeparator && rt->decimalSeparator && rt->numGrouping;
}

View file

@ -7277,6 +7277,16 @@ static bool arm_has_neon = false;
static bool arm_has_iwmmxt = false;
static bool arm_tests_initialized = false;
#ifdef ANDROID
// android doesn't have Elf32_auxv_t defined in elf.h, but it does have /proc/self/auxv
typedef struct {
uint32_t a_type;
union {
uint32_t a_val;
} a_un;
} Elf32_auxv_t;
#endif
static void
arm_read_auxv()
{

View file

@ -192,7 +192,7 @@ Dump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_FALSE;
jschar *chars = JS_GetStringChars(str);
fputs(NS_ConvertUTF16toUTF8(chars).get(), stderr);
fputs(NS_ConvertUTF16toUTF8(reinterpret_cast<const PRUnichar*>(chars)).get(), stderr);
return JS_TRUE;
}

View file

@ -170,40 +170,6 @@ nsBidi::nsBidi()
mMayAllocateRuns=PR_TRUE;
}
nsBidi::nsBidi(PRUint32 aMaxLength, PRUint32 aMaxRunCount)
{
Init();
nsresult rv = NS_OK;
/* allocate memory for arrays as requested */
if(aMaxLength>0) {
if( !GETINITIALDIRPROPSMEMORY(aMaxLength) ||
!GETINITIALLEVELSMEMORY(aMaxLength)
) {
mMayAllocateText=PR_FALSE;
rv = NS_ERROR_OUT_OF_MEMORY;
}
} else {
mMayAllocateText=PR_TRUE;
}
if(aMaxRunCount>0) {
if(aMaxRunCount==1) {
/* use simpleRuns[] */
mRunsSize=sizeof(Run);
} else if(!GETINITIALRUNSMEMORY(aMaxRunCount)) {
mMayAllocateRuns=PR_FALSE;
rv = NS_ERROR_OUT_OF_MEMORY;
}
} else {
mMayAllocateRuns=PR_TRUE;
}
if(NS_FAILED(rv)) {
Free();
}
}
nsBidi::~nsBidi()
{
Free();

View file

@ -443,41 +443,6 @@ public:
*/
nsBidi();
/** @brief Preallocating constructor
* Allocate an <code>nsBidi</code>
* object with preallocated memory for internal structures. This
* constructor provides an <code>nsBidi</code> object like
* the default constructor, but it also
* preallocates memory for internal structures according to the sizings
* supplied by the caller.<p> Subsequent functions will not allocate
* any more memory, and are thus guaranteed not to fail because of lack
* of memory.<p> The preallocation can be limited to some of the
* internal memory by setting some values to 0 here. That means that
* if, e.g., <code>aMaxRunCount</code> cannot be reasonably
* predetermined and should not be set to <code>aMaxLength</code> (the
* only failproof value) to avoid wasting memory, then
* <code>aMaxRunCount</code> could be set to 0 here and the internal
* structures that are associated with it will be allocated on demand,
* just like with the default constructor.
*
* If sufficient memory could not be allocated, no exception is thrown.
* Test whether mDirPropsSize == aMaxLength and/or mRunsSize == aMaxRunCount.
*
* @param aMaxLength is the maximum paragraph or line length that internal memory
* will be preallocated for. An attempt to associate this object with a
* longer text will fail, unless this value is 0, which leaves the allocation
* up to the implementation.
*
* @param aMaxRunCount is the maximum anticipated number of same-level runs
* that internal memory will be preallocated for. An attempt to access
* visual runs on an object that was not preallocated for as many runs
* as the text was actually resolved to will fail,
* unless this value is 0, which leaves the allocation up to the implementation.<p>
* The number of runs depends on the actual text and maybe anywhere between
* 1 and <code>aMaxLength</code>. It is typically small.<p>
*/
nsBidi(PRUint32 aMaxLength, PRUint32 aMaxRunCount);
/** @brief Destructor. */
virtual ~nsBidi();

View file

@ -1397,16 +1397,6 @@ nsBidiPresUtils::CalculateCharType(PRInt32& aOffset,
aOffset = offset;
}
nsresult nsBidiPresUtils::GetBidiEngine(nsBidi** aBidiEngine)
{
nsresult rv = NS_ERROR_FAILURE;
if (mBidiEngine) {
*aBidiEngine = mBidiEngine;
rv = NS_OK;
}
return rv;
}
nsresult nsBidiPresUtils::ProcessText(const PRUnichar* aText,
PRInt32 aLength,
nsBidiDirection aBaseDirection,

View file

@ -198,11 +198,6 @@ public:
nsCharType aCharType,
PRBool aIsOddLevel);
/**
* Return our nsBidi object (bidi reordering engine)
*/
nsresult GetBidiEngine(nsBidi** aBidiEngine);
/**
* Reorder plain text using the Unicode Bidi algorithm and send it to
* a rendering context for rendering.

View file

@ -7233,8 +7233,8 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext,
// If the frame's background is propagated to an ancestor, walk up to
// that ancestor.
const nsStyleBackground *bg;
while (!nsCSSRendering::FindBackground(aPresContext, aFrame, &bg)) {
nsStyleContext *bgSC;
while (!nsCSSRendering::FindBackground(aPresContext, aFrame, &bgSC)) {
aFrame = aFrame->GetParent();
NS_ASSERTION(aFrame, "root frame must paint");
}
@ -7652,6 +7652,13 @@ nsCSSFrameConstructor::DoContentStateChanged(nsIContent* aContent,
++mHoverGeneration;
}
if (aStateMask & NS_EVENT_STATE_VISITED) {
// Exposing information to the page about whether the link is
// visited or not isn't really something we can worry about here.
// FIXME: We could probably do this a bit better.
NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
}
PostRestyleEvent(aContent, rshint, hint);
}
}

View file

@ -78,6 +78,7 @@
#include "gfxImageSurface.h"
#include "nsStyleStructInlines.h"
#include "nsCSSFrameConstructor.h"
#include "nsCSSProps.h"
#include "nsCSSRenderingBorders.h"
@ -542,9 +543,40 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aStyleBorder,
nsStyleContext* aStyleContext,
PRIntn aSkipSides)
{
nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited();
const nsStyleBorder *styleBorder = aStyleContext->GetStyleBorder();
// Don't check RelevantLinkVisited here, since we want to take the
// same amount of time whether or not it's true.
if (!styleIfVisited) {
PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, *styleBorder,
aStyleContext, aSkipSides);
return;
}
nsStyleBorder newStyleBorder(*styleBorder);
NS_FOR_CSS_SIDES(side) {
newStyleBorder.SetBorderColor(side,
aStyleContext->GetVisitedDependentColor(
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color)[side]));
}
PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, newStyleBorder,
aStyleContext, aSkipSides);
}
void
nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aStyleBorder,
nsStyleContext* aStyleContext,
PRIntn aSkipSides)
{
nsMargin border;
nscoord twipsRadii[8];
@ -575,7 +607,8 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
// for determining the background color
nsStyleContext* bgContext = nsCSSRendering::FindNonTransparentBackground
(aStyleContext, compatMode == eCompatibility_NavQuirks ? PR_TRUE : PR_FALSE);
const nsStyleBackground* bgColor = bgContext->GetStyleBackground();
nscolor bgColor =
bgContext->GetVisitedDependentColor(eCSSProperty_background_color);
border = aStyleBorder.GetComputedBorder();
if ((0 == border.left) && (0 == border.right) &&
@ -659,7 +692,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
borderColors,
compositeColors,
aSkipSides,
bgColor->mBackgroundColor);
bgColor);
br.DrawBorders();
ctx->Restore();
@ -683,17 +716,16 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aStyleBorder,
const nsStyleOutline& aOutlineStyle,
nsStyleContext* aStyleContext)
{
nscoord twipsRadii[8];
// Get our style context's color struct.
const nsStyleColor* ourColor = aStyleContext->GetStyleColor();
const nsStyleOutline* ourOutline = aStyleContext->GetStyleOutline();
nscoord width;
aOutlineStyle.GetOutlineWidth(width);
ourOutline->GetOutlineWidth(width);
if (width == 0) {
// Empty outline
@ -702,10 +734,11 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
nsStyleContext* bgContext = nsCSSRendering::FindNonTransparentBackground
(aStyleContext, PR_FALSE);
const nsStyleBackground* bgColor = bgContext->GetStyleBackground();
nscolor bgColor =
bgContext->GetVisitedDependentColor(eCSSProperty_background_color);
// get the radius for our outline
GetBorderRadiusTwips(aOutlineStyle.mOutlineRadius, aBorderArea.width,
GetBorderRadiusTwips(ourOutline->mOutlineRadius, aBorderArea.width,
twipsRadii);
// When the outline property is set on :-moz-anonymous-block or
@ -740,7 +773,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
}
innerRect += aBorderArea.TopLeft();
nscoord offset = aOutlineStyle.mOutlineOffset;
nscoord offset = ourOutline->mOutlineOffset;
innerRect.Inflate(offset, offset);
// If the dirty rect is completely inside the border area (e.g., only the
// content is being painted), then we can skip out now
@ -765,17 +798,16 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
ComputePixelRadii(twipsRadii, outerRect, 0, twipsPerPixel,
&outlineRadii);
PRUint8 outlineStyle = aOutlineStyle.GetOutlineStyle();
PRUint8 outlineStyle = ourOutline->GetOutlineStyle();
PRUint8 outlineStyles[4] = { outlineStyle,
outlineStyle,
outlineStyle,
outlineStyle };
nscolor outlineColor;
// PR_FALSE means use the initial color; PR_TRUE means a color was
// set.
if (!aOutlineStyle.GetOutlineColor(outlineColor))
outlineColor = ourColor->mColor;
// This handles treating the initial color as 'currentColor'; if we
// ever want 'invert' back we'll need to do a bit of work here too.
nscolor outlineColor =
aStyleContext->GetVisitedDependentColor(eCSSProperty_outline_color);
nscolor outlineColors[4] = { outlineColor,
outlineColor,
outlineColor,
@ -800,7 +832,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
outlineRadii,
outlineColors,
nsnull, 0,
bgColor->mBackgroundColor);
bgColor);
br.DrawBorders();
ctx->Restore();
@ -926,6 +958,8 @@ nsCSSRendering::FindNonTransparentBackground(nsStyleContext* aContext,
while (context) {
const nsStyleBackground* bg = context->GetStyleBackground();
// No need to call GetVisitedDependentColor because it always uses
// this alpha component anyway.
if (NS_GET_A(bg->mBackgroundColor) > 0)
break;
@ -1022,22 +1056,22 @@ nsCSSRendering::FindBackgroundStyleFrame(nsIFrame* aForFrame)
* the resulting style context to use for the background information
* will be filled in to |aBackground|.
*/
const nsStyleBackground*
nsStyleContext*
nsCSSRendering::FindRootFrameBackground(nsIFrame* aForFrame)
{
return FindBackgroundStyleFrame(aForFrame)->GetStyleBackground();
return FindBackgroundStyleFrame(aForFrame)->GetStyleContext();
}
inline PRBool
FindElementBackground(nsIFrame* aForFrame, nsIFrame* aRootElementFrame,
const nsStyleBackground** aBackground)
nsStyleContext** aBackgroundSC)
{
if (aForFrame == aRootElementFrame) {
// We must have propagated our background to the viewport or canvas. Abort.
return PR_FALSE;
}
*aBackground = aForFrame->GetStyleBackground();
*aBackgroundSC = aForFrame->GetStyleContext();
// Return true unless the frame is for a BODY element whose background
// was propagated to the viewport.
@ -1074,15 +1108,15 @@ FindElementBackground(nsIFrame* aForFrame, nsIFrame* aRootElementFrame,
PRBool
nsCSSRendering::FindBackground(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsStyleBackground** aBackground)
nsStyleContext** aBackgroundSC)
{
nsIFrame* rootElementFrame =
aPresContext->PresShell()->FrameConstructor()->GetRootElementStyleFrame();
if (IsCanvasFrame(aForFrame)) {
*aBackground = FindCanvasBackground(aForFrame, rootElementFrame);
*aBackgroundSC = FindCanvasBackground(aForFrame, rootElementFrame);
return PR_TRUE;
} else {
return FindElementBackground(aForFrame, rootElementFrame, aBackground);
return FindElementBackground(aForFrame, rootElementFrame, aBackgroundSC);
}
}
@ -1387,8 +1421,8 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
NS_PRECONDITION(aForFrame,
"Frame is expected to be provided to PaintBackground");
const nsStyleBackground *background;
if (!FindBackground(aPresContext, aForFrame, &background)) {
nsStyleContext *sc;
if (!FindBackground(aPresContext, aForFrame, &sc)) {
// We don't want to bail out if moz-appearance is set on a root
// node. If it has a parent content node, bail because it's not
// a root, other wise keep going in order to let the theme stuff
@ -1403,11 +1437,11 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
return;
}
background = aForFrame->GetStyleBackground();
sc = aForFrame->GetStyleContext();
}
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, *background,
aDirtyRect, aBorderArea, sc,
*aForFrame->GetStyleBorder(), aFlags,
aBGClipRect);
}
@ -1548,7 +1582,7 @@ SetupBackgroundClip(gfxContext *aCtx, PRUint8 aBackgroundClip,
static nscolor
DetermineBackgroundColorInternal(nsPresContext* aPresContext,
const nsStyleBackground& aBackground,
nsStyleContext* aStyleContext,
nsIFrame* aFrame,
PRBool& aDrawBackgroundImage,
PRBool& aDrawBackgroundColor)
@ -1563,7 +1597,8 @@ DetermineBackgroundColorInternal(nsPresContext* aPresContext,
nscolor bgColor;
if (aDrawBackgroundColor) {
bgColor = aBackground.mBackgroundColor;
bgColor =
aStyleContext->GetVisitedDependentColor(eCSSProperty_background_color);
if (NS_GET_A(bgColor) == 0)
aDrawBackgroundColor = PR_FALSE;
} else {
@ -1572,7 +1607,8 @@ DetermineBackgroundColorInternal(nsPresContext* aPresContext,
// transparent, but we are expected to use white instead of whatever
// color was specified.
bgColor = NS_RGB(255, 255, 255);
if (aDrawBackgroundImage || !aBackground.IsTransparent())
if (aDrawBackgroundImage ||
!aStyleContext->GetStyleBackground()->IsTransparent())
aDrawBackgroundColor = PR_TRUE;
else
bgColor = NS_RGBA(0,0,0,0);
@ -1583,13 +1619,13 @@ DetermineBackgroundColorInternal(nsPresContext* aPresContext,
nscolor
nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
const nsStyleBackground& aBackground,
nsStyleContext* aStyleContext,
nsIFrame* aFrame)
{
PRBool drawBackgroundImage;
PRBool drawBackgroundColor;
return DetermineBackgroundColorInternal(aPresContext,
aBackground,
aStyleContext,
aFrame,
drawBackgroundImage,
drawBackgroundColor);
@ -2062,7 +2098,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBackground& aBackground,
nsStyleContext* aBackgroundSC,
const nsStyleBorder& aBorder,
PRUint32 aFlags,
nsRect* aBGClipRect)
@ -2098,7 +2134,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
PRBool drawBackgroundColor;
nscolor bgColor = DetermineBackgroundColorInternal(aPresContext,
aBackground,
aBackgroundSC,
aForFrame,
drawBackgroundImage,
drawBackgroundColor);
@ -2132,6 +2168,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// SetupCurrentBackgroundClip. (Arguably it should be the
// intersection, but that breaks the table painter -- in particular,
// taking the intersection breaks reftests/bugs/403249-1[ab].)
const nsStyleBackground *bg = aBackgroundSC->GetStyleBackground();
nsRect bgClipArea, dirtyRect;
gfxRect dirtyRectGfx;
PRUint8 currentBackgroundClip;
@ -2150,7 +2187,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// radii as the border code will.
// The background-color is drawn based on the bottom
// background-clip.
currentBackgroundClip = aBackground.BottomLayer().mClip;
currentBackgroundClip = bg->BottomLayer().mClip;
isSolidBorder =
(aFlags & PAINTBG_WILL_PAINT_BORDER) && IsOpaqueBorder(aBorder);
if (isSolidBorder)
@ -2180,12 +2217,12 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// Ensure we get invalidated for loads of the image. We need to do
// this here because this might be the only code that knows about the
// association of the style data with the frame.
aPresContext->SetupBackgroundImageLoaders(aForFrame, &aBackground);
aPresContext->SetupBackgroundImageLoaders(aForFrame, bg);
// We can skip painting the background color if a background image is opaque.
if (drawBackgroundColor &&
aBackground.BottomLayer().mRepeat == NS_STYLE_BG_REPEAT_XY &&
aBackground.BottomLayer().mImage.IsOpaque())
bg->BottomLayer().mRepeat == NS_STYLE_BG_REPEAT_XY &&
bg->BottomLayer().mImage.IsOpaque())
drawBackgroundColor = PR_FALSE;
// The background color is rendered over the entire dirty area,
@ -2199,8 +2236,8 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
}
if (drawBackgroundImage) {
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, &aBackground) {
const nsStyleBackground::Layer &layer = aBackground.mLayers[i];
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, bg) {
const nsStyleBackground::Layer &layer = bg->mLayers[i];
if (!aBGClipRect) {
PRUint8 newBackgroundClip =
isSolidBorder ? NS_STYLE_BG_CLIP_PADDING : layer.mClip;
@ -2214,7 +2251,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
}
if (!dirtyRectGfx.IsEmpty()) {
PaintBackgroundLayer(aPresContext, aRenderingContext, aForFrame, aFlags,
dirtyRect, aBorderArea, bgClipArea, aBackground,
dirtyRect, aBorderArea, bgClipArea, *bg,
layer);
}
}
@ -3014,6 +3051,8 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
nscoord endBevel = (aEndBevelOffset > 0)
? RoundFloatToPixel(0.5f * (float)aEndBevelOffset, twipsPerPixel, PR_TRUE) : 0;
PRUint8 ridgeGrooveSide = (horizontal) ? NS_SIDE_TOP : NS_SIDE_LEFT;
// FIXME: In theory, this should use the visited-dependent
// background color, but I don't care.
aContext.SetColor (
MakeBevelColor(ridgeGrooveSide, ridgeGroove, aBGColor->mBackgroundColor, aBorderColor));
nsRect rect(aBorder);
@ -3047,6 +3086,8 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
rect = aBorder;
ridgeGrooveSide = (NS_SIDE_TOP == ridgeGrooveSide) ? NS_SIDE_BOTTOM : NS_SIDE_RIGHT;
// FIXME: In theory, this should use the visited-dependent
// background color, but I don't care.
aContext.SetColor (
MakeBevelColor(ridgeGrooveSide, ridgeGroove, aBGColor->mBackgroundColor, aBorderColor));
if (horizontal) {

View file

@ -95,10 +95,23 @@ struct nsCSSRendering {
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aBorderStyle,
nsStyleContext* aStyleContext,
PRIntn aSkipSides = 0);
/**
* Like PaintBorder, but taking an nsStyleBorder argument instead of
* getting it from aStyleContext.
*/
static void PaintBorderWithStyleBorder(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aBorderStyle,
nsStyleContext* aStyleContext,
PRIntn aSkipSides = 0);
/**
* Render the outline for an element using css rendering rules
* for borders. aSkipSides is a bitmask of the sides to skip
@ -112,8 +125,6 @@ struct nsCSSRendering {
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aBorderStyle,
const nsStyleOutline& aOutlineStyle,
nsStyleContext* aStyleContext);
/**
@ -152,21 +163,21 @@ struct nsCSSRendering {
static PRBool IsCanvasFrame(nsIFrame* aFrame);
/**
* Fill in an nsStyleBackground to be used to paint the background
* Fill in an aBackgroundSC to be used to paint the background
* for an element. This applies the rules for propagating
* backgrounds between BODY, the root element, and the canvas.
* @return PR_TRUE if there is some meaningful background.
*/
static PRBool FindBackground(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsStyleBackground** aBackground);
nsStyleContext** aBackgroundSC);
/**
* As FindBackground, but the passed-in frame is known to be a root frame
* (returned from nsCSSFrameConstructor::GetRootElementStyleFrame())
* and there is always some meaningful background returned.
*/
static const nsStyleBackground* FindRootFrameBackground(nsIFrame* aForFrame);
static nsStyleContext* FindRootFrameBackground(nsIFrame* aForFrame);
/**
* Returns background style information for the canvas.
@ -179,7 +190,7 @@ struct nsCSSRendering {
* @param aBackground
* contains background style information for the canvas on return
*/
static const nsStyleBackground*
static nsStyleContext*
FindCanvasBackground(nsIFrame* aForFrame, nsIFrame* aRootElementFrame)
{
NS_ABORT_IF_FALSE(IsCanvasFrame(aForFrame), "not a canvas frame");
@ -189,7 +200,7 @@ struct nsCSSRendering {
// This should always give transparent, so we'll fill it in with the
// default color if needed. This seems to happen a bit while a page is
// being loaded.
return aForFrame->GetStyleBackground();
return aForFrame->GetStyleContext();
}
/**
@ -210,7 +221,7 @@ struct nsCSSRendering {
*/
static nscolor
DetermineBackgroundColor(nsPresContext* aPresContext,
const nsStyleBackground& aBackground,
nsStyleContext* aStyleContext,
nsIFrame* aFrame);
/**
@ -248,7 +259,7 @@ struct nsCSSRendering {
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBackground& aBackground,
nsStyleContext *aStyleContext,
const nsStyleBorder& aBorder,
PRUint32 aFlags,
nsRect* aBGClipRect = nsnull);

View file

@ -878,13 +878,6 @@ nsDisplayItem* nsDisplayList::RemoveBottom() {
return item;
}
void nsDisplayList::DeleteBottom() {
nsDisplayItem* item = RemoveBottom();
if (item) {
item->~nsDisplayItem();
}
}
void nsDisplayList::DeleteAll() {
nsDisplayItem* item;
while ((item = RemoveBottom()) != nsnull) {
@ -1072,10 +1065,10 @@ nsDisplayBackground::IsOpaque(nsDisplayListBuilder* aBuilder) {
if (mIsThemed)
return PR_FALSE;
const nsStyleBackground* bg;
if (!nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg))
nsStyleContext *bgSC;
if (!nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bgSC))
return PR_FALSE;
const nsStyleBackground* bg = bgSC->GetStyleBackground();
const nsStyleBackground::Layer& bottomLayer = bg->BottomLayer();
@ -1098,11 +1091,12 @@ nsDisplayBackground::IsUniform(nsDisplayListBuilder* aBuilder) {
if (mIsThemed)
return PR_FALSE;
const nsStyleBackground* bg;
nsStyleContext *bgSC;
PRBool hasBG =
nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg);
nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bgSC);
if (!hasBG)
return PR_TRUE;
const nsStyleBackground* bg = bgSC->GetStyleBackground();
if (bg->BottomLayer().mImage.IsEmpty() &&
bg->mImageCount == 1 &&
!nsLayoutUtils::HasNonZeroCorner(mFrame->GetStyleBorder()->mBorderRadius) &&
@ -1118,11 +1112,12 @@ nsDisplayBackground::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuild
"IsVaryingRelativeToMovingFrame called on non-moving frame!");
nsPresContext* presContext = mFrame->PresContext();
const nsStyleBackground* bg;
nsStyleContext *bgSC;
PRBool hasBG =
nsCSSRendering::FindBackground(presContext, mFrame, &bg);
nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bgSC);
if (!hasBG)
return PR_FALSE;
const nsStyleBackground* bg = bgSC->GetStyleBackground();
if (!bg->HasFixedBackground())
return PR_FALSE;
@ -1173,8 +1168,6 @@ nsDisplayOutline::Paint(nsDisplayListBuilder* aBuilder,
nsCSSRendering::PaintOutline(mFrame->PresContext(), *aCtx, mFrame,
mVisibleRect,
nsRect(offset, mFrame->GetSize()),
*mFrame->GetStyleBorder(),
*mFrame->GetStyleOutline(),
mFrame->GetStyleContext());
}
@ -1251,7 +1244,6 @@ nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder,
nsCSSRendering::PaintBorder(mFrame->PresContext(), *aCtx, mFrame,
mVisibleRect,
nsRect(offset, mFrame->GetSize()),
*mFrame->GetStyleBorder(),
mFrame->GetStyleContext(),
mFrame->GetSkipSides());
}

View file

@ -767,10 +767,6 @@ public:
*/
nsDisplayItem* RemoveBottom();
/**
* Remove an item from the bottom of the list and call its destructor.
*/
void DeleteBottom();
/**
* Remove all items from the list and call their destructors.
*/

View file

@ -261,31 +261,6 @@ nsFrameManager::Destroy()
mPresShell = nsnull;
}
nsIFrame*
nsFrameManager::GetCanvasFrame()
{
if (mRootFrame) {
// walk the children of the root frame looking for a frame with type==canvas
// start at the root
nsIFrame* childFrame = mRootFrame;
while (childFrame) {
// get each sibling of the child and check them, startig at the child
nsIFrame *siblingFrame = childFrame;
while (siblingFrame) {
if (siblingFrame->GetType() == nsGkAtoms::canvasFrame) {
// this is it
return siblingFrame;
} else {
siblingFrame = siblingFrame->GetNextSibling();
}
}
// move on to the child's child
childFrame = childFrame->GetFirstChild(nsnull);
}
}
return nsnull;
}
//----------------------------------------------------------------------
// Placeholder frame functions
@ -492,19 +467,6 @@ nsFrameManager::ClearAllUndisplayedContentIn(nsIContent* aParentContent)
}
}
void
nsFrameManager::ClearUndisplayedContentMap()
{
#ifdef DEBUG_UNDISPLAYED_MAP
static int i = 0;
printf("ClearUndisplayedContentMap(%d)\n", i++);
#endif
if (mUndisplayedMap) {
mUndisplayedMap->Clear();
}
}
//----------------------------------------------------------------------
nsresult
@ -747,12 +709,8 @@ TryStartingTransition(nsPresContext *aPresContext, nsIContent *aContent,
if (coverRule) {
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(coverRule);
*aNewStyleContext = aPresContext->StyleSet()->ResolveStyleForRules(
(*aNewStyleContext)->GetParent(),
(*aNewStyleContext)->GetPseudo(),
(*aNewStyleContext)->GetPseudoType(),
(*aNewStyleContext)->GetRuleNode(),
rules);
*aNewStyleContext = aPresContext->StyleSet()->
ResolveStyleByAddingRules(*aNewStyleContext, rules);
}
}

View file

@ -91,12 +91,6 @@ public:
*/
NS_HIDDEN_(void) Destroy();
/*
* Get the canvas frame, searching from the root frame down.
* The canvas frame may or may not exist, so this may return null.
*/
NS_HIDDEN_(nsIFrame*) GetCanvasFrame();
// Placeholder frame functions
NS_HIDDEN_(nsPlaceholderFrame*) GetPlaceholderFrameFor(nsIFrame* aFrame);
NS_HIDDEN_(nsresult)
@ -116,7 +110,6 @@ public:
NS_HIDDEN_(void) ClearUndisplayedContentIn(nsIContent* aContent,
nsIContent* aParentContent);
NS_HIDDEN_(void) ClearAllUndisplayedContentIn(nsIContent* aParentContent);
NS_HIDDEN_(void) ClearUndisplayedContentMap();
// Functions for manipulating the frame model
NS_HIDDEN_(nsresult) AppendFrames(nsIFrame* aParentFrame,

Some files were not shown because too many files have changed in this diff Show more