Merge cvs-trunk-mirror -> mozilla-central

--HG--
rename : js/src/jsarray.c => js/src/jsarray.cpp
rename : js/src/jsnum.c => js/src/jsnum.cpp
This commit is contained in:
benjamin@smedbergs.us 2008-03-12 16:32:37 -04:00
commit 22ab1903e9
151 changed files with 2751 additions and 715 deletions

View File

@ -73,9 +73,9 @@ pref("extensions.getAddons.showPane", true);
pref("extensions.getAddons.browseAddons", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%");
pref("extensions.getAddons.maxResults", 5);
pref("extensions.getAddons.recommended.browseURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/recommended");
pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/list/featured/all/10");
pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/list/featured/all/10/%OS%/%VERSION%");
pref("extensions.getAddons.search.browseURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/search?q=%TERMS%");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/search/%TERMS%");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/10/%OS%/%VERSION%");
// Blocklist preferences
pref("extensions.blocklist.enabled", true);

View File

@ -41,14 +41,26 @@
<menu id="file-menu" label="&fileMenu.label;"
accesskey="&fileMenu.accesskey;">
<menupopup id="menu_FilePopup" onpopupshowing="getContentAreaFrameCount();">
<menuitem label="&newNavigatorCmd.label;"
<menuitem id="menu_newNavigator"
label="&newNavigatorCmd.label;"
accesskey="&newNavigatorCmd.accesskey;"
key="key_newNavigator"
command="cmd_newNavigator"/>
<menuitem command="cmd_newNavigatorTab" key="key_newNavigatorTab"
label="&tabCmd.label;" accesskey="&tabCmd.accesskey;"/>
<menuitem label="&openLocationCmd.label;" accesskey="&openLocationCmd.accesskey;" key="focusURLBar" command="Browser:OpenLocation"/>
<menuitem label="&openFileCmd.label;" accesskey="&openFileCmd.accesskey;" key="openFileKb" command="Browser:OpenFile"/>
<menuitem id="menu_newNavigatorTab"
label="&tabCmd.label;"
command="cmd_newNavigatorTab"
key="key_newNavigatorTab"
accesskey="&tabCmd.accesskey;"/>
<menuitem id="menu_openLocation"
label="&openLocationCmd.label;"
command="Browser:OpenLocation"
key="focusURLBar"
accesskey="&openLocationCmd.accesskey;"/>
<menuitem id="menu_openFile"
label="&openFileCmd.label;"
command="Browser:OpenFile"
key="openFileKb"
accesskey="&openFileCmd.accesskey;"/>
<menuitem id="menu_closeWindow" hidden="true" command="cmd_closeWindow" key="key_closeWindow" label="&closeWindow.label;" accesskey="&closeWindow.accesskey;"/>
<menuitem id="menu_close" label="&closeCmd.label;" key="key_close" accesskey="&closeCmd.accesskey;" command="cmd_close"/>
<menuseparator/>
@ -412,8 +424,10 @@
<menuitem label="&addCurPagesCmd.label;"
command="Browser:BookmarkAllTabs" key="bookmarkAllTabsKb"/>
<menuseparator id="organizeBookmarksSeparator"/>
<menuitem label="&showAllBookmarksCmd2.label;"
command="Browser:ShowAllBookmarks" key="manBookmarkKb"/>
<menuitem id="bookmarksShowAll"
label="&showAllBookmarksCmd2.label;"
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menu id="bookmarksToolbarFolderMenu"
class="menu-iconic bookmark-item"
container="true">
@ -432,7 +446,7 @@
<menupopup id="menu_ToolsPopup">
<menuitem label="&search.label;" accesskey="&search.accesskey;"
key="key_search" command="Tools:Search"/>
<menuseparator/>
<menuseparator id="browserToolsSeparator"/>
<menuitem id="menu_openDownloads" label="&downloads.label;"
accesskey="&downloads.accesskey;"
key="key_openDownloads" command="Tools:Downloads"/>

View File

@ -637,69 +637,86 @@ var BookmarksEventHandler = {
*/
onPopupShowing: function BM_onPopupShowing(event) {
var target = event.originalTarget;
if (target.localName == "menupopup" &&
target.id != "bookmarksMenuPopup" &&
target.getAttribute("anonid") != "chevronPopup") {
// Add the "Open All in Tabs" menuitem if there are
// at least two menuitems with places result nodes.
// Add the "Open (Feed Name)" menuitem if it's a livemark with a siteURI.
var numNodes = 0;
var hasMultipleEntries = false;
var currentChild = target.firstChild;
while (currentChild) {
if (currentChild.localName == "menuitem" && currentChild.node)
numNodes++;
if (!target.hasAttribute("placespopup"))
return;
// If the menuitem already exists, do nothing.
if (currentChild.getAttribute("openInTabs") == "true")
return;
if (currentChild.hasAttribute("siteURI"))
return;
currentChild = currentChild.nextSibling;
}
if (numNodes > 1)
hasMultipleEntries = true;
var itemId = target._resultNode.itemId;
var siteURIString = "";
if (itemId != -1 && PlacesUtils.livemarks.isLivemark(itemId)) {
var siteURI = PlacesUtils.livemarks.getSiteURI(itemId);
if (siteURI)
siteURIString = siteURI.spec;
}
if (hasMultipleEntries || siteURIString) {
var separator = document.createElement("menuseparator");
target.appendChild(separator);
if (siteURIString) {
var openHomePage = document.createElement("menuitem");
openHomePage.setAttribute("siteURI", siteURIString);
openHomePage.setAttribute("oncommand",
"openUILink(this.getAttribute('siteURI'), event);");
// If a user middle-clicks this item we serve the oncommand event
// We are using checkForMiddleClick because of Bug 246720
// Note: stopPropagation is needed to avoid serving middle-click
// with BT_onClick that would open all items in tabs
openHomePage.setAttribute("onclick",
"checkForMiddleClick(this, event); event.stopPropagation();");
openHomePage.setAttribute("label",
PlacesUtils.getFormattedString("menuOpenLivemarkOrigin.label",
[target.parentNode.getAttribute("label")]));
target.appendChild(openHomePage);
}
if (hasMultipleEntries) {
var openInTabs = document.createElement("menuitem");
openInTabs.setAttribute("openInTabs", "true");
openInTabs.setAttribute("oncommand",
"PlacesUtils.openContainerNodeInTabs(this.parentNode._resultNode, event);");
openInTabs.setAttribute("label",
gNavigatorBundle.getString("menuOpenAllInTabs.label"));
target.appendChild(openInTabs);
// Check if the popup contains at least 2 menuitems with places nodes
var numNodes = 0;
var hasMultipleURIs = false;
var currentChild = target.firstChild;
while (currentChild) {
if (currentChild.localName == "menuitem" && currentChild.node) {
if (++numNodes == 2) {
hasMultipleURIs = true;
break;
}
}
currentChild = currentChild.nextSibling;
}
var itemId = target._resultNode.itemId;
var siteURIString = "";
if (itemId != -1 && PlacesUtils.livemarks.isLivemark(itemId)) {
var siteURI = PlacesUtils.livemarks.getSiteURI(itemId);
if (siteURI)
siteURIString = siteURI.spec;
}
if (!siteURIString && target._endOptOpenSiteURI) {
target.removeChild(target._endOptOpenSiteURI);
target._endOptOpenSiteURI = null;
}
if (!hasMultipleURIs && target._endOptOpenAllInTabs) {
target.removeChild(target._endOptOpenAllInTabs);
target._endOptOpenAllInTabs = null;
}
if (!(hasMultipleURIs || siteURIString)) {
// we don't have to show any option
if (target._endOptSeparator) {
target.removeChild(target._endOptSeparator);
target._endOptSeparator = null;
target._endMarker = -1;
}
return;
}
if (!target._endOptSeparator) {
// create a separator before options
target._endOptSeparator = document.createElement("menuseparator");
target._endOptSeparator.setAttribute("builder", "end");
target._endMarker = target.childNodes.length;
target.appendChild(target._endOptSeparator);
}
if (siteURIString && !target._endOptOpenSiteURI) {
// Add "Open (Feed Name)" menuitem if it's a livemark with a siteURI
target._endOptOpenSiteURI = document.createElement("menuitem");
target._endOptOpenSiteURI.setAttribute("siteURI", siteURIString);
target._endOptOpenSiteURI.setAttribute("oncommand",
"openUILink(this.getAttribute('siteURI'), event);");
// If a user middle-clicks this item we serve the oncommand event
// We are using checkForMiddleClick because of Bug 246720
// Note: stopPropagation is needed to avoid serving middle-click
// with BT_onClick that would open all items in tabs
target._endOptOpenSiteURI.setAttribute("onclick",
"checkForMiddleClick(this, event); event.stopPropagation();");
target._endOptOpenSiteURI.setAttribute("label",
PlacesUtils.getFormattedString("menuOpenLivemarkOrigin.label",
[target.parentNode.getAttribute("label")]));
target.appendChild(target._endOptOpenSiteURI);
}
if (hasMultipleURIs && !target._endOptOpenAllInTabs) {
// Add the "Open All in Tabs" menuitem if there are
// at least two menuitems with places result nodes.
target._endOptOpenAllInTabs = document.createElement("menuitem");
target._endOptOpenAllInTabs.setAttribute("oncommand",
"PlacesUtils.openContainerNodeInTabs(this.parentNode._resultNode, event);");
target._endOptOpenAllInTabs.setAttribute("label",
gNavigatorBundle.getString("menuOpenAllInTabs.label"));
target.appendChild(target._endOptOpenAllInTabs);
}
},

View File

@ -78,6 +78,8 @@
<!-- This is the view that manage the popup -->
<field name="_rootView">PlacesUtils.getViewForNode(this);</field>
<field name="_built">false</field>
<method name="onDragOver">
<parameter name="aEvent"/>
<parameter name="aFlavour"/>
@ -231,14 +233,14 @@
// draw the drop indicator outside of them
var betweenMarkers = true;
if (this._startMarker != -1 &&
target.boxObject.y < this.childNodes[this._startMarker].boxObject.y)
target.boxObject.y <= this.childNodes[this._startMarker].boxObject.y)
betweenMarkers = false;
if (this._endMarker != -1 &&
target.boxObject.y > this.childNodes[this._endMarker].boxObject.y)
target.boxObject.y >= this.childNodes[this._endMarker].boxObject.y)
betweenMarkers = false;
// hide the dropmarker if current node is not a places bookmark item
return !(target && betweenMarkers && this.canDrop());
return !(target && target.node && betweenMarkers && this.canDrop());
]]></body>
</method>
@ -452,6 +454,36 @@
</implementation>
<handlers>
<handler event="DOMMenuItemActive"><![CDATA[
var node = event.target;
if (node.parentNode != this)
return;
#ifdef XP_MACOSX
// XXXschonfeld: The following check is a temporary hack
// until bug 420033 is resolved.
while (node) {
if (node.id == "bookmarksMenuPopup" || node.id == "goPopup")
return;
node = node.parentNode;
}
#endif
if (window.XULBrowserWindow) {
var nodeItem = event.target.node;
if (nodeItem && PlacesUtils.nodeIsURI(nodeItem))
window.XULBrowserWindow.setOverLink(nodeItem.uri, null);
}
]]></handler>
<handler event="DOMMenuItemInactive"><![CDATA[
var node = event.target;
if (node.parentNode != this)
return;
if (window.XULBrowserWindow)
window.XULBrowserWindow.setOverLink("", null);
]]></handler>
<handler event="draggesture" action="if (event.target.node) nsDragAndDrop.startDrag(event, this);"/>
<handler event="dragdrop" action="nsDragAndDrop.drop(event, this);"/>
<handler event="dragover" action="nsDragAndDrop.dragOver(event, this);"/>
@ -494,14 +526,13 @@
readonly="true"
onget="return this._controller;"/>
<field name="_built">false</field>
<method name="onPopupShowing">
<parameter name="aEvent"/>
<body><![CDATA[
var popup = aEvent.target;
var resultNode = popup._resultNode;
resultNode.containerOpen = true;
if (!resultNode.containerOpen)
resultNode.containerOpen = true;
if (!popup._built)
this._rebuild(popup);
]]></body>
@ -522,58 +553,6 @@
]]></body>
</method>
<method name="_cleanMenu">
<parameter name="aPopup"/>
<body><![CDATA[
// Find static menuitems that should go at the start
// and end of the menu, marked by builder="start" and
// builder="end" attributes, and keep track of their indices.
// All of the items between the start and end should be removed.
var items = [];
aPopup._startMarker = -1;
aPopup._endMarker = -1;
for (var i = 0; i < aPopup.childNodes.length; ++i) {
var item = aPopup.childNodes[i];
if (item.getAttribute("builder") == "start") {
aPopup._startMarker = i;
continue;
}
if (item.getAttribute("builder") == "end") {
aPopup._endMarker = i;
continue;
}
if ((aPopup._startMarker != -1) && (aPopup._endMarker == -1))
items.push(item);
}
// If static items at the beginning were found, remove all items between
// them and the static content at the end.
for (var i = 0; i < items.length; ++i) {
// skip the empty menu item
if (aPopup._emptyMenuItem != items[i]) {
aPopup.removeChild(items[i]);
if (this._endMarker > 0)
--this._endMarker;
}
}
// If no static items were found at the beginning, remove all items before
// the static items at the end.
if (aPopup._startMarker == -1) {
var end = aPopup._endMarker == -1 ?
aPopup.childNodes.length - 1 : aPopup._endMarker - 1;
for (var i = end; i >=0; i--) {
// skip the empty menu item
if (aPopup._emptyMenuItem != aPopup.childNodes[i]) {
aPopup.removeChild(aPopup.childNodes[i]);
if (aPopup._endMarker > 0)
--aPopup._endMarker;
}
}
}
]]></body>
</method>
<method name="removeItem">
<parameter name="child"/>
<body><![CDATA[
@ -637,7 +616,7 @@
<method name="_rebuild">
<parameter name="aPopup"/>
<body><![CDATA[
this._cleanMenu(aPopup);
PlacesUtils.cleanPlacesPopup(aPopup);
var cc = aPopup._resultNode.childCount;
if (cc > 0) {

View File

@ -983,10 +983,20 @@
<body><![CDATA[
var element =
PlacesUtils.createMenuItemForNode(aChild, this._containerNodesMap);
if (aBefore)
aParentPopup.insertBefore(element, aBefore);
else
aParentPopup.appendChild(element);
else {
// Add the new element to the menu. If there is static content at
// the end of the menu, add the element before that. Otherwise,
// just add to the end.
if (aParentPopup._endMarker != -1) {
aParentPopup.insertBefore(element,
aParentPopup.childNodes[aParentPopup._endMarker++]);
}
else
aParentPopup.appendChild(element);
}
]]></body>
</method>
@ -996,12 +1006,7 @@
if (aPopup._built)
return;
// remove previous menu items
while (aPopup.hasChildNodes())
aPopup.removeChild(aPopup.firstChild);
// restore the empty-menu item if has been created already
if (aPopup._emptyMenuItem)
aPopup.appendChild(aPopup._emptyMenuItem);
PlacesUtils.cleanPlacesPopup(aPopup);
var resultNode = aPopup._resultNode;
if (!resultNode.containerOpen)
@ -1018,8 +1023,10 @@
}
}
else {
// add element to show it is empty.
this._showEmptyMenuItem(aPopup);
// This menu is empty. If there is no static content, add
// an element to show it is empty.
if (aPopup._startMarker == -1 && aPopup._endMarker == -1)
this._showEmptyMenuItem(aPopup);
}
aPopup._built = true;
]]></body>

View File

@ -1853,7 +1853,6 @@ var PlacesUtils = {
if (this.uriTypes.indexOf(type) != -1) {
element = document.createElement("menuitem");
element.setAttribute("statustext", aNode.uri);
element.className = "menuitem-iconic bookmark-item";
}
else if (this.containerTypes.indexOf(type) != -1) {
@ -1896,6 +1895,54 @@ var PlacesUtils = {
return element;
},
cleanPlacesPopup: function PU_cleanPlacesPopup(aPopup) {
// Find static menuitems at the start and at the end of the menupopup,
// marked by builder="start" and builder="end" attributes, and set
// markers to keep track of their indices.
var items = [];
aPopup._startMarker = -1;
aPopup._endMarker = -1;
for (var i = 0; i < aPopup.childNodes.length; ++i) {
var item = aPopup.childNodes[i];
if (item.getAttribute("builder") == "start") {
aPopup._startMarker = i;
continue;
}
if (item.getAttribute("builder") == "end") {
aPopup._endMarker = i;
continue;
}
if ((aPopup._startMarker != -1) && (aPopup._endMarker == -1))
items.push(item);
}
// If static items at the beginning were found, remove all items between
// them and the static content at the end.
for (var i = 0; i < items.length; ++i) {
// skip the empty menu item
if (aPopup._emptyMenuItem != items[i]) {
aPopup.removeChild(items[i]);
if (this._endMarker > 0)
--this._endMarker;
}
}
// If no static items were found at the beginning, remove all items before
// the static items at the end.
if (aPopup._startMarker == -1) {
var end = aPopup._endMarker == -1 ?
aPopup.childNodes.length - 1 : aPopup._endMarker - 1;
for (var i = end; i >= 0; i--) {
// skip the empty menu item
if (aPopup._emptyMenuItem != aPopup.childNodes[i]) {
aPopup.removeChild(aPopup.childNodes[i]);
if (aPopup._endMarker > 0)
--aPopup._endMarker;
}
}
}
},
getBestTitle: function PU_getBestTitle(aNode) {
var title;
if (!aNode.title && this.uriTypes.indexOf(aNode.type) != -1) {

View File

@ -77,6 +77,7 @@ problems and installation issues with Firefox.
- Useful optional software
The following packages enable additional features in Firefox. Download
locations are listed below with a detailed description of the features.
+ Remote Workplace Server (RWS), version 0.8
+ Doodle's Screen Saver (DSSaver), version 1.8 or later
================================================================================
@ -193,10 +194,33 @@ behavior of Firefox on OS/2:
Use this to run two instances of Firefox simultaneously (like e.g. debug
and optimized version).
- set MOZ_NO_RWS=1
Use this to disable Remote Workplace Server support (see below).
Find more information on this topic and other tips on
http://www.os2bbs.com/os2news/Warpzilla.html
Support for WPS objects in the browser
--------------------------------------
Firefox can make use of Rich Walsh's Remote Workplace Server (RWS) library to
access Workplace Shell objects from the browser. This allows helper applications
for downloaded files to be selected based on their default WPS association. In
addition, the WPS icons of files will be displayed in the download dialog and in
directory views.
To enable this functionality, Firefox has to find the RWS DLLs. They have to be
located in a directory on the LIBPATH, in the Firefox directory, or already be
registered as a WPS class. For eComStation 2 this is already the case. If RWS
is not yet available on your system, download it from
http://hobbes.nmsu.edu/cgi-bin/h-search?key=rws08dll
If RWS is found on the system, it is used by Firefox automatically. In case you
need to disable RWS support, create an environment variable MOZ_NO_RWS and set
it to 1.
Idle timer for internal cleanups
--------------------------------

View File

@ -122,6 +122,7 @@ export::
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
-DMOZ_ENABLE_LIBXUL=$(MOZ_ENABLE_LIBXUL) \
-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
-DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
-DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \

View File

@ -214,6 +214,7 @@ MOZ_HUNSPELL_LIBS = @MOZ_HUNSPELL_LIBS@
MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLAGS@
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
MOZ_NATIVE_BZ2 = @SYSTEM_BZ2@
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@
MOZ_NATIVE_PNG = @SYSTEM_PNG@
MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@
@ -409,6 +410,16 @@ endif
ZLIB_REQUIRES = zlib
endif
ifdef MOZ_NATIVE_BZ2
BZ2_CFLAGS = @BZ2_CFLAGS@
BZ2_LIBS = @BZ2_LIBS@
BZ2_REQUIRES =
else
BZ2_CFLAGS = @MOZ_BZ2_CFLAGS@
BZ2_LIBS = @MOZ_BZ2_LIBS@
BZ2_REQUIRES = libbz2
endif
ifdef MOZ_NATIVE_PNG
PNG_CFLAGS = @PNG_CFLAGS@
PNG_LIBS = @PNG_LIBS@

View File

@ -971,3 +971,6 @@ libsn/sn-util.h
#if MOZ_NATIVE_HUNSPELL==1
hunspell.hxx
#endif
#if MOZ_NATIVE_BZ2==1
bzlib.h
#endif

View File

@ -921,6 +921,8 @@ MOZ_JPEG_CFLAGS=
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
MOZ_ZLIB_CFLAGS=
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
MOZ_BZ2_CFLAGS=
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
MOZ_PNG_CFLAGS=
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
@ -948,6 +950,7 @@ if test -n "$CROSS_COMPILE"; then
OS_RELEASE=
case "${target_os}" in
linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
mingw*) OS_ARCH=WINNT ;;
wince*) OS_ARCH=WINCE ;;
@ -1478,7 +1481,7 @@ case "$host" in
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
;;
*-linux*)
*-linux*|*-kfreebsd*-gnu)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
@ -2470,7 +2473,7 @@ dnl ========================================================
dnl = Flags to strip unused symbols from .so components
dnl ========================================================
case "$target" in
*-linux*)
*-linux*|*-kfreebsd*-gnu)
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
;;
*-solaris*)
@ -3144,7 +3147,7 @@ then
fi
;;
*-*-linux*)
*-*-linux*|*-*-kfreebsd*-gnu)
AC_DEFINE(_REENTRANT)
;;
@ -3958,22 +3961,22 @@ if test -n "$MOZ_NATIVE_NSS"; then
NSS_LIBS="$NSS_LIBS -lcrmf"
else
NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
NSS_DEP_LIBS='\\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(DLL_PREFIX)smime'$NSS_VERSION'$(DLL_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(DLL_PREFIX)ssl'$NSS_VERSION'$(DLL_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(DLL_PREFIX)nss'$NSS_VERSION'$(DLL_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(DLL_PREFIX)nssutil'$NSS_VERSION'$(DLL_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(DLL_PREFIX)softokn'$NSS_VERSION'$(DLL_SUFFIX)'
NSS_DEP_LIBS="\
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
NSS_LIBS='\\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)nssutil'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)softokn'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX)'
NSS_LIBS="\
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
else
NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
fi
@ -4060,6 +4063,35 @@ if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
fi
dnl system BZIP2 Support
dnl ========================================================
MOZ_ARG_WITH_STRING(system-bz2,
[ --with-system-bz2[=PFX]
Use system libbz2 [installed at prefix PFX]],
BZ2_DIR=$withval)
_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
fi
if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
SYSTEM_BZ2=
else
AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
[SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS
if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
BZ2_CFLAGS="-I${BZ2_DIR}/include"
BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
fi
dnl system PNG Support
dnl ========================================================
MOZ_ARG_WITH_STRING(system-png,
@ -7672,11 +7704,14 @@ AC_SUBST(SYSTEM_MAKEDEPEND)
AC_SUBST(SYSTEM_JPEG)
AC_SUBST(SYSTEM_PNG)
AC_SUBST(SYSTEM_ZLIB)
AC_SUBST(SYSTEM_BZ2)
AC_SUBST(JPEG_CFLAGS)
AC_SUBST(JPEG_LIBS)
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
AC_SUBST(BZ2_CFLAGS)
AC_SUBST(BZ2_LIBS)
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)
@ -7684,6 +7719,8 @@ AC_SUBST(MOZ_JPEG_CFLAGS)
AC_SUBST(MOZ_JPEG_LIBS)
AC_SUBST(MOZ_ZLIB_CFLAGS)
AC_SUBST(MOZ_ZLIB_LIBS)
AC_SUBST(MOZ_BZ2_CFLAGS)
AC_SUBST(MOZ_BZ2_LIBS)
AC_SUBST(MOZ_PNG_CFLAGS)
AC_SUBST(MOZ_PNG_LIBS)

View File

@ -96,7 +96,7 @@
#include "nsPIBoxObject.h"
#include "nsIDOMNSDocument.h"
#include "nsIDOMNSElement.h"
#include "nsTextRectangle.h"
#include "nsClientRect.h"
#ifdef MOZ_SVG
#include "nsSVGUtils.h"
#endif
@ -828,8 +828,8 @@ RoundFloat(double aValue)
}
static void
SetTextRectangle(const nsRect& aLayoutRect, nsPresContext* aPresContext,
nsTextRectangle* aRect)
SetClientRect(const nsRect& aLayoutRect, nsPresContext* aPresContext,
nsClientRect* aRect)
{
double scale = 65536.0;
// Round to the nearest 1/scale units. We choose scale so it can be represented
@ -844,10 +844,10 @@ SetTextRectangle(const nsRect& aLayoutRect, nsPresContext* aPresContext,
}
NS_IMETHODIMP
nsNSElementTearoff::GetBoundingClientRect(nsIDOMTextRectangle** aResult)
nsNSElementTearoff::GetBoundingClientRect(nsIDOMClientRect** aResult)
{
// Weak ref, since we addref it below
nsTextRectangle* rect = new nsTextRectangle();
nsClientRect* rect = new nsClientRect();
if (!rect)
return NS_ERROR_OUT_OF_MEMORY;
@ -862,37 +862,37 @@ nsNSElementTearoff::GetBoundingClientRect(nsIDOMTextRectangle** aResult)
nsPresContext* presContext = frame->PresContext();
nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(frame,
GetContainingBlockForClientRect(frame));
SetTextRectangle(r, presContext, rect);
SetClientRect(r, presContext, rect);
return NS_OK;
}
struct RectListBuilder : public nsLayoutUtils::RectCallback {
nsPresContext* mPresContext;
nsTextRectangleList* mRectList;
nsresult mRV;
nsPresContext* mPresContext;
nsClientRectList* mRectList;
nsresult mRV;
RectListBuilder(nsPresContext* aPresContext, nsTextRectangleList* aList)
RectListBuilder(nsPresContext* aPresContext, nsClientRectList* aList)
: mPresContext(aPresContext), mRectList(aList),
mRV(NS_OK) {}
virtual void AddRect(const nsRect& aRect) {
nsRefPtr<nsTextRectangle> rect = new nsTextRectangle();
nsRefPtr<nsClientRect> rect = new nsClientRect();
if (!rect) {
mRV = NS_ERROR_OUT_OF_MEMORY;
return;
}
SetTextRectangle(aRect, mPresContext, rect);
SetClientRect(aRect, mPresContext, rect);
mRectList->Append(rect);
}
};
NS_IMETHODIMP
nsNSElementTearoff::GetClientRects(nsIDOMTextRectangleList** aResult)
nsNSElementTearoff::GetClientRects(nsIDOMClientRectList** aResult)
{
*aResult = nsnull;
nsRefPtr<nsTextRectangleList> rectList = new nsTextRectangleList();
nsRefPtr<nsClientRectList> rectList = new nsClientRectList();
if (!rectList)
return NS_ERROR_OUT_OF_MEMORY;
@ -2233,6 +2233,15 @@ nsGenericElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
return nsGenericElement::doPreHandleEvent(this, aVisitor);
}
static nsIContent*
FindFirstNonNativeAnonymousAncestor(nsIContent* aContent)
{
while (aContent && aContent->IsNativeAnonymous()) {
aContent = aContent->GetParent();
}
return aContent;
}
nsresult
nsGenericElement::doPreHandleEvent(nsIContent* aContent,
nsEventChainPreVisitor& aVisitor)
@ -2260,10 +2269,10 @@ nsGenericElement::doPreHandleEvent(nsIContent* aContent,
(aVisitor.mEvent->originalTarget == aContent &&
(aVisitor.mRelatedTargetIsInAnon =
relatedTarget->IsInNativeAnonymousSubtree()))) {
nsIContent* nonAnon = aContent->FindFirstNonNativeAnonymous();
nsIContent* nonAnon = FindFirstNonNativeAnonymousAncestor(aContent);
if (nonAnon) {
nsIContent* nonAnonRelated =
relatedTarget->FindFirstNonNativeAnonymous();
FindFirstNonNativeAnonymousAncestor(relatedTarget);
if (nonAnonRelated) {
if (nonAnon == nonAnonRelated ||
nsContentUtils::ContentIsDescendantOf(nonAnonRelated, nonAnon)) {

View File

@ -81,6 +81,7 @@ EXPORTS = \
$(NULL)
CPPSRCS = \
nsClientRect.cpp \
nsGenericHTMLElement.cpp \
nsFormSubmission.cpp \
nsImageMapUtils.cpp \
@ -130,7 +131,6 @@ CPPSRCS = \
nsHTMLTableSectionElement.cpp \
nsHTMLTextAreaElement.cpp \
nsHTMLTitleElement.cpp \
nsTextRectangle.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.

View File

@ -0,0 +1,112 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Novell code.
*
* The Initial Developer of the Original Code is
* Novell Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Robert O'Callahan <robert@ocallahan.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsClientRect.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfoID.h"
NS_INTERFACE_TABLE_HEAD(nsClientRect)
NS_INTERFACE_TABLE1(nsClientRect, nsIDOMClientRect)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(ClientRect)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsClientRect)
NS_IMPL_RELEASE(nsClientRect)
nsClientRect::nsClientRect()
: mX(0.0), mY(0.0), mWidth(0.0), mHeight(0.0)
{
}
NS_IMETHODIMP
nsClientRect::GetLeft(float* aResult)
{
*aResult = mX;
return NS_OK;
}
NS_IMETHODIMP
nsClientRect::GetTop(float* aResult)
{
*aResult = mY;
return NS_OK;
}
NS_IMETHODIMP
nsClientRect::GetRight(float* aResult)
{
*aResult = mX + mWidth;
return NS_OK;
}
NS_IMETHODIMP
nsClientRect::GetBottom(float* aResult)
{
*aResult = mY + mHeight;
return NS_OK;
}
NS_INTERFACE_TABLE_HEAD(nsClientRectList)
NS_INTERFACE_TABLE1(nsClientRectList, nsIDOMClientRectList)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(ClientRectList)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsClientRectList)
NS_IMPL_RELEASE(nsClientRectList)
NS_IMETHODIMP
nsClientRectList::GetLength(PRUint32* aLength)
{
*aLength = mArray.Count();
return NS_OK;
}
NS_IMETHODIMP
nsClientRectList::Item(PRUint32 aIndex, nsIDOMClientRect** aReturn)
{
if (aIndex >= PRUint32(mArray.Count())) {
*aReturn = nsnull;
return NS_OK;
}
NS_IF_ADDREF(*aReturn = mArray.ObjectAt(aIndex));
return NS_OK;
}

View File

@ -0,0 +1,80 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Novell code.
*
* The Initial Developer of the Original Code is
* Novell Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Robert O'Callahan <robert@ocallahan.org>
*
* 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 ***** */
#ifndef NSCLIENTRECT_H_
#define NSCLIENTRECT_H_
#include "nsIDOMClientRect.h"
#include "nsIDOMClientRectList.h"
#include "nsCOMArray.h"
class nsClientRect : public nsIDOMClientRect
{
public:
NS_DECL_ISUPPORTS
nsClientRect();
void SetRect(float aX, float aY, float aWidth, float aHeight) {
mX = aX; mY = aY; mWidth = aWidth; mHeight = aHeight;
}
virtual ~nsClientRect() {}
NS_DECL_NSIDOMCLIENTRECT
protected:
float mX, mY, mWidth, mHeight;
};
class nsClientRectList : public nsIDOMClientRectList
{
public:
nsClientRectList() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMCLIENTRECTLIST
void Append(nsIDOMClientRect* aElement) { mArray.AppendObject(aElement); }
protected:
virtual ~nsClientRectList() {}
nsCOMArray<nsIDOMClientRect> mArray;
};
#endif /*NSCLIENTRECT_H_*/

View File

@ -296,13 +296,6 @@ nsXMLDocument::OnChannelRedirect(nsIChannel *aOldChannel,
return rv;
}
// XXXbz Shouldn't we look at the owner on the new channel at some point?
// It's not gonna be right here, but eventually it will....
nsCOMPtr<nsIPrincipal> principal;
rv = secMan->GetCodebasePrincipal(newLocation, getter_AddRefs(principal));
NS_ENSURE_SUCCESS(rv, rv);
SetPrincipal(principal);
return NS_OK;
}
@ -368,8 +361,9 @@ nsXMLDocument::Load(const nsAString& aUrl, PRBool *aReturn)
return rv;
}
nsCOMPtr<nsIPrincipal> principal = NodePrincipal();
nsCOMPtr<nsIURI> codebase;
NodePrincipal()->GetURI(getter_AddRefs(codebase));
principal->GetURI(getter_AddRefs(codebase));
// Get security manager, check to see whether the current document
// is allowed to load this URI. It's important to use the current
@ -413,7 +407,6 @@ nsXMLDocument::Load(const nsAString& aUrl, PRBool *aReturn)
// be loaded. Note that we need to hold a strong ref to |principal|
// here, because ResetToURI will null out our node principal before
// setting the new one.
nsCOMPtr<nsIPrincipal> principal = NodePrincipal();
nsCOMPtr<nsIEventListenerManager> elm(mListenerManager);
mListenerManager = nsnull;
@ -441,23 +434,6 @@ nsXMLDocument::Load(const nsAString& aUrl, PRBool *aReturn)
return rv;
}
// Set a principal for this document
// XXXbz StartDocumentLoad should handle that.... And we shouldn't be calling
// StartDocumentLoad until we get an OnStartRequest from this channel!
nsCOMPtr<nsISupports> channelOwner;
rv = channel->GetOwner(getter_AddRefs(channelOwner));
// We don't care if GetOwner() succeeded here, if it failed,
// channelOwner will be null, which is what we want in that case.
principal = do_QueryInterface(channelOwner);
if (NS_FAILED(rv) || !principal) {
rv = secMan->GetCodebasePrincipal(uri, getter_AddRefs(principal));
NS_ENSURE_TRUE(principal, rv);
}
SetPrincipal(principal);
// Prepare for loading the XML document "into oneself"
nsCOMPtr<nsIStreamListener> listener;
if (NS_FAILED(rv = StartDocumentLoad(kLoadAsData, channel,

View File

@ -64,7 +64,9 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
function test(ptFunc, id, message) {
var pt = ptFunc($(id));
is(document.elementFromPoint(pt.x, pt.y).id, id, message);
var e = document.elementFromPoint(pt.x, pt.y);
ok(e != null, message + " (returned null)");
is(e.id, id, message);
}
function do_test() {

View File

@ -77,8 +77,8 @@ XPIDLSRCS = \
nsIDOMModalContentWindow.idl \
nsIDOMChromeWindow.idl \
nsIDOMNSFeatureFactory.idl \
nsIDOMTextRectangle.idl \
nsIDOMTextRectangleList.idl \
nsIDOMClientRect.idl \
nsIDOMClientRectList.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -63,8 +63,8 @@ interface nsIDOMProcessingInstruction;
interface nsIDOMText;
interface nsIDOMDOMStringList;
interface nsIDOMNameList;
interface nsIDOMTextRectangle;
interface nsIDOMTextRectangleList;
interface nsIDOMClientRect;
interface nsIDOMClientRectList;
// Needed for raises() in our IDL
interface DOMException;

View File

@ -0,0 +1,48 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Novell code.
*
* The Initial Developer of the Original Code is
* Novell Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Robert O'Callahan <robert@ocallahan.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "domstubs.idl"
[scriptable, uuid(f8583bbc-c6de-4646-b39f-df7e766442e9)]
interface nsIDOMClientRect : nsISupports
{
readonly attribute float left;
readonly attribute float top;
readonly attribute float right;
readonly attribute float bottom;
};

View File

@ -0,0 +1,46 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Novell code.
*
* The Initial Developer of the Original Code is
* Novell Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Robert O'Callahan <robert@ocallahan.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "domstubs.idl"
[scriptable, uuid(917da19d-62f5-441d-b47e-9e35f05639c9)]
interface nsIDOMClientRectList : nsISupports
{
readonly attribute unsigned long length;
nsIDOMClientRect item(in unsigned long index);
};

View File

@ -68,12 +68,12 @@ interface nsIDOMNSElement : nsISupports
* HTML AREA elements, and SVG elements that do not render). Those return
* an empty list.
*/
nsIDOMTextRectangleList getClientRects();
nsIDOMClientRectList getClientRects();
/**
* Returns the union of all rectangles in the getClientRects() list. Empty
* rectangles are ignored, except that if all rectangles are empty,
* we return an empty rectangle positioned at the top-left of the first
* rectangle in getClientRects().
*/
nsIDOMTextRectangle getBoundingClientRect();
nsIDOMClientRect getBoundingClientRect();
};

View File

@ -390,8 +390,8 @@ enum nsDOMClassInfoID {
eDOMClassInfo_XMLHttpProgressEvent_id,
eDOMClassInfo_XMLHttpRequest_id,
eDOMClassInfo_TextRectangle_id,
eDOMClassInfo_TextRectangleList_id,
eDOMClassInfo_ClientRect_id,
eDOMClassInfo_ClientRectList_id,
// We are now trying to preserve binary compat in classinfo. No more
// putting things in those categories up there. New entries are to be

View File

@ -113,8 +113,8 @@
#include "nsIDOMMediaList.h"
#include "nsIDOMChromeWindow.h"
#include "nsIDOMConstructor.h"
#include "nsIDOMTextRectangle.h"
#include "nsIDOMTextRectangleList.h"
#include "nsIDOMClientRect.h"
#include "nsIDOMClientRectList.h"
// DOM core includes
#include "nsDOMError.h"
@ -1185,9 +1185,9 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(XMLHttpRequest, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TextRectangle, nsDOMGenericSH,
NS_DEFINE_CLASSINFO_DATA(ClientRect, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TextRectangleList, nsTextRectangleListSH,
NS_DEFINE_CLASSINFO_DATA(ClientRectList, nsClientRectListSH,
ARRAY_SCRIPTABLE_FLAGS)
// Define MOZ_SVG_FOREIGNOBJECT here so that when it gets switched on,
@ -3327,12 +3327,12 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(TextRectangle, nsIDOMTextRectangle)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTextRectangle)
DOM_CLASSINFO_MAP_BEGIN(ClientRect, nsIDOMClientRect)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMClientRect)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(TextRectangleList, nsIDOMTextRectangleList)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTextRectangleList)
DOM_CLASSINFO_MAP_BEGIN(ClientRectList, nsIDOMClientRectList)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMClientRectList)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(FileList, nsIDOMFileList)
@ -9753,16 +9753,16 @@ nsCSSRuleListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
return rv;
}
// TextRectangleList scriptable helper
// ClientRectList scriptable helper
nsresult
nsTextRectangleListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
nsISupports **aResult)
nsClientRectListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
nsISupports **aResult)
{
nsCOMPtr<nsIDOMTextRectangleList> list(do_QueryInterface(aNative));
nsCOMPtr<nsIDOMClientRectList> list(do_QueryInterface(aNative));
NS_ENSURE_TRUE(list, NS_ERROR_UNEXPECTED);
nsIDOMTextRectangle *rule = nsnull; // Weak, transfer the ownership over to aResult
nsIDOMClientRect *rule = nsnull; // Weak, transfer the ownership over to aResult
nsresult rv = list->Item(aIndex, &rule);
*aResult = rule;

View File

@ -1331,16 +1331,16 @@ public:
}
};
// TextRectangleList helper
// ClientRectList helper
class nsTextRectangleListSH : public nsArraySH
class nsClientRectListSH : public nsArraySH
{
protected:
nsTextRectangleListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
nsClientRectListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
{
}
virtual ~nsTextRectangleListSH()
virtual ~nsClientRectListSH()
{
}
@ -1352,7 +1352,7 @@ protected:
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
return new nsTextRectangleListSH(aData);
return new nsClientRectListSH(aData);
}
};

View File

@ -56,10 +56,13 @@ REQUIRES = xpcom \
string \
necko \
dom \
content \
widget \
pref \
windowwatcher \
docshell \
appshell \
caps \
storage \
$(NULL)
@ -85,4 +88,8 @@ ifdef MOZ_MAIL_NEWS
DEFINES += -DMOZ_MAIL_NEWS
endif
ifdef ENABLE_TESTS
TOOL_DIRS += test
endif
include $(topsrcdir)/config/rules.mk

View File

@ -38,4 +38,5 @@
add_makefiles "
extensions/cookie/Makefile
extensions/cookie/test/Makefile
"

View File

@ -21,6 +21,7 @@
*
* Contributor(s):
* Darin Fisher <darin@meer.net>
* Daniel Witte <dwitte@stanford.edu>
*
* 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
@ -49,11 +50,12 @@
#include "nsIPrefBranch2.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsILoadGroup.h"
#include "nsIWebNavigation.h"
#include "nsINode.h"
#include "nsIChannel.h"
#include "nsIDOMWindow.h"
#include "nsIDOMDocument.h"
#include "nsIPrincipal.h"
#include "nsString.h"
#include "nsCRT.h"
@ -199,7 +201,6 @@ nsCookiePermission::SetAccess(nsIURI *aURI,
NS_IMETHODIMP
nsCookiePermission::CanAccess(nsIURI *aURI,
nsIURI *aFirstURI,
nsIChannel *aChannel,
nsCookieAccess *aResult)
{
@ -235,7 +236,6 @@ nsCookiePermission::CanAccess(nsIURI *aURI,
}
}
if ((appType == nsIDocShell::APP_TYPE_MAIL) ||
(aFirstURI && IsFromMailNews(aFirstURI)) ||
IsFromMailNews(aURI)) {
*aResult = ACCESS_DENY;
return NS_OK;
@ -421,6 +421,94 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI,
return NS_OK;
}
NS_IMETHODIMP
nsCookiePermission::GetOriginatingURI(nsIChannel *aChannel,
nsIURI **aURI)
{
/* to find the originating URI, we use the loadgroup of the channel to obtain
* the docshell owning the load, and from there, we find the root content
* docshell and its URI. there are several possible cases:
*
* 1) no channel. this will occur for plugins using the nsICookieStorage
* interface, since they have none to provide. other consumers should
* have a channel.
*
* 2) a channel, but no docshell. this can occur when the consumer kicking
* off the load doesn't provide one to the channel, and should be limited
* to loads of certain types of resources (e.g. favicons).
*
* 3) a non-content docshell. this occurs for loads kicked off from chrome,
* where no content docshell exists (favicons can also fall into this
* category).
*
* 4) a content docshell equal to the root content docshell, with channel
* loadflags LOAD_DOCUMENT_URI. this covers the case of a freshly kicked-
* off load (e.g. the user typing something in the location bar, or
* clicking on a bookmark), where the currentURI hasn't yet been set,
* and will be bogus. we return the channel URI in this case. note that
* we could also allow non-content docshells here, but that goes against
* the philosophy of having an audit trail back to a URI the user typed
* or clicked on.
*
* 5) a root content docshell. this covers most cases for an ordinary page
* load from the location bar, and will catch nested frames within
* a page, image loads, etc. we return the URI of the docshell's principal
* in this case.
*
*/
*aURI = nsnull;
// case 1)
if (!aChannel)
return NS_ERROR_NULL_POINTER;
// find the docshell and its root
nsCOMPtr<nsIDocShellTreeItem> docshell, root;
NS_QueryNotificationCallbacks(aChannel, docshell);
if (docshell)
docshell->GetSameTypeRootTreeItem(getter_AddRefs(root));
PRInt32 type;
if (root)
root->GetItemType(&type);
// cases 2) and 3)
if (!root || type != nsIDocShellTreeItem::typeContent)
return NS_ERROR_INVALID_ARG;
// case 4)
if (docshell == root) {
nsLoadFlags flags;
aChannel->GetLoadFlags(&flags);
if (flags & nsIChannel::LOAD_DOCUMENT_URI) {
// get the channel URI - the docshell's will be bogus
aChannel->GetURI(aURI);
if (!*aURI)
return NS_ERROR_NULL_POINTER;
return NS_OK;
}
}
// case 5) - get the originating URI from the docshell's principal
nsCOMPtr<nsIWebNavigation> webnav = do_QueryInterface(root);
if (webnav) {
nsCOMPtr<nsIDOMDocument> doc;
webnav->GetDocument(getter_AddRefs(doc));
nsCOMPtr<nsINode> node = do_QueryInterface(doc);
if (node)
node->NodePrincipal()->GetURI(aURI);
}
if (!*aURI)
return NS_ERROR_NULL_POINTER;
// all done!
return NS_OK;
}
NS_IMETHODIMP
nsCookiePermission::Observe(nsISupports *aSubject,
const char *aTopic,

View File

@ -0,0 +1,93 @@
#
# ***** 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 Foundation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = extensions/cookie/test
include $(DEPTH)/config/autoconf.mk
MODULE = test_cookies
_TEST_FILES = \
test_samedomain.html \
file_testcommon.js \
file_domain_inner.html \
file_domain_inner_inner.html \
test_differentdomain.html \
test_image.html \
file_image_inner.html \
file_image_inner_inner.html \
image1.png \
image1.png^headers^ \
image2.png \
image2.png^headers^ \
test1.css \
test1.css^headers^ \
test2.css \
test2.css^headers^ \
test_loadflags.html \
file_testloadflags.js \
file_loadflags_inner.html \
test_same_base_domain.html \
file_subdomain_inner.html \
test_same_base_domain_2.html \
test_same_base_domain_3.html \
test_same_base_domain_4.html \
file_localhost_inner.html \
test_same_base_domain_5.html \
test_same_base_domain_6.html \
file_loopback_inner.html \
# test_same_base_domain_7.html \
$(NULL)
_BROWSER_TEST_FILES = \
browser_test_favicon.js \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_BROWSER_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,44 @@
// tests third party cookie blocking using a favicon load directly from chrome.
// in this case, the docshell of the channel is chrome, not content; thus
// the cookie should be considered third party.
function test() {
waitForExplicitFinish();
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 1);
var o = new obs();
// kick off a favicon load
PageProxySetIcon("http://example.org/tests/extensions/cookie/test/image1.png");
}
function obs () {
this.os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
this.os.addObserver(this, "cookie-rejected", false);
}
obs.prototype = {
observe: function obs_observe (theSubject, theTopic, theData)
{
var uri = theSubject.QueryInterface(Components.interfaces.nsIURI);
var domain = uri.host;
if (domain == "example.org") {
ok(true, "foreign favicon cookie was blocked");
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 0);
this.os.removeObserver(this, "cookie-rejected");
this.os = null;
finish();
}
}
}

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
<script type="text/javascript">
document.cookie = "can=has";
// send a message to our test document, to say we're done loading
window.opener.postMessage("message");
</script>
<body>
<iframe name="frame1" src="http://example.org/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta2=tag2">
<script type="text/javascript">
document.cookie = "can2=has2";
// send a message to our test document, to say we're done loading
window.parent.opener.postMessage("message");
</script>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
<script type="text/javascript">
document.cookie = "can=has";
// send a message to our test document, to say we're done loading
window.opener.postMessage("message");
</script>
</head>
<body>
<iframe name="frame1" src="http://example.org/tests/extensions/cookie/test/file_image_inner_inner.html"></iframe>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="http://example.org/tests/extensions/cookie/test/test1.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://example.com/tests/extensions/cookie/test/test2.css" />
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta2=tag2">
<script type="text/javascript">
function runTest() {
document.cookie = "can2=has2";
// send a message to our test document, to say we're done loading
window.parent.opener.postMessage("message");
}
</script>
</head>
<body>
<img src="http://example.org/tests/extensions/cookie/test/image1.png" onload="runTest()" />
<img src="http://example.com/tests/extensions/cookie/test/image2.png" onload="runTest()" />
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
<script type="text/javascript">
function runTest() {
document.cookie = "can=has";
// send a message to our test document, to say we're done loading
window.opener.postMessage("message");
}
</script>
</head>
<body>
<img src="http://example.org/tests/extensions/cookie/test/image1.png" onload="runTest()" />
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
<script type="text/javascript">
document.cookie = "can=has";
// send a message to our test document, to say we're done loading
window.opener.postMessage("message");
</script>
<body>
<iframe name="frame1" src="http://localhost:8888/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
<script type="text/javascript">
document.cookie = "can=has";
// send a message to our test document, to say we're done loading
window.opener.postMessage("message");
</script>
<body>
<iframe name="frame1" src="http://127.0.0.1:8888/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
<script type="text/javascript">
document.cookie = "can=has";
// send a message to our test document, to say we're done loading
window.opener.postMessage("message");
</script>
<body>
<iframe name="frame1" src="http://test2.example.org/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
</body>
</html>

View File

@ -0,0 +1,67 @@
SimpleTest.waitForExplicitFinish();
var gPopup = null;
var gExpectedCookies = 0;
var gExpectedLoads = 0;
var gLoads = 0;
function setupTest(uri, cookies, loads) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 1);
var cs = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager2);
cs.removeAll();
gExpectedCookies = cookies;
gExpectedLoads = loads;
// load a window which contains an iframe; each will attempt to set
// cookies from their respective domains.
gPopup = window.open(uri, 'hai', 'width=100,height=100');
}
/** Receives MessageEvents to this window. */
function messageReceiver(evt)
{
ok(evt instanceof MessageEvent, "wrong event type");
if (evt.data == "message")
gLoads++;
else {
ok(false, "wrong message");
gPopup.close();
SimpleTest.finish();
}
// only run the test when all our children are done loading & setting cookies
if (gLoads == gExpectedLoads)
runTest();
}
function runTest() {
// set a cookie from a domain of "localhost"
document.cookie = "oh=hai";
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var cs = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager);
var list = cs.enumerator;
var count = 0;
while (list.hasMoreElements()) {
count++;
list.getNext();
}
is(count, gExpectedCookies, "incorrect number of cookies");
gPopup.close();
cs.removeAll();
SimpleTest.finish();
}
document.addEventListener("message", messageReceiver, false);

View File

@ -0,0 +1,111 @@
SimpleTest.waitForExplicitFinish();
var gPopup = null;
var gExpectedCookies = 0;
var gExpectedLoads = 0;
var gExpectedHeaders = 0;
var gLoads = 0;
var gHeaders = 0;
var o = null;
function setupTest(uri, domain, cookies, loads, headers) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 1);
var cs = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager2);
cs.removeAll();
cs.add(domain, "", "oh", "hai", false, false, true, Math.pow(2, 62));
is(cs.countCookiesFromHost(domain), 1, "cookie wasn't inited");
o = new obs();
gExpectedCookies = cookies;
gExpectedLoads = loads;
gExpectedHeaders = headers;
// load a window which contains an iframe; each will attempt to set
// cookies from their respective domains.
gPopup = window.open(uri, 'hai', 'width=100,height=100');
}
function obs () {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
this.os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
this.os.addObserver(this, "http-on-modify-request", false);
this.window = window;
}
obs.prototype = {
observe: function obs_observe (theSubject, theTopic, theData)
{
this.window.netscape.security
.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var httpchannel = theSubject.QueryInterface(this.window.Components.interfaces
.nsIHttpChannel);
var cookie = httpchannel.getRequestHeader("Cookie");
var got = cookie.indexOf("oh=hai");
this.window.isnot(got, -1, "cookie wasn't sent");
gHeaders++;
},
remove: function obs_remove()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
this.os.removeObserver(this, "http-on-modify-request");
this.os = null;
this.window = null;
}
}
/** Receives MessageEvents to this window. */
function messageReceiver(evt)
{
ok(evt instanceof MessageEvent, "wrong event type");
if (evt.data == "message")
gLoads++;
else {
ok(false, "wrong message");
o.remove();
gPopup.close();
SimpleTest.finish();
}
// only run the test when all our children are done loading & setting cookies
if (gLoads == gExpectedLoads)
runTest();
}
function runTest() {
// set a cookie from a domain of "localhost"
document.cookie = "o=noes";
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var cs = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager);
var list = cs.enumerator;
var count = 0;
while (list.hasMoreElements()) {
count++;
list.getNext();
}
is(count, gExpectedCookies, "incorrect number of cookies");
is(gHeaders, gExpectedHeaders, "incorrect number of request headers");
o.remove();
gPopup.close();
cs.removeAll();
SimpleTest.finish();
}
document.addEventListener("message", messageReceiver, false);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,3 @@
Cache-Control: no-cache
Set-Cookie: foo=bar

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,3 @@
Cache-Control: no-cache
Set-Cookie: foo2=bar2

View File

@ -0,0 +1,2 @@

View File

@ -0,0 +1,3 @@
Cache-Control: no-cache
Set-Cookie: css=bar

View File

@ -0,0 +1,2 @@

View File

@ -0,0 +1,3 @@
Cache-Control: no-cache
Set-Cookie: css2=bar2

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://example.com/tests/extensions/cookie/test/file_domain_inner.html', 3, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://example.org/tests/extensions/cookie/test/file_image_inner.html', 7, 3)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js"></script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://example.org/tests/extensions/cookie/test/file_loadflags_inner.html', 'example.org', 5, 1, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testloadflags.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://test1.example.org/tests/extensions/cookie/test/file_domain_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://test1.example.org/tests/extensions/cookie/test/file_subdomain_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://example.org/tests/extensions/cookie/test/file_subdomain_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://localhost:8888/tests/extensions/cookie/test/file_localhost_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://sub1.test1.example.org/tests/extensions/cookie/test/file_subdomain_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://127.0.0.1:8888/tests/extensions/cookie/test/file_loopback_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://127.1:8888/tests/extensions/cookie/test/file_loopback_inner.html', 3, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Cross domain access to properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupTest('http://example.org/tests/extensions/cookie/test/file_domain_inner.html', 5, 2)">
<p id="display"></p>
<pre id="test">
<script class="testbody" type="text/javascript" src="file_testcommon.js">
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,49 @@
// test third party cookie blocking, for the cases:
// 1) with null channel
// 2) with channel, but with no docshell parent
const Cc = Components.classes;
const Ci = Components.interfaces;
function run_test() {
var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
var spec = "http://foo.com/dribble.html";
var uri = ios.newURI(spec, null, null);
var channel = ios.newChannelFromURI(uri);
// test with cookies enabled
prefs.setIntPref("network.cookie.cookieBehavior", 0);
// without channel
cs.setCookieString(uri, null, "oh=hai", null);
do_check_eq(cs.countCookiesFromHost("foo.com"), 1);
// with channel
cs.setCookieString(uri, null, "can=has", channel);
do_check_eq(cs.countCookiesFromHost("foo.com"), 2);
// without channel, from http
cs.setCookieStringFromHttp(uri, null, null, "cheez=burger", null, null);
do_check_eq(cs.countCookiesFromHost("foo.com"), 3);
// with channel, from http
cs.setCookieStringFromHttp(uri, null, null, "hot=dog", null, channel);
do_check_eq(cs.countCookiesFromHost("foo.com"), 4);
cs.removeAll();
// test with third party cookies blocked
prefs.setIntPref("network.cookie.cookieBehavior", 1);
// without channel
cs.setCookieString(uri, null, "oh=hai", null);
do_check_eq(cs.countCookiesFromHost("foo.com"), 0);
// with channel
cs.setCookieString(uri, null, "can=has", channel);
do_check_eq(cs.countCookiesFromHost("foo.com"), 0);
// without channel, from http
cs.setCookieStringFromHttp(uri, null, null, "cheez=burger", null, null);
do_check_eq(cs.countCookiesFromHost("foo.com"), 0);
// with channel, from http
cs.setCookieStringFromHttp(uri, null, null, "hot=dog", null, channel);
do_check_eq(cs.countCookiesFromHost("foo.com"), 0);
}

View File

@ -61,11 +61,11 @@ CPPSRCS = \
SHARED_LIBRARY_LIBS = \
../src/$(LIB_PREFIX)metrics_s.$(LIB_SUFFIX) \
$(DEPTH)/modules/libbz2/src/$(LIB_PREFIX)bz2.$(LIB_SUFFIX) \
$(NULL)
EXTRA_DSO_LDOPTS = $(XPCOM_GLUE_LDOPTS) \
$(NSPR_LIBS) \
$(BZ2_LIBS) \
$(NULL)
LOCAL_INCLUDES = \
@ -80,4 +80,4 @@ ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
LDFLAGS += -NODEFAULTLIB:MSVCRT
endif
CXXFLAGS += $(BZ2_CFLAGS)

View File

@ -57,7 +57,7 @@ REQUIRES = xpcom \
docshell \
layout \
widget \
libbz2 \
$(BZ2_REQUIRES) \
xulapp \
extensions \
rdf \

View File

@ -67,7 +67,7 @@ LOCAL_INCLUDES = \
LIBS = \
../src/$(LIB_PREFIX)metrics_s.$(LIB_SUFFIX) \
$(DEPTH)/modules/libbz2/src/$(LIB_PREFIX)bz2.$(LIB_SUFFIX) \
$(BZ2_LIBS) \
$(XPCOM_GLUE_LDOPTS) \
$(NSPR_LIBS) \
$(NULL)
@ -76,6 +76,8 @@ XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(BZ2_CFLAGS)
# Give the unit tests absolute paths to the data and temp directories.
# For cygwin, we need to convert the paths to native Windows paths.
ifdef CYGWIN_WRAPPER

View File

@ -45,21 +45,10 @@
#include "nsIDeviceContext.h"
#include "nsSystemFontsBeOS.h"
#define DEFAULT_PIXEL_FONT_SIZE 16.0f
nsSystemFontsBeOS::nsSystemFontsBeOS()
: mDefaultFontName(NS_LITERAL_STRING("sans-serif"))
, mMenuFontName(NS_LITERAL_STRING("sans-serif"))
, mCaptionFontName(NS_LITERAL_STRING("sans-serif"))
, mDefaultFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
, mMenuFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
, mCaptionFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
{
menu_info info;
get_menu_info(&info);

View File

@ -108,25 +108,11 @@ MOZ_pango_font_description_get_size_is_absolute(PangoFontDescription *desc)
}
#endif
#define DEFAULT_PIXEL_FONT_SIZE 16.0f
nsSystemFontsGTK2::nsSystemFontsGTK2()
: mDefaultFontName(NS_LITERAL_STRING("sans-serif"))
, mButtonFontName(NS_LITERAL_STRING("sans-serif"))
, mFieldFontName(NS_LITERAL_STRING("sans-serif"))
, mMenuFontName(NS_LITERAL_STRING("sans-serif"))
, mDefaultFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
, mButtonFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
, mFieldFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
, mMenuFontStyle(FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL,
DEFAULT_PIXEL_FONT_SIZE, NS_LITERAL_CSTRING(""),
0.0f, PR_TRUE, PR_FALSE)
{
InitPangoLib();

View File

@ -186,6 +186,7 @@ nsThebesDeviceContext::SetDPI()
dpi = 144;
mPrintingScale = float(OSVal)/dpi;
dotsArePixels = PR_FALSE;
} else {
dc = GetDC((HWND)nsnull);
@ -393,9 +394,7 @@ nsThebesDeviceContext::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const
}
nsString fontName;
gfxFontStyle fontStyle(NS_FONT_STYLE_NORMAL, FONT_WEIGHT_NORMAL, 16.0f,
NS_LITERAL_CSTRING(""), 0.0f, PR_TRUE,
PR_FALSE);
gfxFontStyle fontStyle;
nsresult rv = gSystemFonts->GetSystemFont(aID, &fontName, &fontStyle);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -0,0 +1,4 @@
<html>
<head></head>
<body dir="rtl"><div>&#x200C;&#x2028;</div></body>
</html>

View File

@ -0,0 +1,4 @@
<html>
<head></head>
<body><div>&#x0301;&#x2029;</div></body>
</html>

View File

@ -0,0 +1,14 @@
<html>
<head>
<script type="text/javascript">
function boom()
{
document.body.appendChild(document.createTextNode("\uCEDD\u5C76\u000D\uCA34"));
}
</script>
</head>
<body onload="boom();"><span>&#x202E;&#x05BC;</span></body>
</html>

View File

@ -0,0 +1,4 @@
<html>
<head></head>
<body onload="document.body.appendChild(document.createTextNode('y'));">x&#x2028;&#x200D;&#x202D;<span>&#x0643;</span></body>
</html>

View File

@ -28,4 +28,7 @@ load 407842.html
load 410728-1.xml
load 416637-1.html
load 419095-1.html
load 420945-1.html
load 420962-1.html
load 421393-1.html
load 421813-1.html

View File

@ -72,6 +72,7 @@ class gfxFontGroup;
#define FONT_MAX_SIZE 2000.0
struct THEBES_API gfxFontStyle {
gfxFontStyle();
gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, gfxFloat aSize,
const nsACString& aLangGroup,
float aSizeAdjust, PRPackedBool aSystemFont,

View File

@ -873,6 +873,15 @@ gfxFontGroup::MakeSpaceTextRun(const Parameters *aParams, PRUint32 aFlags)
return textRun.forget();
}
#define DEFAULT_PIXEL_FONT_SIZE 16.0f
gfxFontStyle::gfxFontStyle() :
style(FONT_STYLE_NORMAL), systemFont(PR_TRUE), familyNameQuirks(PR_FALSE),
weight(FONT_WEIGHT_NORMAL), size(DEFAULT_PIXEL_FONT_SIZE),
langGroup(NS_LITERAL_CSTRING("x-western")), sizeAdjust(0.0f)
{
}
gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, gfxFloat aSize,
const nsACString& aLangGroup,
float aSizeAdjust, PRPackedBool aSystemFont,

View File

@ -42,6 +42,7 @@
#include "nsBidiUtils.h"
#include "symmtable.h"
#include "bidicattable.h"
#include "nsCharTraits.h"
#define FE_TO_06_OFFSET 0xfe70
@ -613,6 +614,22 @@ PRBool IsBidiControl(PRUint32 aChar)
return (eBidiCat_CC == GetBidiCat(aChar) || ((aChar)&0xfffffe)==LRM_CHAR);
}
PRBool HasRTLChars(nsAString& aString)
{
PRInt32 length = aString.Length();
for (PRInt32 i = 0; i < length; i++) {
if ((UCS2_CHAR_IS_BIDI(aString.CharAt(i)) ) ||
((NS_IS_HIGH_SURROGATE(aString.CharAt(i))) &&
(++i < length) &&
(NS_IS_LOW_SURROGATE(aString.CharAt(i))) &&
(UTF32_CHAR_IS_BIDI(SURROGATE_TO_UCS4(aString.CharAt(i-1),
aString.CharAt(i)))))) {
return PR_TRUE;
}
}
return PR_FALSE;
}
nsCharType GetCharType(PRUint32 aChar)
{
nsCharType oResult;

View File

@ -203,6 +203,12 @@ typedef enum nsCharType nsCharType;
*/
PRBool IsBidiControl(PRUint32 aChar);
/**
* Give an nsString.
* @return PR_TRUE if the string contains right-to-left characters
*/
PRBool HasRTLChars(nsAString& aString);
// --------------------------------------------------
// IBMBIDI
// --------------------------------------------------

View File

@ -84,6 +84,7 @@ endif
#
#CFLAGS += -DDEBUG -DDEBUG_brendan -DJS_ARENAMETER -DJS_HASHMETER -DJS_DUMP_PROPTREE_STATS -DJS_DUMP_SCOPE_METERS -DJS_SCOPE_DEPTH_METER -DJS_BASIC_STATS
CFLAGS += $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
INTERP_CFLAGS += $(INTERP_OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(INTERP_XCFLAGS)
LDFLAGS = $(XLDFLAGS)

View File

@ -119,17 +119,21 @@ endif
ifdef BUILD_OPT
ifdef USE_MSVC
OPTIMIZER = -O2 -GL
INTERP_OPTIMIZER = -O2 -GL
LDFLAGS += -LTCG
else
OPTIMIZER = -Os
INTERP_OPTIMIZER = -Os
endif
DEFINES += -UDEBUG -DNDEBUG -UDEBUG_$(USER)
OBJDIR_TAG = _OPT
else
ifdef USE_MSVC
OPTIMIZER = -Zi
INTERP_OPTIMIZER = -Zi
else
OPTIMIZER = -g3
INTERP_OPTIMIZER = -g3
endif
DEFINES += -DDEBUG -DDEBUG_$(USER)
OBJDIR_TAG = _DBG

View File

@ -2478,7 +2478,7 @@ array_slice(JSContext *cx, uintN argc, jsval *vp)
if (begin > end)
begin = end;
if (OBJ_IS_DENSE_ARRAY(cx, obj)) {
if (OBJ_IS_DENSE_ARRAY(cx, obj) && end <= ARRAY_DENSE_LENGTH(obj)) {
nobj = js_NewArrayObject(cx, end - begin, obj->dslots + begin);
if (!nobj)
return JS_FALSE;

View File

@ -741,7 +741,7 @@ js_ValueToNumber(JSContext *cx, jsval *vp)
if ((!js_strtod(cx, bp, end, &ep, &d) ||
js_SkipWhiteSpace(ep, end) != end) &&
(!js_strtointeger(cx, bp, end, &ep, 0, &d) ||
js_SkipWhiteSpace(ep, end) != end)) {
js_SkipWhiteSpace(ep, end) != end)) {
break;
}

View File

@ -77,6 +77,9 @@ $(OBJDIR)/%.o: %.cpp %.h
@$(MAKE_OBJDIR)
$(CXX) -o $@ -c $(CFLAGS) $*.cpp
$(OBJDIR)/jsinterp.o: jsinterp.c jsinterp.h
@$(MAKE_OBJDIR)
$(CC) -o $@ -c $(INTERP_CFLAGS) jsinterp.c
$(OBJDIR)/%.o: %.cpp
@$(MAKE_OBJDIR)
@ -91,6 +94,10 @@ $(OBJDIR)/%.obj: %.cpp %.h
@$(MAKE_OBJDIR)
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.cpp
$(OBJDIR)/jsinterp.obj: jsinterp.cpp jsinterp.h
@$(MAKE_OBJDIR)
$(CXX) -Fo$(OBJDIR)/ -c $(INTERP_CFLAGS) $(JSDLL_CFLAGS) jsinterp.c
$(OBJDIR)/%.obj: %.cpp
@$(MAKE_OBJDIR)
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $*.cpp

View File

@ -159,11 +159,15 @@ function DayNumber( t ) {
return ( Math.floor( t / msPerDay ) );
}
function TimeWithinDay( t ) {
if ( t < 0 ) {
return ( (t % msPerDay) + msPerDay );
} else {
return ( t % msPerDay );
var r = t % msPerDay;
if (r < 0)
{
r += msPerDay;
}
return r;
}
function YearNumber( t ) {
}

View File

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* 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 ***** */
var gTestfile = '15.9.1.2-01.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 264727;
var summary = '15.9.1.2 - TimeWithinDay(TIME_1900) == 0';
var actual = '';
var expect = '';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
expect = 0;
actual = TimeWithinDay(TIME_1900);
reportCompare(expect, actual, summary);
exitFunc ('test');
}

View File

@ -153,11 +153,15 @@ function DayNumber( t ) {
return ( Math.floor( t / msPerDay ) );
}
function TimeWithinDay( t ) {
if ( t < 0 ) {
return ( (t % msPerDay) + msPerDay );
} else {
return ( t % msPerDay );
var r = t % msPerDay;
if (r < 0)
{
r += msPerDay;
}
return r;
}
function YearNumber( t ) {
}

View File

@ -151,7 +151,7 @@ TEST_ID=js1_5/Array/regress-330812.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TE
TEST_ID=js1_5/Array/regress-330812.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=opt, TEST_TYPE=browser, TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=BUGNUMBER: 330812; STATUS: Making Array(1<<29).sort() less problematic; --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE 0 ---; --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE 3 ---; STATUS: This test passes if the browser does not hang or crash; STATUS: This test expects exit code 0 or 3 to indicate out of memory
TEST_ID=js1_5/Array/regress-330812.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=opt, TEST_TYPE=shell, TEST_OS=linux, TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=EXIT STATUS: CRASHED 5 `.``*`/js1_5/Array/regress-330812.js:`.``*`: out of memory
TEST_ID=js1_5/Array/regress-350256-03.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=(browser|shell), TEST_OS=win32, TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=EXIT STATUS: TIMED OUT
TEST_ID=js1_5/Array/regress-350256-03.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=debug, TEST_TYPE=shell, TEST_OS=mac, TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=EXIT STATUS: TIMED OUT
TEST_ID=js1_5/Array/regress-350256-03.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=debug, TEST_TYPE=(browser|shell), TEST_OS=mac, TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=EXIT STATUS: TIMED OUT
TEST_ID=js1_5/Array/regress-350256-03.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=(browser|shell), TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*`/js1_5/Array/regress-350256-03.js:`.``*`: `(`InternalError: `)``?`script stack space quota is exhausted
TEST_ID=js1_5/Error/regress-354246.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=(browser|shell), TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*`reason: `.``*`/js1_5/Error/regress-354246.js:`.``*`: x is not defined
TEST_ID=js1_5/Expressions/regress-394673.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=(browser|shell), TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*``(`InternalError:`|`reason:`)``?` too much recursion
@ -207,7 +207,7 @@ TEST_ID=js1_5/Regress/regress-320119.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED,
TEST_ID=js1_5/Regress/regress-320119.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=(browser|shell), TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=delegating objects and arguments, arity, caller, name: name no longer shared expected: false actual: true reason: Expected value 'false', Actual value 'true'
TEST_ID=js1_5/Regress/regress-328897.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=browser, TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*`reason: :0: uncaught exception: Permission denied to get property UnnamedClass.classes
TEST_ID=js1_5/Regress/regress-328897.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=browser, TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=JS_ReportPendingException should expected: Error actual: No Error reason: Expected value 'Error', Actual value 'No Error'
TEST_ID=js1_5/Regress/regress-328897.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=browser, TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*`reason: :0: uncaught exception: Permission denied to get property XPCComponents.classes
TEST_ID=js1_5/Regress/regress-328897.js, TEST_BRANCH=1.9.0, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=browser, TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*`reason: javascript:Components.classes:1: Permission denied to get property XPCComponents.classes
TEST_ID=js1_5/Regress/regress-329530.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=opt, TEST_TYPE=browser, TEST_OS=win32, TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=BUGNUMBER: 329530; STATUS: Do not crash when calling toString on a deeply nested function; --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE 0 ---; --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE 5 ---
TEST_ID=js1_5/Regress/regress-330352.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=browser, TEST_OS=(linux|mac|win32), TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=.*, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`(`EXIT STATUS: CRASHED `.``*`, `)``?`BUGNUMBER: 330352; STATUS: Very non-greedy regexp causes crash in jsregexp.c; --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE 0 ---; --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE 5 ---`(`; JavaScript error: `.``*`/js1_5/Regress/regress-330352.js:`.``*`: out of memory;`)``?`
TEST_ID=js1_5/Regress/regress-330352.js, TEST_BRANCH=1.8.1, TEST_RESULT=FAILED, TEST_BUILDTYPE=(debug|opt), TEST_TYPE=shell, TEST_OS=linux, TEST_MACHINE=.*, TEST_PROCESSORTYPE=.*, TEST_KERNEL=2.6.9.*ELsmp, TEST_DATE=.*, TEST_TIMEZONE=.*, TEST_DESCRIPTION=`.``*`/js1_5/Regress/regress-330352.js:`.``*`: out of memory

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
div { height: 10px; margin: 1em; outline: 1px inset black; }
</style>
</head>
<body onload="document.getElementById('a').style.padding = '12em 0';" style="-moz-column-count: 2; width: 1px;"><div id="a">aaaa aaaa aaaa</div><div style="border: medium solid blue;"></div><div style="border: medium solid green; margin: 10em 0pt;"></div><div style="border: medium solid magenta;"></div>xxxx xxxx xxxx</body>
</html>

View File

@ -92,4 +92,5 @@ load 407009-1.xhtml
load 408749-1.xhtml
load 408883-1.html
load 410228-1.html
load 415685-1.html
load 421404-1.html

View File

@ -120,6 +120,18 @@ nsBulletFrame::GetType() const
return nsGkAtoms::bulletFrame;
}
PRBool
nsBulletFrame::IsEmpty()
{
return IsSelfEmpty();
}
PRBool
nsBulletFrame::IsSelfEmpty()
{
return GetStyleList()->mListStyleType == NS_STYLE_LIST_STYLE_NONE;
}
NS_IMETHODIMP
nsBulletFrame::DidSetStyleContext()
{

View File

@ -101,6 +101,9 @@ public:
void PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect);
virtual PRBool IsEmpty();
virtual PRBool IsSelfEmpty();
protected:
void GetDesiredSize(nsPresContext* aPresContext,

View File

@ -660,13 +660,19 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// messy the bidi situations are, since per CSS2.1 section 8.6
// (implemented in bug 328168), the startSide border is always on the
// first line.
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(startSide), 0) +
styleBorder->GetBorderWidth(startSide) +
GetCoord(styleMargin->mMargin.Get(startSide), 0);
// This frame is a first-in-flow, but it might have a previous bidi
// continuation, in which case that continuation should handle the startSide
// border.
if (!GetPrevContinuation()) {
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(startSide), 0) +
styleBorder->GetBorderWidth(startSide) +
GetCoord(styleMargin->mMargin.Get(startSide), 0);
}
const nsLineList_iterator* savedLine = aData->line;
nsContainerFrame *lastInFlow;
for (nsContainerFrame *nif = this; nif;
nif = (nsContainerFrame*) nif->GetNextInFlow()) {
for (nsIFrame *kid = nif->mFrames.FirstChild(); kid;
@ -682,6 +688,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// After we advance to our next-in-flow, the stored line may not
// longer be the correct line. Just forget it.
aData->line = nsnull;
lastInFlow = nif;
}
aData->line = savedLine;
@ -690,10 +697,15 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// messy the bidi situations are, since per CSS2.1 section 8.6
// (implemented in bug 328168), the endSide border is always on the
// last line.
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(endSide), 0) +
styleBorder->GetBorderWidth(endSide) +
GetCoord(styleMargin->mMargin.Get(endSide), 0);
// We reached the last-in-flow, but it might have a next bidi
// continuation, in which case that continuation should handle
// the endSide border.
if (!lastInFlow->GetNextContinuation()) {
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(endSide), 0) +
styleBorder->GetBorderWidth(endSide) +
GetCoord(styleMargin->mMargin.Get(endSide), 0);
}
}
/* virtual */ nsSize

View File

@ -868,10 +868,12 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// the float. At the same time, check if the frame has any non-collapsed-away
// content.
PRBool placedFloat = PR_FALSE;
PRBool hasNoncollapsedContent = PR_TRUE;
if (frameType) {
PRBool isEmpty;
if (!frameType) {
isEmpty = pfd->mFrame->IsEmpty();
} else {
if (nsGkAtoms::placeholderFrame == frameType) {
hasNoncollapsedContent = PR_FALSE;
isEmpty = PR_TRUE;
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
nsIFrame* outOfFlowFrame = nsLayoutUtils::GetFloatFromPlaceholder(aFrame);
if (outOfFlowFrame) {
@ -893,9 +895,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// Note non-empty text-frames for inline frame compatibility hackery
pfd->SetFlag(PFD_ISTEXTFRAME, PR_TRUE);
nsTextFrame* textFrame = static_cast<nsTextFrame*>(pfd->mFrame);
if (!textFrame->HasNoncollapsedCharacters()) {
hasNoncollapsedContent = PR_FALSE;
} else {
isEmpty = !textFrame->HasNoncollapsedCharacters();
if (!isEmpty) {
pfd->SetFlag(PFD_ISNONEMPTYTEXTFRAME, PR_TRUE);
nsIContent* content = textFrame->GetContent();
@ -924,13 +925,15 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
}
else if (nsGkAtoms::brFrame == frameType) {
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
isEmpty = PR_FALSE;
} else {
if (nsGkAtoms::letterFrame==frameType) {
pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE);
}
if (pfd->mSpan &&
!pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty()) {
hasNoncollapsedContent = PR_FALSE;
if (pfd->mSpan) {
isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty();
} else {
isEmpty = pfd->mFrame->IsEmpty();
}
}
}
@ -1012,7 +1015,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
if (CanPlaceFrame(pfd, reflowState, notSafeToBreak, continuingTextRun,
savedOptionalBreakContent != nsnull, metrics,
aReflowStatus, &optionalBreakAfterFits)) {
if (hasNoncollapsedContent) {
if (!isEmpty) {
psd->mHasNonemptyContent = PR_TRUE;
}

View File

@ -52,7 +52,6 @@
#include "nsTextFormatter.h" // for page number localization formatting
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#include "nsBidiPresUtils.h"
#endif
#include "nsIFontMetrics.h"
#include "nsIPrintSettings.h"
@ -369,6 +368,8 @@ nsPageFrame::DrawHeaderFooter(nsIRenderingContext& aRenderingContext,
} else {
return; // bail if couldn't find the correct length
}
PresContext()->SetBidiEnabled(HasRTLChars(str));
// cacl the x and y positions of the text
nscoord x = GetXPosition(aRenderingContext, aRect, aJust, str);

View File

@ -17,7 +17,7 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == mixedChartype-02.html mixedChartype-02-
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == mixedChartype-02-j.html mixedChartype-02-ref.html
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == mixedChartype-03.html mixedChartype-03-ref.html
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == mixedChartype-03-j.html mixedChartype-03-ref.html
== 386339.html 386339-ref.html
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 386339.html 386339-ref.html
== 409375.html 409375-ref.html
== 413542-1.html 413542-1-ref.html
== 413542-2.html 413542-2-ref.html

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
div {
float: left;
border: medium solid black;
}
</style>
</head>
<body>
<div><span style="padding-right: 10em;"><br>&lrm;</span></div>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
div {
float: left;
border: medium solid black;
}
</style>
</head>
<body>
<div><span style="padding-right: 10em;"><br>&rlm;</span></div>
</body>
</html>

View File

@ -752,5 +752,6 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
== 419531-1.html 419531-1-ref.html
== 420069-1.html 420069-1-ref.html
== 420069-2.html 420069-2-ref.html
# == 420351-1.html 420351-1-ref.html
== 420351-1.html 420351-1-ref.html
== 421234-1.html 421234-1-ref.html
== 421419-1.html 421419-1-ref.html

View File

@ -0,0 +1,21 @@
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=421780
Test related to bug 421780; make sure that 1-pixel, single-colour images
are correctly scaled to the right size.
This test makes sure that images aren't sized too big; it takes a 100%
width lime rect, overlaid with a 183x183 width stretched red image,
overlaid with a 183x183 lime rect.
183 in particular is used because 183*183 > 2^16, and we can easily run
into double-scaling bugs that will overflow in pixman. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title> Ensure images aren't scaled too big </title>
<rect width="100%" height="100%" fill="lime"/>
<image width="183" height="183" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj+M/AAAADAQEAGN2NsAAAAABJRU5ErkJggg"/>
<rect width="183" height="183" fill="lime"/>
</svg>

After

Width:  |  Height:  |  Size: 942 B

View File

@ -0,0 +1,21 @@
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=421780
Test related to bug 421780; make sure that 1-pixel, single-colour images
are correctly scaled to the right size.
This test makes sure that images aren't sized too small; it takes a 100%
width lime rect, overlaid with a 183x183 width red rect, overlaid with a
183x183 stretched lime image.
183 in particular is used because 183*183 > 2^16, and we can easily run
into double-scaling bugs that will overflow in pixman. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title> Ensure images aren't scaled too small </title>
<rect width="100%" height="100%" fill="lime"/>
<rect width="183" height="183" fill="red"/>
<image width="183" height="183" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAALGPC%2FxhBQAAAAxJREFUGFdjYPjPAAACAgEA0dNGRAAAAABJRU5ErkJggg%3D%3D"/>
</svg>

After

Width:  |  Height:  |  Size: 957 B

View File

@ -32,6 +32,8 @@ include moz-only/reftest.list
== foreignObject-overflow-01.svg pass.svg
== getElementById-a-element-01.svg pass.svg
fails == inline-in-xul-basic-01.xul pass.svg
== image-scaling-01.svg pass.svg
== image-scaling-02.svg pass.svg
== linearGradient-basic-01.svg pass.svg
== linearGradient-basic-02.svg pass.svg
== nested-viewBox-01.svg pass.svg

View File

@ -288,7 +288,11 @@ nsSVGImageFrame::PaintSVG(nsSVGRenderState *aContext, nsRect *aDirtyRect)
opacity = GetStyleDisplay()->mOpacity;
}
nsSVGUtils::CompositePatternMatrix(gfx, thebesPattern, fini, width, height, opacity);
PRInt32 nativeWidth, nativeHeight;
currentFrame->GetWidth(&nativeWidth);
currentFrame->GetHeight(&nativeHeight);
nsSVGUtils::CompositePatternMatrix(gfx, thebesPattern, fini, nativeWidth, nativeHeight, opacity);
if (GetStyleDisplay()->IsScrollableOverflow())
gfx->Restore();

View File

@ -609,17 +609,8 @@ nsTextBoxFrame::CalculateTitleForWidth(nsPresContext* aPresContext,
if (mTitleWidth <= aWidth) {
mCroppedTitle = mTitle;
#ifdef IBMBIDI
PRInt32 length = mTitle.Length();
for (PRInt32 i = 0; i < length; i++) {
if ((UCS2_CHAR_IS_BIDI(mTitle.CharAt(i)) ) ||
((NS_IS_HIGH_SURROGATE(mTitle.CharAt(i))) &&
(++i < length) &&
(NS_IS_LOW_SURROGATE(mTitle.CharAt(i))) &&
(UTF32_CHAR_IS_BIDI(SURROGATE_TO_UCS4(mTitle.CharAt(i-1),
mTitle.CharAt(i)))))) {
if (HasRTLChars(mTitle)) {
mState |= NS_FRAME_IS_BIDI;
break;
}
}
#endif // IBMBIDI
return; // fits, done.

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