зеркало из https://github.com/mozilla/gecko-dev.git
Merge cvs-trunk-mirror -> mozilla-central
--HG-- rename : js/src/jsinterp.c => js/src/jsinterp.cpp rename : js/src/jsopcode.c => js/src/jsopcode.cpp
This commit is contained in:
Коммит
819bc13ad2
|
@ -1499,6 +1499,9 @@ NS_IMETHODIMP nsDocAccessible::FlushPendingEvents()
|
|||
{
|
||||
PRUint32 length = mEventsToFire.Count();
|
||||
NS_ASSERTION(length, "How did we get here without events to fire?");
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
if (!presShell)
|
||||
length = 0; // The doc is now shut down, don't fire events in it anymore
|
||||
PRUint32 index;
|
||||
for (index = 0; index < length; index ++) {
|
||||
nsCOMPtr<nsIAccessibleEvent> accessibleEvent(
|
||||
|
@ -1523,7 +1526,6 @@ NS_IMETHODIMP nsDocAccessible::FlushPendingEvents()
|
|||
// such as a:focus { overflow: scroll; }
|
||||
nsCOMPtr<nsIContent> focusContent(do_QueryInterface(domNode));
|
||||
if (focusContent) {
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
nsIFrame *focusFrame = presShell->GetRealPrimaryFrameFor(focusContent);
|
||||
nsIAtom *newFrameType =
|
||||
(focusFrame && focusFrame->GetStyleVisibility()->IsVisible()) ?
|
||||
|
|
|
@ -845,6 +845,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||
}
|
||||
}
|
||||
else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
|
||||
PRBool fireFocus = PR_FALSE;
|
||||
if (!treeItemAccessible) {
|
||||
#ifdef MOZ_XUL
|
||||
if (isTree) {
|
||||
|
@ -857,6 +858,8 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||
NS_ENSURE_TRUE(menuFrame, NS_ERROR_FAILURE);
|
||||
nsIMenuFrame* imenuFrame;
|
||||
CallQueryInterface(menuFrame, &imenuFrame);
|
||||
if (imenuFrame)
|
||||
fireFocus = PR_TRUE;
|
||||
// QI failed for nsIMenuFrame means it's not on menu bar
|
||||
if (imenuFrame && imenuFrame->IsOnMenuBar() &&
|
||||
!imenuFrame->IsOnActiveMenuBar()) {
|
||||
|
@ -870,7 +873,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||
// It is not top level menuitem
|
||||
// Only fire focus event if it is not inside collapsed popup
|
||||
// and not a listitem of a combo box
|
||||
if (State(containerAccessible) & nsIAccessibleStates::STATE_COLLAPSED) {
|
||||
if (State(containerAccessible) & nsIAccessibleStates::STATE_COLLAPSED) {
|
||||
nsCOMPtr<nsIAccessible> containerParent;
|
||||
containerAccessible->GetParent(getter_AddRefs(containerParent));
|
||||
NS_ENSURE_TRUE(containerParent, NS_ERROR_FAILURE);
|
||||
|
@ -880,8 +883,26 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||
}
|
||||
}
|
||||
}
|
||||
nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE); // Always asynch, always from user input
|
||||
FireAccessibleFocusEvent(accessible, aTargetNode, aEvent, PR_TRUE, PR_TRUE);
|
||||
if (!fireFocus) {
|
||||
nsCOMPtr<nsIDOMNode> realFocusedNode = GetCurrentFocus();
|
||||
nsCOMPtr<nsIContent> realFocusedContent = do_QueryInterface(realFocusedNode);
|
||||
nsCOMPtr<nsIContent> targetContent = do_QueryInterface(aTargetNode);
|
||||
nsIContent *containerContent = targetContent;
|
||||
while (containerContent) {
|
||||
nsCOMPtr<nsIDOMXULPopupElement> popup = do_QueryInterface(containerContent);
|
||||
if (popup || containerContent == realFocusedContent) {
|
||||
// If we're inside the focus or a popup we can fire focus events
|
||||
// for the changed active item
|
||||
fireFocus = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
containerContent = containerContent->GetParent();
|
||||
}
|
||||
}
|
||||
if (fireFocus) {
|
||||
nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE); // Always asynch, always from user input
|
||||
FireAccessibleFocusEvent(accessible, aTargetNode, aEvent, PR_TRUE, PR_TRUE);
|
||||
}
|
||||
}
|
||||
else if (eventType.EqualsLiteral("DOMMenuBarActive")) { // Always asynch, always from user input
|
||||
nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE);
|
||||
|
|
|
@ -1480,8 +1480,10 @@ nsresult nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEn
|
|||
}
|
||||
|
||||
if (selCon) {
|
||||
// XXX I'm not sure this can do synchronous scrolling. If the last param is
|
||||
// set to true, this calling might flush the pending reflow. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -134,7 +134,7 @@ CAccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding,
|
|||
{
|
||||
__try {
|
||||
*aKeyBinding = NULL;
|
||||
aNumBinding = 0;
|
||||
*aNumBinding = 0;
|
||||
|
||||
nsCOMPtr<nsIAccessible> acc(do_QueryInterface(this));
|
||||
if (!acc)
|
||||
|
|
|
@ -1059,7 +1059,7 @@ function placesMigrationTasks() {
|
|||
var newUriSpec = "place:type=" +
|
||||
Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY +
|
||||
"&sort=" +
|
||||
Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING +
|
||||
Ci.nsINavHistoryQueryOptions.SORT_BY_LASTMODIFIED_DESCENDING +
|
||||
"&maxResults=" + maxResults;
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
|
|
|
@ -575,7 +575,7 @@ BrowserGlue.prototype = {
|
|||
var recentTagsItem = bmsvc.insertBookmark(placesFolder,
|
||||
this._uri("place:"+
|
||||
"type=" + Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY +
|
||||
"&sort=" + Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING +
|
||||
"&sort=" + Ci.nsINavHistoryQueryOptions.SORT_BY_LASTMODIFIED_DESCENDING +
|
||||
"&maxResults=" + maxResults),
|
||||
defaultIndex, recentTagsTitle);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Bug 384370 code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Dietrich Ayala <dietrich@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function run_test() {
|
||||
// XXX test disabled due to backout of bug 384370
|
||||
return;
|
||||
}
|
|
@ -38,7 +38,7 @@
|
|||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
// Load DownloadUtils module for convertByteUnits
|
||||
Cu.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
|
||||
var gAdvancedPane = {
|
||||
_inited: false,
|
||||
|
|
|
@ -49,7 +49,6 @@ _BROWSER_FILES =browser_Application.js \
|
|||
browser_ApplicationStorage.js \
|
||||
browser_Browser.js \
|
||||
browser_Bookmarks.js \
|
||||
browser_Extensions.js \
|
||||
ContentA.html \
|
||||
ContentB.html \
|
||||
ContentWithFrames.html \
|
||||
|
|
|
@ -87,8 +87,7 @@ extensions/reporter@mozilla.org/install.rdf
|
|||
extensions/reporter@mozilla.org/chrome.manifest
|
||||
extensions/reporter@mozilla.org/chrome/reporter.jar
|
||||
extensions/reporter@mozilla.org/defaults/preferences/reporter.js
|
||||
#Remove Inspector (present from upgrades from Fx2/Fx3b1)
|
||||
components/inspector.xpt
|
||||
#Remove Inspector (present from upgrades from Fx2/Fx3b3)
|
||||
extensions/inspector@mozilla.org/install.rdf
|
||||
extensions/inspector@mozilla.org/components/inspector-cmdline.js
|
||||
extensions/inspector@mozilla.org/chrome.manifest
|
||||
|
@ -575,6 +574,7 @@ components/necko_data.xpt
|
|||
components/nsKillAll.js
|
||||
components/passwordmgr.xpt
|
||||
components/progressDlg.xpt
|
||||
components/safebrowsing.xpt
|
||||
components/search.xpt
|
||||
components/websrvcs.xpt
|
||||
components/widget_mac.xpt
|
||||
|
@ -593,15 +593,15 @@ chrome/icons/default/default.xpm
|
|||
#endif
|
||||
dictionaries/PL.dic
|
||||
dictionaries/PL.aff
|
||||
#ifdef MOZ_MEMORY
|
||||
#ifdef XP_WIN
|
||||
#ifdef MOZ_MEMORY
|
||||
Microsoft.VC80.CRT.manifest
|
||||
msvcm80.dll
|
||||
msvcp80.dll
|
||||
msvcr80.dll
|
||||
#else
|
||||
mozcrt19.dll
|
||||
#endif
|
||||
#endif
|
||||
#ifdef XP_WIN
|
||||
xpicleanup.exe
|
||||
#else
|
||||
xpicleanup
|
||||
|
|
|
@ -247,7 +247,6 @@ bin/modules/*
|
|||
|
||||
; Safe Browsing
|
||||
bin/components/nsSafebrowsingApplication.js
|
||||
bin/components/safebrowsing.xpt
|
||||
bin/components/nsUrlClassifierListManager.js
|
||||
bin/components/nsUrlClassifierLib.js
|
||||
bin/components/url-classifier.xpt
|
||||
|
|
|
@ -42,11 +42,14 @@ bin\xpcom_core.dll
|
|||
bin\components\xpinstal.dll
|
||||
bin\components\jar50.dll
|
||||
#endif
|
||||
#ifndef MOZ_MEMORY
|
||||
bin\Microsoft.VC80.CRT.manifest
|
||||
bin\msvcm80.dll
|
||||
bin\msvcp80.dll
|
||||
bin\msvcr80.dll
|
||||
#else
|
||||
bin\mozcrt19.dll
|
||||
#endif
|
||||
|
||||
[browser]
|
||||
; [Base Browser Files]
|
||||
|
@ -243,7 +246,6 @@ bin\modules\*
|
|||
|
||||
; Safe Browsing
|
||||
bin\components\nsSafebrowsingApplication.js
|
||||
bin\components\safebrowsing.xpt
|
||||
bin\components\nsUrlClassifierListManager.js
|
||||
bin\components\nsUrlClassifierLib.js
|
||||
bin\components\url-classifier.xpt
|
||||
|
|
|
@ -3,7 +3,10 @@ be
|
|||
ca
|
||||
cs
|
||||
de
|
||||
el
|
||||
en-GB
|
||||
en-US
|
||||
es-AR
|
||||
es-ES
|
||||
eu
|
||||
fi
|
||||
|
@ -28,6 +31,7 @@ pt-PT
|
|||
ro
|
||||
ru
|
||||
sk
|
||||
sq
|
||||
sv-SE
|
||||
tr
|
||||
uk
|
||||
|
|
|
@ -5726,11 +5726,7 @@ MOZ_NATIVE_SQLITE= )
|
|||
if test -z "$MOZ_NATIVE_SQLITE"
|
||||
then
|
||||
SQLITE_CFLAGS=
|
||||
if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
|
||||
SQLITE_LIBS='$(DIST)/lib/$(LIB_PREFIX)sqlite3.$(LIB_SUFFIX)'
|
||||
else
|
||||
SQLITE_LIBS='-lsqlite3'
|
||||
fi
|
||||
SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
|
||||
else
|
||||
PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
|
||||
fi
|
||||
|
|
|
@ -102,6 +102,9 @@ interface nsISelectionController : nsISelectionDisplay
|
|||
* @param aIsSynchronous when true, scrolls the selection into view
|
||||
* before returning. If false, posts a request which is processed
|
||||
* at some point after the method returns.
|
||||
*
|
||||
* Note that if isSynchronous is true, then this might flush the pending
|
||||
* reflow. It's dangerous for some objects. See bug 418470 comment 12.
|
||||
*/
|
||||
void scrollSelectionIntoView(in short type, in short region, in boolean isSynchronous);
|
||||
/**
|
||||
|
|
|
@ -1118,6 +1118,8 @@ nsEventListenerManager::HandleEvent(nsPresContext* aPresContext,
|
|||
}
|
||||
PRUint16 currentGroup = aFlags & NS_EVENT_FLAG_SYSTEM_EVENT;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
if (aEvent->message == NS_CONTEXTMENU &&
|
||||
NS_FAILED(FixContextMenuEvent(aPresContext, aCurrentTarget, aEvent,
|
||||
aDOMEvent))) {
|
||||
|
@ -1380,6 +1382,8 @@ nsEventListenerManager::FixContextMenuEvent(nsPresContext* aPresContext,
|
|||
// see if we should use the caret position for the popup
|
||||
if (contextMenuKey) {
|
||||
nsPoint caretPoint;
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
if (PrepareToUseCaretPosition(((nsGUIEvent*)aEvent)->widget,
|
||||
shell, caretPoint)) {
|
||||
// caret position is good
|
||||
|
@ -1507,6 +1511,8 @@ nsEventListenerManager::PrepareToUseCaretPosition(nsIWidget* aEventWidget,
|
|||
else
|
||||
selCon = do_QueryInterface(aShell);
|
||||
if (selCon) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
rv = selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
||||
|
|
|
@ -65,6 +65,9 @@ export:: sqlite-version.h
|
|||
endif
|
||||
endif
|
||||
|
||||
# FIXME: bug 419893
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
||||
ifdef GNU_CC
|
||||
MODULE_OPTIMIZE_FLAGS = -O2
|
||||
else
|
||||
|
|
|
@ -105,7 +105,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSEventListener)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTarget)
|
||||
if (tmp->mContext) {
|
||||
if (tmp->mScopeObject) {
|
||||
nsContentUtils::DropScriptObjects(tmp->mContext->GetScriptTypeID(), this,
|
||||
nsContentUtils::DropScriptObjects(tmp->mContext->GetScriptTypeID(), tmp,
|
||||
&NS_CYCLE_COLLECTION_NAME(nsJSEventListener));
|
||||
tmp->mScopeObject = nsnull;
|
||||
}
|
||||
|
|
|
@ -247,6 +247,8 @@ nsEditorSpellCheck::GetNextMisspelledWord(PRUnichar **aNextMisspelledWord)
|
|||
nsAutoString nextMisspelledWord;
|
||||
|
||||
DeleteSuggestedWordList();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
nsresult rv = mSpellChecker->NextMisspelledWord(nextMisspelledWord,
|
||||
&mSuggestedWordList);
|
||||
|
||||
|
|
|
@ -991,6 +991,9 @@ nsEditor::EndPlaceHolderTransaction()
|
|||
// time to turn off the batch
|
||||
EndUpdateViewBatch();
|
||||
// make sure selection is in view
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
ScrollSelectionIntoView(PR_FALSE);
|
||||
|
||||
// cached for frame offset are Not available now
|
||||
|
@ -2560,6 +2563,8 @@ NS_IMETHODIMP nsEditor::ScrollSelectionIntoView(PRBool aScrollToAnchor)
|
|||
syncScroll = !(flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask);
|
||||
}
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
region, syncScroll);
|
||||
}
|
||||
|
|
|
@ -1439,6 +1439,9 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable
|
|||
}
|
||||
|
||||
// Try to scroll the selection into view if the paste/drop succeeded
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
if (NS_SUCCEEDED(rv))
|
||||
ScrollSelectionIntoView(PR_FALSE);
|
||||
|
||||
|
@ -1667,6 +1670,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, aDropEvent, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertFromTransferable(trans, srcdomdoc, contextStr, infoStr,
|
||||
newSelectionParent,
|
||||
newSelectionOffset, deleteSelection);
|
||||
|
@ -1887,6 +1892,8 @@ NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertFromTransferable(trans, nsnull, contextStr, infoStr,
|
||||
nsnull, 0, PR_TRUE);
|
||||
}
|
||||
|
@ -1918,6 +1925,8 @@ NS_IMETHODIMP nsHTMLEditor::PasteNoFormatting(PRInt32 aSelectionType)
|
|||
if (NS_SUCCEEDED(clipboard->GetData(trans, aSelectionType)) && IsModifiable())
|
||||
{
|
||||
const nsAFlatString& empty = EmptyString();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertFromTransferable(trans, nsnull, empty, empty, nsnull, 0,
|
||||
PR_TRUE);
|
||||
}
|
||||
|
|
|
@ -672,6 +672,8 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
|||
|
||||
aMouseEvent->StopPropagation();
|
||||
aMouseEvent->PreventDefault();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
return mEditor->InsertFromDrop(aMouseEvent);
|
||||
}
|
||||
|
||||
|
|
|
@ -136,6 +136,9 @@ NS_IMETHODIMP nsPlaintextEditor::InsertTextFromTransferable(nsITransferable *aTr
|
|||
NS_Free(bestFlavor);
|
||||
|
||||
// Try to scroll the selection into view if the paste/drop succeeded
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be flushed
|
||||
// and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
if (NS_SUCCEEDED(rv))
|
||||
ScrollSelectionIntoView(PR_FALSE);
|
||||
|
||||
|
@ -301,6 +304,8 @@ NS_IMETHODIMP nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(destdomdoc, aDropEvent, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertTextFromTransferable(trans, newSelectionParent, newSelectionOffset, deleteSelection);
|
||||
}
|
||||
|
||||
|
@ -450,6 +455,8 @@ NS_IMETHODIMP nsPlaintextEditor::Paste(PRInt32 aSelectionType)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertTextFromTransferable(trans, nsnull, nsnull, PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1831,6 +1831,8 @@ nsTextServicesDocument::ScrollSelectionIntoView()
|
|||
|
||||
LOCK_DOC(this);
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be flushed
|
||||
// and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
result = mSelCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
|
|
|
@ -151,6 +151,9 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
}
|
||||
|
||||
// next, look in the current frame. If found, return.
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_FALSE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -199,6 +202,8 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
|
||||
OnStartSearchFrame(searchFrame);
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_FALSE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -239,6 +244,8 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
|
||||
if (curItem.get() == startingItem.get())
|
||||
{
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_TRUE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -251,6 +258,8 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
|
||||
OnStartSearchFrame(searchFrame);
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_FALSE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -472,9 +481,12 @@ void nsWebBrowserFind::SetSelectionAndScroll(nsIDOMWindow* aWindow,
|
|||
|
||||
// Scroll if necessary to make the selection visible:
|
||||
// Must be the last thing to do - bug 242056
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView
|
||||
(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -821,6 +833,8 @@ nsresult nsWebBrowserFind::SearchInFrame(nsIDOMWindow* aWindow,
|
|||
{
|
||||
*aDidFind = PR_TRUE;
|
||||
sel->RemoveAllRanges();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
SetSelectionAndScroll(aWindow, foundRange);
|
||||
}
|
||||
|
||||
|
|
|
@ -151,14 +151,22 @@ nsPermissionManager::InitDB()
|
|||
|
||||
// cache a connection to the hosts database
|
||||
rv = storage->OpenDatabase(permissionsFile, getter_AddRefs(mDBConn));
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool ready;
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready) {
|
||||
// delete and try again
|
||||
rv = permissionsFile->Remove(PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = storage->OpenDatabase(permissionsFile, getter_AddRefs(mDBConn));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool tableExists = PR_FALSE;
|
||||
mDBConn->TableExists(NS_LITERAL_CSTRING("moz_hosts"), &tableExists);
|
||||
|
|
|
@ -37,40 +37,34 @@
|
|||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
|
||||
DEPTH=../..
|
||||
topsrcdir=@top_srcdir@
|
||||
srcdir=@srcdir@
|
||||
VPATH=@srcdir@
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = inspector
|
||||
MODULE = inspector
|
||||
DOMi_VERSION = 2.0.0
|
||||
|
||||
DIRS=base resources
|
||||
DIRS = \
|
||||
base \
|
||||
resources \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_XUL_APP
|
||||
XPI_NAME = inspector
|
||||
USE_EXTENSION_MANIFEST = 1
|
||||
NO_JAR_AUTO_REG = 1
|
||||
INSTALL_EXTENSION_ID = inspector@mozilla.org
|
||||
XPI_PKGNAME = inspector-$(MOZ_APP_VERSION)
|
||||
endif
|
||||
XPI_PKGNAME = inspector-$(DOMi_VERSION)
|
||||
|
||||
PREF_JS_EXPORTS = $(srcdir)/resources/content/prefs/inspector.js
|
||||
|
||||
DIST_FILES = install.rdf
|
||||
|
||||
# We should really pull FIREFOX_VERSION and THUNDERBIRD_VERSION from
|
||||
# browser/config/version.txt mail/config/version.txt but we can't be assured
|
||||
# that we've even pulled those files. So we hardcode them.
|
||||
|
||||
XULAPP_DEFINES = \
|
||||
-DFIREFOX_VERSION=$(FIREFOX_VERSION) \
|
||||
-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
|
||||
-DSUNBIRD_VERSION=$(SUNBIRD_VERSION) \
|
||||
-DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
|
||||
-DEXTENSION_VERSION=$(MOZILLA_VERSION) \
|
||||
$(NULL)
|
||||
-DDOMi_VERSION=$(DOMi_VERSION) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>inspector@mozilla.org</em:id>
|
||||
<em:version>@EXTENSION_VERSION@</em:version>
|
||||
<em:version>@DOMi_VERSION@</em:version>
|
||||
|
||||
<em:targetApplication>
|
||||
<!-- Firefox -->
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>3.0a1</em:minVersion>
|
||||
<em:maxVersion>@FIREFOX_VERSION@</em:maxVersion>
|
||||
<em:maxVersion>3.0b4pre</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
<Description>
|
||||
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
|
||||
<em:minVersion>3.0a1pre</em:minVersion>
|
||||
<em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
|
||||
<em:maxVersion>3.0a1pre</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
|
@ -30,8 +30,8 @@
|
|||
<!-- Sunbird -->
|
||||
<Description>
|
||||
<em:id>{718e30fb-e89b-41dd-9da7-e25a45638b28}</em:id>
|
||||
<em:minVersion>0.6a1pre</em:minVersion>
|
||||
<em:maxVersion>@SUNBIRD_VERSION@</em:maxVersion>
|
||||
<em:minVersion>0.8pre</em:minVersion>
|
||||
<em:maxVersion>0.8pre</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
|
@ -39,8 +39,8 @@
|
|||
<!-- Suite -->
|
||||
<Description>
|
||||
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
|
||||
<em:minVersion>1.5a</em:minVersion>
|
||||
<em:maxVersion>@SEAMONKEY_VERSION@</em:maxVersion>
|
||||
<em:minVersion>2.0a</em:minVersion>
|
||||
<em:maxVersion>2.0a1pre</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
|
@ -49,18 +49,10 @@
|
|||
<Description>
|
||||
<em:id>toolkit@mozilla.org</em:id>
|
||||
<em:minVersion>1.9a1</em:minVersion>
|
||||
<em:maxVersion>@EXTENSION_VERSION@</em:maxVersion>
|
||||
<em:maxVersion>1.9</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
<!-- EXTENSION AUTHORS!
|
||||
DO NOT COPY THIS PROPERTY INTO YOUR INSTALL RDF FILES
|
||||
It will cause users not to be informed of incompatibilities
|
||||
with your extension when they are updated with Software Update
|
||||
and your extension will become unavailable to them!
|
||||
-->
|
||||
<em:appManaged>true</em:appManaged>
|
||||
|
||||
<!-- front-end metadata -->
|
||||
<em:name>DOM Inspector</em:name>
|
||||
<em:description>Inspects the structure and properties of a window and its contents.</em:description>
|
||||
|
|
|
@ -112,6 +112,9 @@ mozSpellChecker::NextMisspelledWord(nsAString &aWord, nsStringArray *aSuggestion
|
|||
if(isMisspelled){
|
||||
aWord = currWord;
|
||||
mTsDoc->SetSelection(begin, end-begin);
|
||||
// After ScrollSelectionIntoView(), the pending notifications might
|
||||
// be flushed and PresShell/PresContext/Frames may be dead.
|
||||
// See bug 418470.
|
||||
mTsDoc->ScrollSelectionIntoView();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -538,25 +538,25 @@ nsThebesImage::Draw(nsIRenderingContext &aContext,
|
|||
|
||||
pat->SetMatrix(mat);
|
||||
|
||||
if (xscale != 1.0 || yscale != 1.0) {
|
||||
#if !defined(XP_MACOSX) && !defined(XP_WIN)
|
||||
// See bug 324698. This is a workaround.
|
||||
//
|
||||
// Set the filter to CAIRO_FILTER_FAST if we're scaling up -- otherwise,
|
||||
// pixman's sampling will sample transparency for the outside edges and we'll
|
||||
// get blurry edges. CAIRO_EXTEND_PAD would also work here, if
|
||||
// available
|
||||
//
|
||||
// This effectively disables smooth upscaling for images.
|
||||
// See bug 324698. This is a workaround.
|
||||
//
|
||||
// Set the filter to CAIRO_FILTER_FAST if we're scaling up -- otherwise,
|
||||
// pixman's sampling will sample transparency for the outside edges and we'll
|
||||
// get blurry edges. CAIRO_EXTEND_PAD would also work here, if
|
||||
// available
|
||||
//
|
||||
// This effectively disables smooth upscaling for images.
|
||||
if (xscale > 1.0 || yscale > 1.0)
|
||||
pat->SetFilter(0);
|
||||
#endif
|
||||
|
||||
#if defined(XP_WIN)
|
||||
// turn on EXTEND_PAD only for win32, and only when scaling;
|
||||
// it's not implemented correctly on linux in the X server.
|
||||
// turn on EXTEND_PAD only for win32, and only when scaling;
|
||||
// it's not implemented correctly on linux in the X server.
|
||||
if (xscale != 1.0 || yscale != 1.0)
|
||||
pat->SetExtend(gfxPattern::EXTEND_PAD);
|
||||
#endif
|
||||
}
|
||||
|
||||
gfxContext::GraphicsOperator op = ctx->CurrentOperator();
|
||||
if (op == gfxContext::OPERATOR_OVER && mFormat == gfxASurface::ImageFormatRGB24)
|
||||
|
|
|
@ -2196,9 +2196,9 @@ UnwindScope(JSContext *cx, JSStackFrame *fp, jsint stackDepth,
|
|||
* are written to JS_OPMETER_HIST, defaulting to /tmp/ops.hist.
|
||||
*/
|
||||
#ifndef JS_OPMETER
|
||||
# define METER_OP_INIT(op) /* nothing */
|
||||
# define METER_OP_PAIR(op1,op2) /* nothing */
|
||||
# define METER_SLOT_OP(op,slot) /* nothing */
|
||||
# define METER_OP_INIT(op) ((void)0)
|
||||
# define METER_OP_PAIR(op1,op2) ((void)0)
|
||||
# define METER_SLOT_OP(op,slot) ((void)0)
|
||||
#else
|
||||
|
||||
# include <stdlib.h>
|
||||
|
@ -2264,12 +2264,12 @@ js_DumpOpMeters()
|
|||
|
||||
graph = (Edge *) calloc(nedges, sizeof graph[0]);
|
||||
for (i = nedges = 0; i < JSOP_LIMIT; i++) {
|
||||
from = js_CodeSpec[i].name;
|
||||
from = js_CodeName[i];
|
||||
for (j = 0; j < JSOP_LIMIT; j++) {
|
||||
count = succeeds[i][j];
|
||||
if (count != 0 && SIGNIFICANT(count, total)) {
|
||||
graph[nedges].from = from;
|
||||
graph[nedges].to = js_CodeSpec[j].name;
|
||||
graph[nedges].to = js_CodeName[j];
|
||||
graph[nedges].count = count;
|
||||
++nedges;
|
||||
}
|
||||
|
@ -2315,7 +2315,7 @@ js_DumpOpMeters()
|
|||
for (j = 0; j < HIST_NSLOTS; j++) {
|
||||
if (slot_ops[i][j] != 0) {
|
||||
/* Reuse j in the next loop, since we break after. */
|
||||
fprintf(fp, "%-8.8s", js_CodeSpec[i].name);
|
||||
fprintf(fp, "%-8.8s", js_CodeName[i]);
|
||||
for (j = 0; j < HIST_NSLOTS; j++)
|
||||
fprintf(fp, " %7lu", (unsigned long)slot_ops[i][j]);
|
||||
putc('\n', fp);
|
||||
|
@ -5932,7 +5932,20 @@ interrupt:
|
|||
JS_ASSERT(PCVAL_IS_SPROP(entry->vword));
|
||||
sprop = PCVAL_TO_SPROP(entry->vword);
|
||||
JS_ASSERT(!(sprop->attrs & JSPROP_READONLY));
|
||||
JS_ASSERT(SPROP_HAS_STUB_SETTER(sprop));
|
||||
|
||||
/*
|
||||
* If this property has a non-stub setter, it must be
|
||||
* __proto__, __parent__, or another "shared prototype"
|
||||
* built-in. Force a miss to save code size here and let
|
||||
* the standard code path take care of business.
|
||||
*/
|
||||
if (!SPROP_HAS_STUB_SETTER(sprop))
|
||||
goto do_initprop_miss;
|
||||
|
||||
/*
|
||||
* Otherwise this entry must be for a direct property of
|
||||
* obj, not a proto-property.
|
||||
*/
|
||||
JS_ASSERT(PCVCAP_MAKE(sprop->shape, 0, 0) == entry->vcap);
|
||||
|
||||
if (scope->object != obj) {
|
||||
|
@ -5943,9 +5956,17 @@ interrupt:
|
|||
}
|
||||
}
|
||||
|
||||
JS_ASSERT(sprop->parent == scope->lastProp);
|
||||
/*
|
||||
* Detect a repeated property name and force a miss to
|
||||
* share the strict warning code and cope with complexity
|
||||
* managed by js_AddScopeProperty.
|
||||
*/
|
||||
if (sprop->parent != scope->lastProp)
|
||||
goto do_initprop_miss;
|
||||
|
||||
JS_ASSERT(!SCOPE_HAD_MIDDLE_DELETE(scope));
|
||||
JS_ASSERT(!scope->table || !SCOPE_HAS_PROPERTY(scope, sprop));
|
||||
JS_ASSERT(!scope->table ||
|
||||
!SCOPE_HAS_PROPERTY(scope, sprop));
|
||||
|
||||
slot = sprop->slot;
|
||||
JS_ASSERT(slot == scope->map.freeslot);
|
||||
|
@ -5987,13 +6008,13 @@ interrupt:
|
|||
break;
|
||||
}
|
||||
|
||||
do_initprop_miss:
|
||||
PCMETER(cache->inipcmisses++);
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
|
||||
/* Get the immediate property name into id. */
|
||||
LOAD_ATOM(0);
|
||||
id = ATOM_TO_JSID(atom);
|
||||
i = -1;
|
||||
SAVE_SP_AND_PC(fp);
|
||||
|
||||
/* Set the property named by obj[id] to rval. */
|
||||
|
|
|
@ -101,7 +101,7 @@ static const char *CodeToken[] = {
|
|||
/*
|
||||
* Array of JS bytecode names used by DEBUG-only js_Disassemble.
|
||||
*/
|
||||
static const char *CodeName[] = {
|
||||
const char *js_CodeName[] = {
|
||||
#define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format) \
|
||||
name,
|
||||
#include "jsopcode.tbl"
|
||||
|
@ -238,7 +238,7 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
|
|||
fprintf(fp, "%05u:", loc);
|
||||
if (lines)
|
||||
fprintf(fp, "%4u", JS_PCToLineNumber(cx, script, pc));
|
||||
fprintf(fp, " %s", CodeName[op]);
|
||||
fprintf(fp, " %s", js_CodeName[op]);
|
||||
type = JOF_TYPE(cs->format);
|
||||
switch (type) {
|
||||
case JOF_BYTE:
|
||||
|
|
|
@ -260,6 +260,7 @@ struct JSCodeSpec {
|
|||
|
||||
extern const JSCodeSpec js_CodeSpec[];
|
||||
extern uintN js_NumCodeSpecs;
|
||||
extern const char *js_CodeName[];
|
||||
extern const char js_EscapeMap[];
|
||||
|
||||
/*
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/* -*- 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): Mike Shaver
|
||||
*
|
||||
* 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 = 'regress-419152.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 419152;
|
||||
var summary = 'Shaver can not contain himself';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
var a = [1,2,3];
|
||||
|
||||
a[5] = 6;
|
||||
expect = '1,2,3,,,6:6';
|
||||
actual = a + ':' + a.length;
|
||||
reportCompare(expect, actual, summary + ': 1');
|
||||
|
||||
a = [1,2,3,4];
|
||||
expect = 'undefined';
|
||||
actual = a[-1] + '';
|
||||
reportCompare(expect, actual, summary + ': 2');
|
||||
|
||||
a = [1,2,3];
|
||||
a[-1] = 55;
|
||||
|
||||
expect = 3;
|
||||
actual = a.length;
|
||||
reportCompare(expect, actual, summary + ': 3');
|
||||
|
||||
expect = '1,2,3';
|
||||
actual = a + '';
|
||||
reportCompare(expect, actual, summary + ': 4');
|
||||
|
||||
expect = 55;
|
||||
actual = a[-1];
|
||||
reportCompare(expect, actual, summary + ': 5');
|
||||
|
||||
var s = "abcdef";
|
||||
|
||||
expect = 'undefined';
|
||||
actual = s[-2] + '';
|
||||
reportCompare(expect, actual, summary + ': 6');
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* -*- 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): Jesse Ruderman
|
||||
*
|
||||
* 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 = 'regress-419803.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 419803;
|
||||
var summary = 'Do not assert: sprop->parent == scope->lastProp';
|
||||
var actual = 'No Crash';
|
||||
var expect = 'No Crash';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
for (var i=0; i<2; ++i) ({ p: 5, p: 7 });
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/* -*- 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): Jesse Ruderman
|
||||
*
|
||||
* 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 = 'regress-419803.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 419803;
|
||||
var summary = 'Do not assert: sprop->parent == scope->lastProp';
|
||||
var actual = 'No Crash';
|
||||
var expect = 'No Crash';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
function g() { for (var i=0; i<2; ++i) yield ({ p: 5, p: 7 }); }
|
||||
var iter = g();
|
||||
print(uneval(iter.next()));
|
||||
print(uneval(iter.next()));
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
|
@ -2773,7 +2773,8 @@ PresShell::PageMove(PRBool aForward, PRBool aExtend)
|
|||
nsIView *scrolledView;
|
||||
result = scrollableView->GetScrolledView(scrolledView);
|
||||
mSelection->CommonPageMove(aForward, aExtend, scrollableView);
|
||||
// do ScrollSelectionIntoView()
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -2849,6 +2850,8 @@ PresShell::CompleteScroll(PRBool aForward)
|
|||
NS_IMETHODIMP
|
||||
PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
|
||||
{
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
return CompleteMoveInner(aForward, aExtend, PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -2886,6 +2889,8 @@ PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollInto
|
|||
mSelection->SetAncestorLimiter(root);
|
||||
|
||||
if (aScrollIntoView) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return
|
||||
ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION,
|
||||
|
@ -2930,6 +2935,8 @@ PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollInto
|
|||
mSelection->HandleClick(pos.mResultContent ,pos.mContentOffset ,pos.mContentOffset/*End*/ ,aExtend, PR_FALSE, aForward);
|
||||
|
||||
if (aScrollIntoView) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
result = ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
if (NS_FAILED(result))
|
||||
|
|
|
@ -525,14 +525,31 @@ nsListControlFrame::CalcHeightOfARow()
|
|||
return heightOfARow;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsListControlFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
||||
{
|
||||
nscoord result;
|
||||
DISPLAY_PREF_WIDTH(this, result);
|
||||
|
||||
// Always add scrollbar widths to the pref-width of the scrolled
|
||||
// content. Combobox frames depend on this happening in the dropdown,
|
||||
// and standalone listboxes are overflow:scroll so they need it too.
|
||||
result = GetScrolledFrame()->GetPrefWidth(aRenderingContext);
|
||||
nsBoxLayoutState bls(PresContext(), aRenderingContext);
|
||||
result = NSCoordSaturatingAdd(result, GetDesiredScrollbarSizes(&bls).LeftRight());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsListControlFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
|
||||
{
|
||||
// Scrollframes typically have an intrinsic min width of 0, but
|
||||
// that's not how we want to behave.
|
||||
nscoord result;
|
||||
DISPLAY_MIN_WIDTH(this, result);
|
||||
|
||||
// Always add scrollbar widths to the min-width of the scrolled
|
||||
// content. Combobox frames depend on this happening in the dropdown,
|
||||
// and standalone listboxes are overflow:scroll so they need it too.
|
||||
result = GetScrolledFrame()->GetMinWidth(aRenderingContext);
|
||||
nsBoxLayoutState bls(PresContext(), aRenderingContext);
|
||||
result += GetDesiredScrollbarSizes(&bls).LeftRight();
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
// Our min width is our pref width
|
||||
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
|
||||
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
|
||||
|
||||
NS_IMETHOD Reflow(nsPresContext* aCX,
|
||||
|
|
|
@ -670,6 +670,8 @@ NS_IMETHODIMP
|
|||
nsTextInputSelectionImpl::ScrollSelectionIntoView(PRInt16 aType, PRInt16 aRegion, PRBool aIsSynchronous)
|
||||
{
|
||||
if (mFrameSelection) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
nsresult rv = mFrameSelection->ScrollSelectionIntoView(aType, aRegion, aIsSynchronous);
|
||||
|
||||
nsIScrollableView* scrollableView = mFrameSelection->GetScrollableView();
|
||||
|
@ -859,6 +861,8 @@ nsTextInputSelectionImpl::PageMove(PRBool aForward, PRBool aExtend)
|
|||
if (scrollableView)
|
||||
mFrameSelection->CommonPageMove(aForward, aExtend, scrollableView);
|
||||
}
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -699,32 +699,34 @@ nsHTMLScrollFrame::PlaceScrollArea(const ScrollReflowState& aState)
|
|||
NS_FRAME_NO_MOVE_VIEW);
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsHTMLScrollFrame::GetIntrinsicVScrollbarWidth(nsIRenderingContext *aRenderingContext)
|
||||
{
|
||||
nsGfxScrollFrameInner::ScrollbarStyles ss = GetScrollbarStyles();
|
||||
if (ss.mVertical != NS_STYLE_OVERFLOW_SCROLL || !mInner.mVScrollbarBox)
|
||||
return 0;
|
||||
|
||||
nsBoxLayoutState bls(PresContext(), aRenderingContext);
|
||||
nsSize vScrollbarPrefSize(0, 0);
|
||||
GetScrollbarMetrics(bls, mInner.mVScrollbarBox,
|
||||
nsnull, &vScrollbarPrefSize, PR_TRUE);
|
||||
return vScrollbarPrefSize.width;
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
nsHTMLScrollFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
|
||||
{
|
||||
nscoord result = mInner.mScrolledFrame->GetMinWidth(aRenderingContext);
|
||||
DISPLAY_MIN_WIDTH(this, result);
|
||||
return result;
|
||||
return result + GetIntrinsicVScrollbarWidth(aRenderingContext);
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
nsHTMLScrollFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
||||
{
|
||||
nscoord result;
|
||||
nscoord result = mInner.mScrolledFrame->GetPrefWidth(aRenderingContext);
|
||||
DISPLAY_PREF_WIDTH(this, result);
|
||||
result = mInner.mScrolledFrame->GetPrefWidth(aRenderingContext);
|
||||
|
||||
nsGfxScrollFrameInner::ScrollbarStyles ss = GetScrollbarStyles();
|
||||
if (ss.mVertical != NS_STYLE_OVERFLOW_HIDDEN && // ideal?
|
||||
mInner.mVScrollbarBox) {
|
||||
nsBoxLayoutState bls(PresContext(), aRenderingContext);
|
||||
nsSize vScrollbarPrefSize(0, 0);
|
||||
GetScrollbarMetrics(bls, mInner.mVScrollbarBox,
|
||||
nsnull, &vScrollbarPrefSize, PR_TRUE);
|
||||
result = NSCoordSaturatingAdd(result, vScrollbarPrefSize.width);
|
||||
}
|
||||
|
||||
return result;
|
||||
return NSCoordSaturatingAdd(result, GetIntrinsicVScrollbarWidth(aRenderingContext));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -275,6 +275,7 @@ public:
|
|||
nsresult ReflowContents(ScrollReflowState* aState,
|
||||
const nsHTMLReflowMetrics& aDesiredSize);
|
||||
void PlaceScrollArea(const ScrollReflowState& aState);
|
||||
nscoord GetIntrinsicVScrollbarWidth(nsIRenderingContext *aRenderingContext);
|
||||
|
||||
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
|
||||
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
|
||||
|
|
|
@ -2558,8 +2558,10 @@ nsFrameSelection::ScrollSelectionIntoView(SelectionType aType,
|
|||
if (!mDomSelections[index])
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return mDomSelections[index]->ScrollIntoView(aRegion, aIsSynchronous,
|
||||
PR_FALSE);
|
||||
PR_TRUE);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>Testcase, bug 363402</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border align="left">
|
||||
<tr><td>table</td></tr>
|
||||
<tr><td>table</td></tr>
|
||||
<tr><td>table</td></tr>
|
||||
</table>
|
||||
|
||||
<p>This is text that should flow around the table.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>Testcase, bug 363402</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
|
||||
caption span { visibility: hidden; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border align="left">
|
||||
<caption align="bottom"><span>x x x x x x x x x x x x x x x x x x x x x</span></caption>
|
||||
<tr><td>table</td></tr>
|
||||
<tr><td>table</td></tr>
|
||||
<tr><td>table</td></tr>
|
||||
</table>
|
||||
|
||||
<p>This is text that should flow around the table.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.container { margin-top:1em; background:yellow; width:100px; }
|
||||
.content { width:100px; height:60px; }
|
||||
.scroll-in { overflow:scroll; }
|
||||
.scroll { overflow-x:scroll; width:200px; }
|
||||
.over { height:50px; }
|
||||
body { margin:0; position:absolute; clip: rect(0 100px auto 0); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll-in over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll-in over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.container { float:left; margin-top:1em; clear:both; }
|
||||
.auto { overflow:auto; }
|
||||
.scroll { overflow:scroll; }
|
||||
.content { width:100px; height:60px; background:yellow; }
|
||||
.over { height:50px; }
|
||||
body { margin:0; position:absolute; clip: rect(0 100px auto 0); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- test pref-width -->
|
||||
|
||||
<div class="container auto">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container auto over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
|
||||
<!-- test min-width -->
|
||||
|
||||
<div style="width:0">
|
||||
<div class="container auto">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container auto over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<div class="container scroll over">
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Bidi text in inline with background image</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-size: 0;
|
||||
}
|
||||
i {
|
||||
background-image: url(mozilla-banner.gif);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
i, b {
|
||||
padding: 29px 30px;
|
||||
line-height: 58px;
|
||||
}
|
||||
.l0{
|
||||
background-position: 0 0;
|
||||
}
|
||||
.l60{
|
||||
background-position: -60px 0;
|
||||
}
|
||||
.l120{
|
||||
background-position: -120px 0;
|
||||
}
|
||||
.l180{
|
||||
background-position: -180px 0;
|
||||
}
|
||||
.r0{
|
||||
background-position: -540px 0;
|
||||
}
|
||||
.r60{
|
||||
background-position: -480px 0;
|
||||
}
|
||||
.r120{
|
||||
background-position: -420px 0;
|
||||
}
|
||||
.r180{
|
||||
background-position: -360px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p dir="rtl"><i class="l180"></i><br><i class="l120"></i><i class="l60"></i><b></b><i class="l0"></i></p>
|
||||
<p dir="rtl"><i class="r0"></i><br><i class="r60"></i><i class="r120"></i><b></b><i class="r180"></i></p>
|
||||
<p dir="ltr"><i class="l0"></i><br><i class="l60"></i><b></b><i class="l120"></i><i class="l180"></i></p>
|
||||
<p dir="ltr"><i class="r180"></i><br><i class="r120"></i><b></b><i class="r60"></i><i class="r0"></i></p>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Bidi text in inline with background image</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-size: 0;
|
||||
}
|
||||
span {
|
||||
padding: 29px 0;
|
||||
line-height: 58px;
|
||||
}
|
||||
.bgleft {
|
||||
background: url(mozilla-banner.gif) no-repeat;
|
||||
}
|
||||
.bgright {
|
||||
background: url(mozilla-banner.gif) no-repeat right top;
|
||||
}
|
||||
i {
|
||||
padding: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p dir="rtl"><span class="bgleft"><i>‏</i><br><i>‎</i><i>‏</i><i>‎</i></span><i>‎</i></p>
|
||||
<p dir="rtl"><span class="bgright"><i>‏</i><br><i>‎</i><i>‏</i><i>‎</i></span><i>‎</i></p>
|
||||
<p dir="ltr"><span class="bgleft"><i>‎</i><br><i>‎</i><i>‏</i><i dir="ltr">‎</i></span><i>‏</i></p>
|
||||
<p dir="ltr"><span class="bgright"><i>‎</i><br><i>‎</i><i>‏</i><i dir="ltr">‎</i></span><i>‏</i></p>
|
||||
</body>
|
||||
</html>
|
|
@ -373,6 +373,7 @@ skip-if(MOZ_WIDGET_TOOLKIT=="windows") == 347496-1.xhtml 347496-1-ref.xhtml # Bu
|
|||
== 363329-1.html 363329-1-ref.html
|
||||
== 363329-2.html 363329-2-ref.html
|
||||
== 363370-1.html 363370-1-ref.html
|
||||
== 363402-1.html 363402-1-ref.html
|
||||
== 363637-1.html 363637-1-ref.html
|
||||
== 363858-1.html 363858-1-ref.html
|
||||
== 363858-2.html 363858-2-ref.html
|
||||
|
@ -681,6 +682,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
|
|||
== 405517-1.xhtml 405517-1-ref.xhtml
|
||||
== 405577-1.html 405577-1-ref.html
|
||||
== 405584-1.html 405584-1-ref.html
|
||||
# == 405952-1.html 405952-1-ref.html
|
||||
== 406073-1.html 406073-1-ref.html
|
||||
== 406484-1.html 406484-1-ref.html
|
||||
== 406568-1.html 406568-1-ref.html
|
||||
|
@ -707,6 +709,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
|
|||
== 409659-1d.html 409659-1-ref.html
|
||||
== 411334-1.xml 411334-1-ref.xml
|
||||
== 411792-1.html 411792-1-ref.html
|
||||
== 412093-1.html 412093-1-ref.html
|
||||
== 412607-1a.html 412607-1-ref.html
|
||||
== 412607-1b.html 412607-1-ref.html
|
||||
== 412679-1.html 412679-1-ref.html
|
||||
|
|
|
@ -686,6 +686,34 @@ nsTableOuterFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
|||
return maxWidth;
|
||||
}
|
||||
|
||||
// Compute the margin-box width of aChildFrame given the inputs. If
|
||||
// aMarginResult is non-null, fill it with the part of the margin-width
|
||||
// that was contributed by the margin.
|
||||
static nscoord
|
||||
ChildShrinkWrapWidth(nsIRenderingContext *aRenderingContext,
|
||||
nsIFrame *aChildFrame,
|
||||
nsSize aCBSize, nscoord aAvailableWidth,
|
||||
nscoord *aMarginResult = nsnull)
|
||||
{
|
||||
// The outer table's children do not use it as a containing block.
|
||||
nsCSSOffsetState offsets(aChildFrame, aRenderingContext, aCBSize.width);
|
||||
nsSize size = aChildFrame->ComputeSize(aRenderingContext, aCBSize,
|
||||
aAvailableWidth,
|
||||
nsSize(offsets.mComputedMargin.LeftRight(),
|
||||
offsets.mComputedMargin.TopBottom()),
|
||||
nsSize(offsets.mComputedBorderPadding.LeftRight() -
|
||||
offsets.mComputedPadding.LeftRight(),
|
||||
offsets.mComputedBorderPadding.TopBottom() -
|
||||
offsets.mComputedPadding.TopBottom()),
|
||||
nsSize(offsets.mComputedPadding.LeftRight(),
|
||||
offsets.mComputedPadding.TopBottom()),
|
||||
PR_TRUE);
|
||||
if (aMarginResult)
|
||||
*aMarginResult = offsets.mComputedMargin.LeftRight();
|
||||
return size.width + offsets.mComputedMargin.LeftRight() +
|
||||
offsets.mComputedBorderPadding.LeftRight();
|
||||
}
|
||||
|
||||
/* virtual */ nsSize
|
||||
nsTableOuterFrame::ComputeAutoSize(nsIRenderingContext *aRenderingContext,
|
||||
nsSize aCBSize, nscoord aAvailableWidth,
|
||||
|
@ -701,48 +729,40 @@ nsTableOuterFrame::ComputeAutoSize(nsIRenderingContext *aRenderingContext,
|
|||
// could be something that is not reflected in our GetMinWidth and
|
||||
// GetPrefWidth. See bug 349457 for an example.
|
||||
|
||||
// The outer table's children do not use it as a containing block.
|
||||
nsCSSOffsetState innerOffsets(mInnerTableFrame, aRenderingContext,
|
||||
aCBSize.width);
|
||||
nsSize tableSize = mInnerTableFrame->ComputeSize(aRenderingContext, aCBSize,
|
||||
aAvailableWidth,
|
||||
nsSize(innerOffsets.mComputedMargin.LeftRight(),
|
||||
innerOffsets.mComputedMargin.TopBottom()),
|
||||
nsSize(innerOffsets.mComputedBorderPadding.LeftRight() -
|
||||
innerOffsets.mComputedPadding.LeftRight(),
|
||||
innerOffsets.mComputedBorderPadding.TopBottom() -
|
||||
innerOffsets.mComputedPadding.TopBottom()),
|
||||
nsSize(innerOffsets.mComputedPadding.LeftRight(),
|
||||
innerOffsets.mComputedPadding.TopBottom()),
|
||||
aShrinkWrap);
|
||||
nscoord width = tableSize.width + innerOffsets.mComputedMargin.LeftRight() +
|
||||
innerOffsets.mComputedBorderPadding.LeftRight();
|
||||
|
||||
if (mCaptionFrame) {
|
||||
nsCSSOffsetState capOffsets(mCaptionFrame, aRenderingContext,
|
||||
aCBSize.width);
|
||||
PRUint8 captionSide = GetCaptionSide();
|
||||
// Should we adjust aAvailableWidth before using it (based on captionSide)?
|
||||
nsSize capSize = mCaptionFrame->ComputeSize(aRenderingContext, aCBSize,
|
||||
aAvailableWidth,
|
||||
nsSize(capOffsets.mComputedMargin.LeftRight(),
|
||||
capOffsets.mComputedMargin.TopBottom()),
|
||||
nsSize(capOffsets.mComputedBorderPadding.LeftRight() -
|
||||
capOffsets.mComputedPadding.LeftRight(),
|
||||
capOffsets.mComputedBorderPadding.TopBottom() -
|
||||
capOffsets.mComputedPadding.TopBottom()),
|
||||
nsSize(capOffsets.mComputedPadding.LeftRight(),
|
||||
capOffsets.mComputedPadding.TopBottom()),
|
||||
aShrinkWrap);
|
||||
nscoord capWidth = capSize.width + capOffsets.mComputedMargin.LeftRight() +
|
||||
capOffsets.mComputedBorderPadding.LeftRight();
|
||||
if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT ||
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) {
|
||||
width += capWidth;
|
||||
} else {
|
||||
if (capWidth > width)
|
||||
width = capWidth;
|
||||
}
|
||||
// Match the availableWidth logic in Reflow.
|
||||
PRUint8 captionSide = GetCaptionSide();
|
||||
nscoord width;
|
||||
if (captionSide == NO_SIDE) {
|
||||
width = ChildShrinkWrapWidth(aRenderingContext, mInnerTableFrame,
|
||||
aCBSize, aAvailableWidth);
|
||||
} else if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT ||
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) {
|
||||
nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext, mCaptionFrame,
|
||||
aCBSize, aAvailableWidth);
|
||||
width = capWidth + ChildShrinkWrapWidth(aRenderingContext,
|
||||
mInnerTableFrame, aCBSize,
|
||||
aAvailableWidth - capWidth);
|
||||
} else if (captionSide == NS_STYLE_CAPTION_SIDE_TOP ||
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM) {
|
||||
nscoord margin;
|
||||
width = ChildShrinkWrapWidth(aRenderingContext, mInnerTableFrame,
|
||||
aCBSize, aAvailableWidth, &margin);
|
||||
nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext,
|
||||
mCaptionFrame, aCBSize,
|
||||
width - margin);
|
||||
if (capWidth > width)
|
||||
width = capWidth;
|
||||
} else {
|
||||
NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE ||
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
|
||||
"unexpected caption-side");
|
||||
width = ChildShrinkWrapWidth(aRenderingContext, mInnerTableFrame,
|
||||
aCBSize, aAvailableWidth);
|
||||
nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext,
|
||||
mCaptionFrame, aCBSize,
|
||||
aAvailableWidth);
|
||||
if (capWidth > width)
|
||||
width = capWidth;
|
||||
}
|
||||
|
||||
return nsSize(width, NS_UNCONSTRAINEDSIZE);
|
||||
|
@ -1259,6 +1279,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsHTMLReflowState *innerRS =
|
||||
static_cast<nsHTMLReflowState*>((void*) innerRSSpace);
|
||||
|
||||
// ComputeAutoSize has to match this logic.
|
||||
if (captionSide == NO_SIDE) {
|
||||
// We don't have a caption.
|
||||
OuterBeginReflowChild(aPresContext, mInnerTableFrame, aOuterRS,
|
||||
|
|
|
@ -467,13 +467,23 @@ nsCookieService::InitDB()
|
|||
|
||||
// cache a connection to the cookie database
|
||||
rv = storage->OpenDatabase(cookieFile, getter_AddRefs(mDBConn));
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
// delete and try again
|
||||
cookieFile->Remove(PR_FALSE);
|
||||
rv = storage->OpenDatabase(cookieFile, getter_AddRefs(mDBConn));
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool ready;
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready) {
|
||||
// delete and try again
|
||||
rv = cookieFile->Remove(PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = storage->OpenDatabase(cookieFile, getter_AddRefs(mDBConn));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
PRBool tableExists = PR_FALSE;
|
||||
mDBConn->TableExists(NS_LITERAL_CSTRING("moz_cookies"), &tableExists);
|
||||
if (!tableExists) {
|
||||
|
|
|
@ -79,6 +79,38 @@ struct nsMyTrustedEVInfo
|
|||
};
|
||||
|
||||
static struct nsMyTrustedEVInfo myTrustedEVInfos[] = {
|
||||
{
|
||||
"2.16.840.1.114413.1.7.23.3",
|
||||
"Go Daddy EV OID a",
|
||||
SEC_OID_UNKNOWN,
|
||||
"OU=Go Daddy Class 2 Certification Authority,O=\"The Go Daddy Group, Inc.\",C=US",
|
||||
"OU=Go Daddy Class 2 Certification Authority,O=\"The Go Daddy Group, Inc.\",C=US",
|
||||
"27:96:BA:E6:3F:18:01:E2:77:26:1B:A0:D7:77:70:02:8F:20:EE:E4",
|
||||
},
|
||||
{
|
||||
"2.16.840.1.114413.1.7.23.3",
|
||||
"Go Daddy EV OID a",
|
||||
SEC_OID_UNKNOWN,
|
||||
"E=info@valicert.com,CN=http://www.valicert.com/,OU=ValiCert Class 2 Policy Validation Authority,O=\"ValiCert, Inc.\",L=ValiCert Validation Network",
|
||||
"E=info@valicert.com,CN=http://www.valicert.com/,OU=ValiCert Class 2 Policy Validation Authority,O=\"ValiCert, Inc.\",L=ValiCert Validation Network",
|
||||
"31:7A:2A:D0:7F:2B:33:5E:F5:A1:C3:4E:4B:57:E8:B7:D8:F1:FC:A6",
|
||||
},
|
||||
{
|
||||
"2.16.840.1.114414.1.7.23.3",
|
||||
"Go Daddy EV OID b",
|
||||
SEC_OID_UNKNOWN,
|
||||
"E=info@valicert.com,CN=http://www.valicert.com/,OU=ValiCert Class 2 Policy Validation Authority,O=\"ValiCert, Inc.\",L=ValiCert Validation Network",
|
||||
"E=info@valicert.com,CN=http://www.valicert.com/,OU=ValiCert Class 2 Policy Validation Authority,O=\"ValiCert, Inc.\",L=ValiCert Validation Network",
|
||||
"31:7A:2A:D0:7F:2B:33:5E:F5:A1:C3:4E:4B:57:E8:B7:D8:F1:FC:A6",
|
||||
},
|
||||
{
|
||||
"2.16.840.1.114414.1.7.23.3",
|
||||
"Go Daddy EV OID b",
|
||||
SEC_OID_UNKNOWN,
|
||||
"OU=Starfield Class 2 Certification Authority,O=\"Starfield Technologies, Inc.\",C=US",
|
||||
"OU=Starfield Class 2 Certification Authority,O=\"Starfield Technologies, Inc.\",C=US",
|
||||
"AD:7E:1C:28:B0:64:EF:8F:60:03:40:20:14:C3:D0:E3:37:0E:B5:8A",
|
||||
},
|
||||
{
|
||||
"2.16.840.1.114412.2.1",
|
||||
"DigiCert EV OID",
|
||||
|
@ -626,6 +658,9 @@ nsNSSCertificate::hasValidEVOidTag(SECOidTag &resultOidTag, PRBool &validEV)
|
|||
CERTCertificate *issuerCert = cvout[0].value.pointer.cert;
|
||||
CERTCertificateCleaner issuerCleaner(issuerCert);
|
||||
|
||||
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CERT_PKIXVerifyCert returned success, issuer: %s\n",
|
||||
issuerCert->subjectName));
|
||||
|
||||
validEV = isApprovedForEV(oid_tag, issuerCert);
|
||||
if (validEV)
|
||||
resultOidTag = oid_tag;
|
||||
|
|
|
@ -43,6 +43,9 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
# FIXME: bug 419893
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
||||
MODULE = storage
|
||||
LIBRARY_NAME = storage_s
|
||||
MODULE_NAME = mozStorageModule
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
if (Cc === undefined) {
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
}
|
||||
window.addEventListener("load", testOnLoad, false);
|
||||
|
||||
function testOnLoad() {
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
// Make sure to launch the test harness for the first opened window only
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
|
|
|
@ -95,6 +95,12 @@ use constant A11Y_PATH => "/redirect-a11y.html";
|
|||
use constant TESTS_URL => "http://" . TEST_SERVER_HOST . TEST_PATH;
|
||||
use constant CHROMETESTS_URL => "http://" . TEST_SERVER_HOST . CHROME_PATH;
|
||||
use constant A11YTESTS_URL => "http://" . TEST_SERVER_HOST . A11Y_PATH;
|
||||
# main browser chrome URL, same as browser.chromeURL pref
|
||||
#ifdef MOZ_SUITE
|
||||
use constant BROWSER_CHROME_URL => "chrome://navigator/content/navigator.xul";
|
||||
#else
|
||||
use constant BROWSER_CHROME_URL => "chrome://browser/content/browser.xul";
|
||||
#endif
|
||||
|
||||
# Max time in seconds to wait for server startup before tests will fail -- if
|
||||
# this seems big, it's mostly for debug machines where cold startup
|
||||
|
@ -523,7 +529,7 @@ CHROMEEND
|
|||
die("Could not open manifest file $!");
|
||||
print MANIFEST ("content mochikit $chrometest_dir\n");
|
||||
if ($do_browser_tests) {
|
||||
print MANIFEST ("overlay chrome://browser/content/browser.xul chrome://mochikit/content/browser-test-overlay.xul\n");
|
||||
print MANIFEST ("overlay " . BROWSER_CHROME_URL . " chrome://mochikit/content/browser-test-overlay.xul\n");
|
||||
}
|
||||
close(MANIFEST);
|
||||
|
||||
|
|
|
@ -63,6 +63,12 @@ TESTS_URL = "http://" + TEST_SERVER_HOST + TEST_PATH
|
|||
CHROMETESTS_URL = "http://" + TEST_SERVER_HOST + CHROME_PATH
|
||||
A11YTESTS_URL = "http://" + TEST_SERVER_HOST + A11Y_PATH
|
||||
SERVER_SHUTDOWN_URL = "http://" + TEST_SERVER_HOST + "/server/shutdown"
|
||||
# main browser chrome URL, same as browser.chromeURL pref
|
||||
#ifdef MOZ_SUITE
|
||||
BROWSER_CHROME_URL = "chrome://navigator/content/navigator.xul"
|
||||
#else
|
||||
BROWSER_CHROME_URL = "chrome://browser/content/browser.xul"
|
||||
#endif
|
||||
|
||||
# Max time in seconds to wait for server startup before tests will fail -- if
|
||||
# this seems big, it's mostly for debug machines where cold startup
|
||||
|
@ -423,7 +429,7 @@ toolbar#nav-bar {
|
|||
manifestFile = open(manifest, "w")
|
||||
manifestFile.write("content mochikit " + chrometestDir + "\n")
|
||||
if options.browserChrome:
|
||||
overlayLine = "overlay chrome://browser/content/browser.xul " \
|
||||
overlayLine = "overlay " + BROWSER_CHROME_URL + " " \
|
||||
"chrome://mochikit/content/browser-test-overlay.xul\n"
|
||||
manifestFile.write(overlayLine)
|
||||
manifestFile.close()
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
Components.utils.import("resource://gre/modules/ISO8601DateUtils.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"];
|
||||
|
||||
var Microformats = {
|
||||
|
@ -864,6 +862,65 @@ var Microformats = {
|
|||
return dateString;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Converts an ISO8601 date into a JavaScript date object, honoring the TZ
|
||||
* offset and Z if present to convert the date to local time
|
||||
* NOTE: I'm using an extra parameter on the date object for this function.
|
||||
* I set date.time to true if there is a date, otherwise date.time is false.
|
||||
*
|
||||
* @param string ISO8601 formatted date
|
||||
* @return JavaScript date object that represents the ISO date.
|
||||
*/
|
||||
dateFromISO8601: function dateFromISO8601(string) {
|
||||
var dateArray = string.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(?:([-+Z])(?:(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
|
||||
|
||||
var date = new Date(dateArray[1], 0, 1);
|
||||
date.time = false;
|
||||
|
||||
if (dateArray[2]) {
|
||||
date.setMonth(dateArray[2] - 1);
|
||||
}
|
||||
if (dateArray[3]) {
|
||||
date.setDate(dateArray[3]);
|
||||
}
|
||||
if (dateArray[4]) {
|
||||
date.setHours(dateArray[4]);
|
||||
date.time = true;
|
||||
if (dateArray[5]) {
|
||||
date.setMinutes(dateArray[5]);
|
||||
if (dateArray[6]) {
|
||||
date.setSeconds(dateArray[6]);
|
||||
if (dateArray[7]) {
|
||||
date.setMilliseconds(Number("0." + dateArray[7]) * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dateArray[8]) {
|
||||
if (dateArray[8] == "-") {
|
||||
if (dateArray[9] && dateArray[10]) {
|
||||
date.setHours(date.getHours() + parseInt(dateArray[9], 10));
|
||||
date.setMinutes(date.getMinutes() + parseInt(dateArray[10], 10));
|
||||
}
|
||||
} else if (dateArray[8] == "+") {
|
||||
if (dateArray[9] && dateArray[10]) {
|
||||
date.setHours(date.getHours() - parseInt(dateArray[9], 10));
|
||||
date.setMinutes(date.getMinutes() - parseInt(dateArray[10], 10));
|
||||
}
|
||||
}
|
||||
/* at this point we have the time in gmt */
|
||||
/* convert to local if we had a Z - or + */
|
||||
if (dateArray[8]) {
|
||||
var tzOffset = date.getTimezoneOffset();
|
||||
if (tzOffset < 0) {
|
||||
date.setMinutes(date.getMinutes() + tzOffset);
|
||||
} else if (tzOffset > 0) {
|
||||
date.setMinutes(date.getMinutes() - tzOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
return date;
|
||||
},
|
||||
/**
|
||||
* Converts a Javascript date object into an ISO 8601 formatted date
|
||||
* NOTE: I'm using an extra parameter on the date object for this function.
|
||||
|
@ -1323,7 +1380,7 @@ hCalendar.prototype.toString = function() {
|
|||
if (summaries.length === 0) {
|
||||
if (this.summary) {
|
||||
if (this.dtstart) {
|
||||
return this.summary + " (" + ISO8601DateUtils.parse(this.dtstart).toLocaleString() + ")";
|
||||
return this.summary + " (" + Microformats.dateFromISO8601(this.dtstart).toLocaleString() + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,11 @@
|
|||
<span class="title">CEO</span>
|
||||
</div>
|
||||
|
||||
<div class="vevent" id="date_vcal">
|
||||
<span class="description">Mozilla's Birthday</span>
|
||||
<span class="dtstart">1998-01-22</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
@ -91,7 +96,7 @@ function test_Microformats() {
|
|||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
Components.utils.import("resource://gre/modules/Microformats.js");
|
||||
|
||||
|
||||
ok(Microformats, "Check global access to Microformats");
|
||||
var hCards = Microformats.get("hCard", document.getElementById("test_1"), {showHidden: true});
|
||||
is(hCards.length, 1, "Check Microformats.get");
|
||||
|
@ -141,7 +146,12 @@ function test_Microformats() {
|
|||
is(nestCard2.title, "Executive Assistant", "nesting (title) 2");
|
||||
is(nestCard3.fn, "Bob Smith", "nesting (fn) 3");
|
||||
is(nestCard3.title, "Office Assistant", "nesting (title) 3");
|
||||
is(nestCard1.agent[0].agent[0].fn, "Bob Smith", "nesting all");
|
||||
is(nestCard1.agent[0].agent[0].fn, "Bob Smith", "nesting all");
|
||||
|
||||
var dateCal = new hCalendar(document.getElementById("date_vcal"));
|
||||
jsdate = Microformats.dateFromISO8601(dateCal.dtstart);
|
||||
origdate = Microformats.iso8601FromDate(jsdate, true);
|
||||
is(dateCal.dtstart, origdate, "date round trip");
|
||||
}
|
||||
|
||||
function test_hCard() {
|
||||
|
|
|
@ -852,6 +852,7 @@ LoginManagerPrompter.prototype = {
|
|||
|
||||
}; // end of LoginManagerPrompter implementation
|
||||
|
||||
|
||||
var component = [LoginManagerPromptFactory, LoginManagerPrompter];
|
||||
function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(component);
|
||||
|
|
|
@ -43,6 +43,9 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
# FIXME: bug 419893
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
||||
MODULE = places
|
||||
LIBRARY_NAME = places
|
||||
LIBXUL_LIBRARY = 1
|
||||
|
|
|
@ -294,6 +294,12 @@ static const char* gAutoCompleteFeedback = "autocomplete-will-enter-text";
|
|||
// annotation names
|
||||
const char nsNavHistory::kAnnotationPreviousEncoding[] = "history/encoding";
|
||||
|
||||
// code borrowed from mozilla/xpfe/components/history/src/nsGlobalHistory.cpp
|
||||
// pass in a pre-normalized now and a date, and we'll find
|
||||
// the difference since midnight on each of the days.
|
||||
//
|
||||
// USECS_PER_DAY == PR_USEC_PER_SEC * 60 * 60 * 24;
|
||||
static const PRInt64 USECS_PER_DAY = LL_INIT(20, 500654080);
|
||||
|
||||
nsNavHistory *nsNavHistory::gHistoryService = nsnull;
|
||||
|
||||
|
@ -2792,6 +2798,7 @@ private:
|
|||
|
||||
nsCString mQueryString;
|
||||
nsCString mGroupBy;
|
||||
PRBool mHasDateColumns;
|
||||
PRBool mSkipOrderBy;
|
||||
};
|
||||
|
||||
|
@ -2808,6 +2815,7 @@ PlacesSQLQueryBuilder::PlacesSQLQueryBuilder(
|
|||
mUseLimit(aUseLimit),
|
||||
mSkipOrderBy(PR_FALSE)
|
||||
{
|
||||
mHasDateColumns = (mQueryType == nsINavHistoryQueryOptions::QUERY_TYPE_BOOKMARKS);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -2944,11 +2952,21 @@ PlacesSQLQueryBuilder::SelectAsDay()
|
|||
nsNavHistory* history = nsNavHistory::GetHistoryService();
|
||||
NS_ENSURE_STATE(history);
|
||||
|
||||
nsCAutoString dateName;
|
||||
struct Midnight
|
||||
{
|
||||
Midnight() {
|
||||
mNow = NormalizeTimeRelativeToday(PR_Now());
|
||||
}
|
||||
PRTime Get(PRInt32 aDayOffset) {
|
||||
PRTime result;
|
||||
LL_MUL(result, aDayOffset, USECS_PER_DAY);
|
||||
LL_ADD(result, result, mNow);
|
||||
return result;
|
||||
}
|
||||
PRTime mNow;
|
||||
} midnight;
|
||||
|
||||
#define SQL_STR_FRAGMENT_DATE(sign) \
|
||||
" CAST(strftime('%%s',CURRENT_DATE, 'LOCALTIME', '%d days') AS UNSIGNED)" \
|
||||
"*1000000 "
|
||||
nsCAutoString dateName;
|
||||
|
||||
const PRInt32 MAX_DAYS = 6;
|
||||
|
||||
|
@ -2977,14 +2995,18 @@ PlacesSQLQueryBuilder::SelectAsDay()
|
|||
"FROM (SELECT %d dayOrder, "
|
||||
"'%d' dayRange, "
|
||||
"'%s' dayTitle, "
|
||||
SQL_STR_FRAGMENT_DATE() " beginTime, "
|
||||
SQL_STR_FRAGMENT_DATE() " endTime "
|
||||
"%llu beginTime, "
|
||||
"%llu endTime "
|
||||
"FROM moz_historyvisits "
|
||||
"WHERE visit_date >= " SQL_STR_FRAGMENT_DATE()
|
||||
" AND visit_date < " SQL_STR_FRAGMENT_DATE()
|
||||
"WHERE visit_date >= %llu AND visit_date < %llu "
|
||||
" AND visit_type NOT IN (0,4) "
|
||||
"LIMIT 1) TUNION%d UNION ", i, i, dateName.get(), fromDayAgo,
|
||||
toDayAgo, fromDayAgo, toDayAgo, i);
|
||||
"LIMIT 1) TUNION%d UNION ",
|
||||
i, i, dateName.get(),
|
||||
midnight.Get(fromDayAgo),
|
||||
midnight.Get(toDayAgo),
|
||||
midnight.Get(fromDayAgo),
|
||||
midnight.Get(toDayAgo),
|
||||
i);
|
||||
|
||||
mQueryString.Append( dayRange );
|
||||
}
|
||||
|
@ -2998,9 +3020,9 @@ PlacesSQLQueryBuilder::SelectAsDay()
|
|||
"'%d+' dayRange, "
|
||||
"'%s' dayTitle, "
|
||||
"1 beginTime, "
|
||||
SQL_STR_FRAGMENT_DATE() " endTime "
|
||||
"%llu endTime "
|
||||
"FROM moz_historyvisits "
|
||||
"WHERE visit_date < " SQL_STR_FRAGMENT_DATE()
|
||||
"WHERE visit_date < %llu "
|
||||
" AND visit_type NOT IN (0,4) "
|
||||
"LIMIT 1) TUNIONLAST "
|
||||
") TOUTER " // TOUTER END
|
||||
|
@ -3008,12 +3030,10 @@ PlacesSQLQueryBuilder::SelectAsDay()
|
|||
MAX_DAYS+1,
|
||||
MAX_DAYS+1,
|
||||
dateName.get(),
|
||||
-MAX_DAYS,
|
||||
-MAX_DAYS
|
||||
midnight.Get(-MAX_DAYS),
|
||||
midnight.Get(-MAX_DAYS)
|
||||
));
|
||||
|
||||
#undef SQL_STR_FRAGMENT_DATE
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -3099,9 +3119,13 @@ PlacesSQLQueryBuilder::SelectAsTag()
|
|||
nsNavHistory* history = nsNavHistory::GetHistoryService();
|
||||
NS_ENSURE_STATE(history);
|
||||
|
||||
// This allows sorting by date fields what is not possible with
|
||||
// other history queries.
|
||||
mHasDateColumns = PR_TRUE;
|
||||
|
||||
mQueryString = nsPrintfCString(2048,
|
||||
"SELECT null, 'place:type=%ld&queryType=%d&sort=%ld&folder=' || id, "
|
||||
"title, title, null, null, null, null, null "
|
||||
"title, null, null, null, null, null, null, dateAdded, lastModified "
|
||||
"FROM moz_bookmarks "
|
||||
"WHERE parent = %ld",
|
||||
nsINavHistoryQueryOptions::RESULTS_AS_URI,
|
||||
|
@ -3189,19 +3213,19 @@ PlacesSQLQueryBuilder::OrderBy()
|
|||
OrderByColumnIndexDesc(nsNavHistory::kGetInfoIndex_VisitCount);
|
||||
break;
|
||||
case nsINavHistoryQueryOptions::SORT_BY_DATEADDED_ASCENDING:
|
||||
if (mQueryType == nsINavHistoryQueryOptions::QUERY_TYPE_BOOKMARKS)
|
||||
if (mHasDateColumns)
|
||||
OrderByColumnIndexAsc(nsNavHistory::kGetInfoIndex_ItemDateAdded);
|
||||
break;
|
||||
case nsINavHistoryQueryOptions::SORT_BY_DATEADDED_DESCENDING:
|
||||
if (mQueryType == nsINavHistoryQueryOptions::QUERY_TYPE_BOOKMARKS)
|
||||
if (mHasDateColumns)
|
||||
OrderByColumnIndexDesc(nsNavHistory::kGetInfoIndex_ItemDateAdded);
|
||||
break;
|
||||
case nsINavHistoryQueryOptions::SORT_BY_LASTMODIFIED_ASCENDING:
|
||||
if (mQueryType == nsINavHistoryQueryOptions::QUERY_TYPE_BOOKMARKS)
|
||||
if (mHasDateColumns)
|
||||
OrderByColumnIndexAsc(nsNavHistory::kGetInfoIndex_ItemLastModified);
|
||||
break;
|
||||
case nsINavHistoryQueryOptions::SORT_BY_LASTMODIFIED_DESCENDING:
|
||||
if (mQueryType == nsINavHistoryQueryOptions::QUERY_TYPE_BOOKMARKS)
|
||||
if (mHasDateColumns)
|
||||
OrderByColumnIndexDesc(nsNavHistory::kGetInfoIndex_ItemLastModified);
|
||||
break;
|
||||
default:
|
||||
|
@ -4384,7 +4408,7 @@ nsNavHistory::OnIdle()
|
|||
PRBool hasResult;
|
||||
rv = detectBogusIndex->ExecuteStep(&hasResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = detectBogusIndex->Reset();
|
||||
rv = detectBogusIndex->Reset();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (hasResult) {
|
||||
// drop old index
|
||||
|
@ -4888,12 +4912,6 @@ nsNavHistory::ResultsAsList(mozIStorageStatement* statement,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// code borrowed from mozilla/xpfe/components/history/src/nsGlobalHistory.cpp
|
||||
// pass in a pre-normalized now and a date, and we'll find
|
||||
// the difference since midnight on each of the days.
|
||||
//
|
||||
// USECS_PER_DAY == PR_USEC_PER_SEC * 60 * 60 * 24;
|
||||
static const PRInt64 USECS_PER_DAY = LL_INIT(20, 500654080);
|
||||
static PRInt64
|
||||
GetAgeInDays(PRTime aNormalizedNow, PRTime aDate)
|
||||
{
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Brett Wilson <brettw@gmail.com> (original author)
|
||||
* Edward Lee <edward.lee@engineering.uiuc.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
|
||||
|
@ -649,6 +650,7 @@ protected:
|
|||
static const PRInt32 kAutoCompleteIndex_BookmarkTitle;
|
||||
static const PRInt32 kAutoCompleteIndex_Tags;
|
||||
nsCOMPtr<mozIStorageStatement> mDBAutoCompleteQuery; // kAutoCompleteIndex_* results
|
||||
nsCOMPtr<mozIStorageStatement> mDBAdaptiveQuery; // kAutoCompleteIndex_* results
|
||||
nsCOMPtr<mozIStorageStatement> mDBFeedbackIncrease;
|
||||
|
||||
nsresult InitAutoComplete();
|
||||
|
@ -681,12 +683,14 @@ protected:
|
|||
nsDataHashtable<nsStringHashKey, PRBool> mLivemarkFeedURIs;
|
||||
|
||||
nsresult AutoCompleteFullHistorySearch(PRBool* aHasMoreResults);
|
||||
nsresult AutoCompleteAdaptiveSearch();
|
||||
|
||||
/**
|
||||
* Query type passed to AutoCompleteProcessSearch to determine what style to
|
||||
* use and if results should be filtered
|
||||
*/
|
||||
enum QueryType {
|
||||
QUERY_ADAPTIVE,
|
||||
QUERY_FULL
|
||||
};
|
||||
nsresult AutoCompleteProcessSearch(mozIStorageStatement* aQuery,
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
* Blake Ross <blaker@netscape.com>
|
||||
* Seth Spitzer <sspitzer@mozilla.org>
|
||||
* Dietrich Ayala <dietrich@mozilla.com>
|
||||
* Edward Lee <edward.lee@engineering.uiuc.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
|
||||
|
@ -149,6 +150,18 @@ nsNavHistory::CreateAutoCompleteQueries()
|
|||
getter_AddRefs(mDBAutoCompleteQuery));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
sql = NS_LITERAL_CSTRING(
|
||||
"SELECT h.url, h.title, f.url, ") + bookTag + NS_LITERAL_CSTRING(
|
||||
"ROUND(MAX(((i.input = ?2) + (SUBSTR(i.input, 1, LENGTH(?2)) = ?2)) * "
|
||||
"i.use_count), 1) rank "
|
||||
"FROM moz_inputhistory i "
|
||||
"JOIN moz_places h ON h.id = i.place_id "
|
||||
"LEFT OUTER JOIN moz_favicons f ON f.id = h.favicon_id "
|
||||
"GROUP BY i.place_id HAVING rank > 0 "
|
||||
"ORDER BY rank DESC, h.frecency DESC");
|
||||
rv = mDBConn->CreateStatement(sql, getter_AddRefs(mDBAdaptiveQuery));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
sql = NS_LITERAL_CSTRING(
|
||||
// Leverage the PRIMARY KEY (place_id, input) to insert/update entries
|
||||
"INSERT OR REPLACE INTO moz_inputhistory "
|
||||
|
@ -203,6 +216,9 @@ nsNavHistory::PerformAutoComplete()
|
|||
nsresult rv;
|
||||
// Only do some extra searches on the first chunk
|
||||
if (!mCurrentChunkOffset) {
|
||||
// Get adaptive results first
|
||||
rv = AutoCompleteAdaptiveSearch();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
PRBool moreChunksToSearch = PR_FALSE;
|
||||
|
@ -362,6 +378,23 @@ nsNavHistory::AddSearchToken(nsAutoString &aToken)
|
|||
mCurrentSearchTokens.AppendString(aToken);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsNavHistory::AutoCompleteAdaptiveSearch()
|
||||
{
|
||||
mozStorageStatementScoper scope(mDBAdaptiveQuery);
|
||||
|
||||
nsresult rv = mDBAdaptiveQuery->BindInt32Parameter(0, GetTagsFolder());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mDBAdaptiveQuery->BindStringParameter(1, mCurrentSearchString);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = AutoCompleteProcessSearch(mDBAdaptiveQuery, QUERY_ADAPTIVE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsNavHistory::AutoCompleteFullHistorySearch
|
||||
//
|
||||
// Search for places that have a title, url,
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,271 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Bug 378079 unit test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is POTI Inc.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2007
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Matt Crocker <matt@songbirdnest.com>
|
||||
* Seth Spitzer <sspitzer@mozilla.org>
|
||||
* Edward Lee <edward.lee@engineering.uiuc.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
|
||||
* 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 ***** */
|
||||
|
||||
/**
|
||||
* Test for bug 395739 to make sure the feedback to the search results in those
|
||||
* entries getting better ranks. Additionally, exact matches should be ranked
|
||||
* higher. Because the interactions among adaptive rank and visit counts is not
|
||||
* well defined, this test holds one of the two values constant when modifying
|
||||
* the other.
|
||||
*
|
||||
* This also tests bug 395735 for the instrumentation feedback mechanism.
|
||||
*
|
||||
* Bug 411293 is tested to make sure the drop down strongly prefers previously
|
||||
* typed pages that have been selected and are moved to the top with adaptive
|
||||
* learning.
|
||||
*/
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
let current_test = 0;
|
||||
|
||||
function AutoCompleteInput(aSearches) {
|
||||
this.searches = aSearches;
|
||||
}
|
||||
AutoCompleteInput.prototype = {
|
||||
constructor: AutoCompleteInput,
|
||||
|
||||
searches: null,
|
||||
|
||||
minResultsForPopup: 0,
|
||||
timeout: 10,
|
||||
searchParam: "",
|
||||
textValue: "",
|
||||
disableAutoComplete: false,
|
||||
completeDefaultIndex: false,
|
||||
|
||||
get searchCount() {
|
||||
return this.searches.length;
|
||||
},
|
||||
|
||||
getSearchAt: function(aIndex) {
|
||||
return this.searches[aIndex];
|
||||
},
|
||||
|
||||
onSearchComplete: function() {},
|
||||
|
||||
popupOpen: false,
|
||||
|
||||
popup: {
|
||||
setSelectedIndex: function(aIndex) {},
|
||||
invalidate: function() {},
|
||||
|
||||
// nsISupports implementation
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Ci.nsISupports) ||
|
||||
iid.equals(Ci.nsIAutoCompletePopup))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
},
|
||||
|
||||
// nsISupports implementation
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Ci.nsISupports) ||
|
||||
iid.equals(Ci.nsIAutoCompleteInput))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
function ensure_results(uris, searchTerm)
|
||||
{
|
||||
let controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
|
||||
getService(Components.interfaces.nsIAutoCompleteController);
|
||||
|
||||
// Make an AutoCompleteInput that uses our searches
|
||||
// and confirms results on search complete
|
||||
let input = new AutoCompleteInput(["history"]);
|
||||
|
||||
controller.input = input;
|
||||
|
||||
// Search is asynchronous, so don't let the test finish immediately
|
||||
do_test_pending();
|
||||
|
||||
input.onSearchComplete = function() {
|
||||
do_check_eq(controller.searchStatus,
|
||||
Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
|
||||
do_check_eq(controller.matchCount, uris.length);
|
||||
for (let i = 0; i < controller.matchCount; i++) {
|
||||
do_check_eq(controller.getValueAt(i), uris[i].spec);
|
||||
}
|
||||
|
||||
if (current_test < (tests.length - 1)) {
|
||||
current_test++;
|
||||
tests[current_test]();
|
||||
}
|
||||
|
||||
do_test_finished();
|
||||
};
|
||||
|
||||
controller.startSearch(searchTerm);
|
||||
}
|
||||
|
||||
// Get history service
|
||||
try {
|
||||
var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService);
|
||||
var bhist = histsvc.QueryInterface(Ci.nsIBrowserHistory);
|
||||
var obs = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
} catch(ex) {
|
||||
do_throw("Could not get history service\n");
|
||||
}
|
||||
|
||||
function setCountRank(aURI, aCount, aRank, aSearch)
|
||||
{
|
||||
// Set the visit count and date for a uri
|
||||
histsvc.setPageDetails(aURI, aURI, aCount, false, true);
|
||||
|
||||
// Bump up the visit count for the uri
|
||||
for (let i = 0; i < aCount; i++)
|
||||
histsvc.addVisit(aURI, d1, null, histsvc.TRANSITION_TYPED, false, 0);
|
||||
|
||||
// Make a nsIAutoCompleteController and friends for instrumentation feedback
|
||||
let thing = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput,
|
||||
Ci.nsIAutoCompletePopup,
|
||||
Ci.nsIAutoCompleteController]),
|
||||
get popup() { return thing; },
|
||||
get controller() { return thing; },
|
||||
popupOpen: true,
|
||||
selectedIndex: 0,
|
||||
getValueAt: function() aURI.spec,
|
||||
searchString: aSearch
|
||||
};
|
||||
|
||||
// Bump up the instrumentation feedback
|
||||
for (let i = 0; i < aRank; i++)
|
||||
obs.notifyObservers(thing, "autocomplete-will-enter-text", null);
|
||||
}
|
||||
|
||||
let uri1 = uri("http://site.tld/1");
|
||||
let uri2 = uri("http://site.tld/2");
|
||||
|
||||
// d1 is some date for the page visit
|
||||
let d1 = new Date(Date.now() - 1000 * 60 * 60) * 1000;
|
||||
// c1 is larger (should show up higher) than c2
|
||||
let c1 = 10;
|
||||
let c2 = 1;
|
||||
// s1 is a partial match of s2
|
||||
let s0 = "";
|
||||
let s1 = "si";
|
||||
let s2 = "site";
|
||||
|
||||
function prepTest(name) {
|
||||
print("Test " + name);
|
||||
bhist.removeAllPages();
|
||||
}
|
||||
|
||||
let tests = [
|
||||
// Test things without a search term
|
||||
function() {
|
||||
prepTest("0 same count, diff rank, same term; no search");
|
||||
setCountRank(uri1, c1, c1, s2);
|
||||
setCountRank(uri2, c1, c2, s2);
|
||||
ensure_results([uri1, uri2], s0);
|
||||
},
|
||||
function() {
|
||||
prepTest("1 same count, diff rank, same term; no search");
|
||||
setCountRank(uri1, c1, c2, s2);
|
||||
setCountRank(uri2, c1, c1, s2);
|
||||
ensure_results([uri2, uri1], s0);
|
||||
},
|
||||
function() {
|
||||
prepTest("2 diff count, same rank, same term; no search");
|
||||
setCountRank(uri1, c1, c1, s2);
|
||||
setCountRank(uri2, c2, c1, s2);
|
||||
ensure_results([uri1, uri2], s0);
|
||||
},
|
||||
function() {
|
||||
prepTest("3 diff count, same rank, same term; no search");
|
||||
setCountRank(uri1, c2, c1, s2);
|
||||
setCountRank(uri2, c1, c1, s2);
|
||||
ensure_results([uri2, uri1], s0);
|
||||
},
|
||||
|
||||
// Test things with a search term (exact match one, partial other)
|
||||
function() {
|
||||
prepTest("4 same count, same rank, diff term; one exact/one partial search");
|
||||
setCountRank(uri1, c1, c1, s1);
|
||||
setCountRank(uri2, c1, c1, s2);
|
||||
ensure_results([uri1, uri2], s1);
|
||||
},
|
||||
function() {
|
||||
prepTest("5 same count, same rank, diff term; one exact/one partial search");
|
||||
setCountRank(uri1, c1, c1, s2);
|
||||
setCountRank(uri2, c1, c1, s1);
|
||||
ensure_results([uri2, uri1], s1);
|
||||
},
|
||||
|
||||
// Test things with a search term (exact match both)
|
||||
function() {
|
||||
prepTest("6 same count, diff rank, same term; both exact search");
|
||||
setCountRank(uri1, c1, c1, s1);
|
||||
setCountRank(uri2, c1, c2, s1);
|
||||
ensure_results([uri1, uri2], s1);
|
||||
},
|
||||
function() {
|
||||
prepTest("7 same count, diff rank, same term; both exact search");
|
||||
setCountRank(uri1, c1, c2, s1);
|
||||
setCountRank(uri2, c1, c1, s1);
|
||||
ensure_results([uri2, uri1], s1);
|
||||
},
|
||||
|
||||
// Test things with a search term (partial match both)
|
||||
function() {
|
||||
prepTest("8 same count, diff rank, same term; both partial search");
|
||||
setCountRank(uri1, c1, c1, s2);
|
||||
setCountRank(uri2, c1, c2, s2);
|
||||
ensure_results([uri1, uri2], s1);
|
||||
},
|
||||
function() {
|
||||
prepTest("9 same count, diff rank, same term; both partial search");
|
||||
setCountRank(uri1, c1, c2, s2);
|
||||
setCountRank(uri2, c1, c1, s2);
|
||||
ensure_results([uri2, uri1], s1);
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Test history autocomplete
|
||||
*/
|
||||
function run_test() {
|
||||
tests[0]();
|
||||
}
|
|
@ -2,4 +2,4 @@
|
|||
slum it, struggle against terrible odds, win through, and still knows
|
||||
where his towel is is clearly a man to be reckoned with."
|
||||
|
||||
- Douglas Adams
|
||||
- Douglas Adams
|
||||
|
|
|
@ -575,10 +575,12 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, PRBool aIsLinksOnly,
|
|||
// ATTENTION, or when we MoveFocusToCaret() and the selection is not on a
|
||||
// link, we'll blur, which will lose the ATTENTION.
|
||||
if (selectionController) {
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
SetSelectionModeAndRepaint(nsISelectionController::SELECTION_ATTENTION);
|
||||
selectionController->ScrollSelectionIntoView(
|
||||
nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
}
|
||||
|
||||
mCurrentWindow = window;
|
||||
|
@ -901,6 +903,8 @@ nsTypeAheadFind::FindAgain(PRBool aFindBackwards, PRBool aLinksOnly,
|
|||
|
||||
mLinksOnly = aLinksOnly;
|
||||
if (!mTypeAheadBuffer.IsEmpty())
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
FindItNow(nsnull, mLinksOnly, PR_FALSE, aFindBackwards, aResult);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1024,6 +1028,8 @@ nsTypeAheadFind::Find(const nsAString& aSearchString, PRBool aLinksOnly,
|
|||
}
|
||||
|
||||
// ----------- Find the text! ---------------------
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
nsresult rv = FindItNow(nsnull, mLinksOnly, isFirstVisiblePreferred,
|
||||
PR_FALSE, aResult);
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ static const PRLogModuleInfo *gUrlClassifierDbServiceLog = nsnull;
|
|||
// want to change schema, or to recover from updating bugs. When an
|
||||
// implementation version change is detected, the database is scrapped
|
||||
// and we start over.
|
||||
#define IMPLEMENTATION_VERSION 2
|
||||
#define IMPLEMENTATION_VERSION 3
|
||||
|
||||
#define MAX_HOST_COMPONENTS 5
|
||||
#define MAX_PATH_COMPONENTS 4
|
||||
|
|
|
@ -280,17 +280,20 @@ sub BumpVerifyConfig {
|
|||
my @origFile = <FILE>;
|
||||
close(FILE) or die ("Could not close file $configFile: $!");
|
||||
|
||||
my @strippedFile = ();
|
||||
if ($origFile[0] =~ $oldVersion) {
|
||||
$this->Log('msg' => "verifyConfig $configFile already bumped");
|
||||
return;
|
||||
}
|
||||
|
||||
# remove "from" and "to" vars from @origFile
|
||||
my @strippedFile = ();
|
||||
for(my $i=0; $i < scalar(@origFile); $i++) {
|
||||
my $line = $origFile[$i];
|
||||
$line =~ s/from.*$//;
|
||||
$strippedFile[$i] = $line;
|
||||
$this->Log('msg' => "removing previous config..");
|
||||
# remove top two lines; the comment and the version config
|
||||
splice(@origFile, 0, 2);
|
||||
@strippedFile = @origFile;
|
||||
} else {
|
||||
# remove "from" and "to" vars from @origFile
|
||||
for(my $i=0; $i < scalar(@origFile); $i++) {
|
||||
my $line = $origFile[$i];
|
||||
$line =~ s/from.*$//;
|
||||
$strippedFile[$i] = $line;
|
||||
}
|
||||
}
|
||||
|
||||
my $localeFileTag = uc($product).'_'.$oldVersion.'_RELEASE';
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
#include "nsToolkit.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsplugindefs.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
|
@ -3340,6 +3342,18 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
|
|||
if (!mGeckoChild)
|
||||
return nil;
|
||||
|
||||
// If we're running in a browser that (unlike Camino) uses non-native
|
||||
// context menus, we must call maybeInitContextMenuTracking. This call was
|
||||
// dropped with the patch for bug 396186, which caused at least one
|
||||
// regression (bug 416455).
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (prefs) {
|
||||
PRBool useNativeContextMenus;
|
||||
nsresult rv = prefs->GetBoolPref("ui.use_native_popup_windows", &useNativeContextMenus);
|
||||
if (!NS_SUCCEEDED(rv) || !useNativeContextMenus)
|
||||
[self maybeInitContextMenuTracking];
|
||||
}
|
||||
|
||||
// Go up our view chain to fetch the correct menu to return.
|
||||
return [self contextMenu];
|
||||
|
||||
|
|
|
@ -65,9 +65,13 @@ close(OUTFILE);
|
|||
|
||||
die "Can't open $def_name" if !open(OUTFILE, ">$def_name");
|
||||
|
||||
## Disabled for bug 275004 - followup to fix is Bug 419604
|
||||
my $warn_inc_is_generated = 0;
|
||||
if ($warn_inc_is_generated) {
|
||||
print OUTFILE "/* generated file - DO NOT EDIT */\n\n";
|
||||
print OUTFILE "/* includes ",$entry_count," stub entries, and ",
|
||||
$sentinel_count," sentinel entries */\n\n";
|
||||
}
|
||||
|
||||
for($i = 0; $i < $entry_count; $i++) {
|
||||
print OUTFILE "STUB_ENTRY(",$i+3,")\n";
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
/* generated file - DO NOT EDIT */
|
||||
|
||||
/* includes 247 stub entries, and 5 sentinel entries */
|
||||
|
||||
STUB_ENTRY(3)
|
||||
STUB_ENTRY(4)
|
||||
STUB_ENTRY(5)
|
||||
|
|
|
@ -475,6 +475,20 @@ xptcstubs_asm_ppc_darwin.o: xptcstubs_asm_ppc_darwin.s.m4 $(PUBLIC)/xptcstubsdef
|
|||
$(RM) -f ./xptcstubs_asm_ppc_darwin.s
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
ifdef HAVE_64BIT_OS
|
||||
xptcstubs_asm_ppc_aix64.o: xptcstubs_asm_ppc_aix64.s.m4 $(PUBLIC)/xptcstubsdef.inc Makefile
|
||||
m4 -DAIX_OBJMODEL=$(AIX_OBJMODEL) $(INCLUDES) -I. $< > ./xptcstubs_asm_ppc_aix64.s && \
|
||||
$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_ppc_aix64.s
|
||||
$(RM) ./xptcstubs_asm_ppc_aix64.s
|
||||
else
|
||||
xptcstubs_asm_ppc_aix.o: xptcstubs_asm_ppc_aix.s.m4 $(PUBLIC)/xptcstubsdef.inc Makefile
|
||||
m4 -DAIX_OBJMODEL=$(AIX_OBJMODEL) $(INCLUDES) -I. $< > ./xptcstubs_asm_ppc_aix.s && \
|
||||
$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_ppc_aix.s
|
||||
$(RM) ./xptcstubs_asm_ppc_aix.s
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),IRIX)
|
||||
# The assembler on IRIX (6.3 only?) seems to have trouble with the default command,
|
||||
# but works fine if we first copy the header and source file into the current dir.
|
||||
|
|
|
@ -1,133 +0,0 @@
|
|||
#
|
||||
# -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1999
|
||||
# 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 *****
|
||||
|
||||
.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
|
||||
.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
|
||||
.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
|
||||
.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
|
||||
.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
|
||||
.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
|
||||
.set r30,30; .set r31,31
|
||||
.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
|
||||
.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
|
||||
.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
|
||||
.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
|
||||
.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
|
||||
.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
|
||||
.set f30,30; .set f31,31
|
||||
|
||||
|
||||
|
||||
.rename H.10.NO_SYMBOL{PR},""
|
||||
.rename H.18.SharedStub{TC},"SharedStub"
|
||||
|
||||
|
||||
# .text section
|
||||
|
||||
.csect H.10.NO_SYMBOL{PR}
|
||||
.globl .SharedStub
|
||||
.globl SharedStub{DS}
|
||||
.extern .PrepareAndDispatch
|
||||
|
||||
|
||||
#jimbo csect CODE{PR}
|
||||
#
|
||||
# on entry SharedStub has the method selector in r12, the rest of the original
|
||||
# parameters are in r3 thru r10 and f1 thru f13
|
||||
#
|
||||
#jimbo import .PrepareAndDispatch
|
||||
|
||||
.SharedStub:
|
||||
mflr r0
|
||||
stw r0,8(sp)
|
||||
|
||||
mr r12,r3 # Move methodIndex into r12 for LATER
|
||||
lwz r3,104(sp) # Get the 'original' r3
|
||||
|
||||
stwu sp,-176(sp) # room for linkage (24), fprData (104), gprData(28)
|
||||
# outgoing params to PrepareAndDispatch (20)
|
||||
|
||||
stw r4,44(sp)
|
||||
stw r5,48(sp)
|
||||
stw r6,52(sp)
|
||||
stw r7,56(sp)
|
||||
stw r8,60(sp)
|
||||
stw r9,64(sp)
|
||||
stw r10,68(sp)
|
||||
stfd f1,72(sp)
|
||||
stfd f2,80(sp)
|
||||
stfd f3,88(sp)
|
||||
stfd f4,96(sp)
|
||||
stfd f5,104(sp)
|
||||
stfd f6,112(sp)
|
||||
stfd f7,120(sp)
|
||||
stfd f8,128(sp)
|
||||
stfd f9,136(sp)
|
||||
stfd f10,144(sp)
|
||||
stfd f11,152(sp)
|
||||
stfd f12,156(sp)
|
||||
stfd f13,164(sp)
|
||||
|
||||
addi r6,sp,44 # gprData
|
||||
addi r7,sp,72 # fprData
|
||||
# r3 has the 'self' pointer already
|
||||
mr r4,r12 # methodIndex selector (it is now LATER)
|
||||
addi r5,sp,312 # pointer to callers args area, beyond r3-r10 mapped range
|
||||
|
||||
bl .PrepareAndDispatch
|
||||
nop
|
||||
|
||||
lwz r0,184(sp)
|
||||
addi sp,sp,176
|
||||
mtlr r0
|
||||
blr
|
||||
|
||||
# .data section
|
||||
|
||||
.toc # 0x00000038
|
||||
T.18.SharedStub:
|
||||
.tc H.18.SharedStub{TC},SharedStub{DS}
|
||||
|
||||
.csect SharedStub{DS}
|
||||
.long .SharedStub # "\0\0\0\0"
|
||||
.long TOC{TC0} # "\0\0\0008"
|
||||
.long 0x00000000 # "\0\0\0\0"
|
||||
# End csect SharedStub{DS}
|
||||
|
||||
# .bss section
|
|
@ -0,0 +1,137 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# IBM Corporation
|
||||
#
|
||||
|
||||
.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
|
||||
.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
|
||||
.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
|
||||
.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
|
||||
.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
|
||||
.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
|
||||
.set r30,30; .set r31,31
|
||||
.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
|
||||
.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
|
||||
.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
|
||||
.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
|
||||
.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
|
||||
.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
|
||||
.set f30,30; .set f31,31
|
||||
|
||||
# Define the correct name of the stub function based on the object model
|
||||
|
||||
define(STUB_NAME,
|
||||
ifelse(AIX_OBJMODEL, ibm,
|
||||
`Stub'$1`__EI14nsXPTCStubBaseFv',
|
||||
`Stub'$1`__14nsXPTCStubBaseFv'))
|
||||
|
||||
define(STUB_ENTRY, `
|
||||
.rename H.10.NO_SYMBOL{PR},""
|
||||
.rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`"
|
||||
.csect H.10.NO_SYMBOL{PR}
|
||||
.globl .'STUB_NAME($1)`
|
||||
.globl 'STUB_NAME($1)`{DS}
|
||||
|
||||
.'STUB_NAME($1)`:
|
||||
li r12, '$1`
|
||||
b .SharedStub
|
||||
nop
|
||||
|
||||
|
||||
.toc
|
||||
T.18.'STUB_NAME($1)`:
|
||||
.tc H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS}
|
||||
.csect 'STUB_NAME($1)`{DS}
|
||||
.long .'STUB_NAME($1)`
|
||||
.long TOC{TC0}
|
||||
.long 0x00000000
|
||||
')
|
||||
|
||||
define(SENTINEL_ENTRY, `')
|
||||
|
||||
include(xptcstubsdef.inc)
|
||||
|
||||
.rename H.10.NO_SYMBOL{PR},""
|
||||
.rename H.18.SharedStub{TC},"SharedStub"
|
||||
|
||||
# .text section
|
||||
.csect H.10.NO_SYMBOL{PR}
|
||||
.globl .SharedStub
|
||||
.globl SharedStub{DS}
|
||||
.extern .PrepareAndDispatch
|
||||
|
||||
.SharedStub:
|
||||
mflr r0
|
||||
stw r0,8(sp)
|
||||
|
||||
stwu sp,-176(sp) # room for linkage (24), fprData (104), gprData(28)
|
||||
# outgoing params to PrepareAndDispatch (20)
|
||||
|
||||
stw r4,44(sp) # link area (24) + PrepareAndDispatch params (20)
|
||||
stw r5,48(sp)
|
||||
stw r6,52(sp)
|
||||
stw r7,56(sp)
|
||||
stw r8,60(sp)
|
||||
stw r9,64(sp)
|
||||
stw r10,68(sp)
|
||||
stfd f1,72(sp)
|
||||
stfd f2,80(sp)
|
||||
stfd f3,88(sp)
|
||||
stfd f4,96(sp)
|
||||
stfd f5,104(sp)
|
||||
stfd f6,112(sp)
|
||||
stfd f7,120(sp)
|
||||
stfd f8,128(sp)
|
||||
stfd f9,136(sp)
|
||||
stfd f10,144(sp)
|
||||
stfd f11,152(sp)
|
||||
stfd f12,156(sp)
|
||||
stfd f13,164(sp)
|
||||
|
||||
addi r6,sp,44 # gprData
|
||||
|
||||
addi r7,sp,72 # fprData
|
||||
# r3 has the 'self' pointer already
|
||||
mr r4,r12 # methodIndex selector (it is now LATER)
|
||||
addi r5,sp,208 # pointer to callers args area, beyond r3-r10
|
||||
# mapped range
|
||||
|
||||
bl .PrepareAndDispatch
|
||||
nop
|
||||
|
||||
|
||||
lwz r0,184(sp)
|
||||
addi sp,sp,176
|
||||
mtlr r0
|
||||
blr
|
||||
|
||||
# .data section
|
||||
|
||||
.toc # 0x00000038
|
||||
T.18.SharedStub:
|
||||
.tc H.18.SharedStub{TC},SharedStub{DS}
|
||||
|
||||
.csect SharedStub{DS}
|
||||
.long .SharedStub # "\0\0\0\0"
|
||||
.long TOC{TC0} # "\0\0\0008"
|
||||
.long 0x00000000 # "\0\0\0\0"
|
||||
# End csect SharedStub{DS}
|
||||
|
||||
# .bss section
|
|
@ -1,137 +0,0 @@
|
|||
# ***** BEGIN LICENSE BLOCK *****
|
||||
#
|
||||
# Version: MPL 1.1/LGPL 2.1/GPL 2.0
|
||||
#
|
||||
# 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 IBM Corporation.
|
||||
# Portions created by IBM are
|
||||
# Copyright (C) 2002, International Business Machines Corporation.
|
||||
# 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 LGPL or the GPL. 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 *****
|
||||
|
||||
.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
|
||||
.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
|
||||
.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
|
||||
.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
|
||||
.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
|
||||
.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
|
||||
.set r30,30; .set r31,31
|
||||
.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
|
||||
.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
|
||||
.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
|
||||
.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
|
||||
.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
|
||||
.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
|
||||
.set f30,30; .set f31,31
|
||||
|
||||
|
||||
.rename H.10.NO_SYMBOL{PR},""
|
||||
.rename H.18.SharedStub{TC},"SharedStub"
|
||||
|
||||
|
||||
# .text section
|
||||
|
||||
.csect H.10.NO_SYMBOL{PR}
|
||||
.globl .SharedStub
|
||||
.globl SharedStub{DS}
|
||||
.extern .PrepareAndDispatch
|
||||
|
||||
|
||||
#jimbo csect CODE{PR}
|
||||
#
|
||||
# on entry SharedStub has the method selector in r12, the rest of the original
|
||||
# parameters are in r3 thru r10 and f1 thru f13
|
||||
#
|
||||
#jimbo import .PrepareAndDispatch
|
||||
|
||||
.SharedStub:
|
||||
mflr r0
|
||||
std r0,16(sp)
|
||||
|
||||
mr r12,r3 # Move methodIndex into r12 for LATER
|
||||
ld r3,176(sp) # Get the 'original' r3 (load 'this' into r3)
|
||||
|
||||
stdu sp,-248(sp) # room for linkage (24*2), fprData (104),
|
||||
# gprData(28*2), outgoing params to
|
||||
# PrepareAndDispatch (40)
|
||||
|
||||
std r4,88(sp) # link area (48) + PrepareAndDispatch parms (40)
|
||||
std r5,96(sp)
|
||||
std r6,104(sp)
|
||||
std r7,112(sp)
|
||||
std r8,120(sp)
|
||||
std r9,128(sp)
|
||||
std r10,136(sp)
|
||||
stfd f1,144(sp)
|
||||
stfd f2,152(sp)
|
||||
stfd f3,160(sp)
|
||||
stfd f4,168(sp)
|
||||
stfd f5,176(sp)
|
||||
stfd f6,184(sp)
|
||||
stfd f7,192(sp)
|
||||
stfd f8,200(sp)
|
||||
stfd f9,208(sp)
|
||||
stfd f10,216(sp)
|
||||
stfd f11,224(sp)
|
||||
stfd f12,232(sp)
|
||||
stfd f13,240(sp)
|
||||
|
||||
addi r6,sp,88 # gprData
|
||||
addi r7,sp,144 # fprData
|
||||
# r3 has the 'self' pointer already
|
||||
mr r4,r12 # methodIndex selector (it is now LATER)
|
||||
addi r5,sp,488 # pointer to callers args area, beyond r3-r10
|
||||
# mapped range
|
||||
# 32bit: 176 (stack-distance) 64bit: 248 (stack-distance)
|
||||
# 104 (this ptr offset) 176
|
||||
# 32 (8*4 for r3-r10) 64 (8*8)
|
||||
# --- ---
|
||||
# 312 488
|
||||
|
||||
bl .PrepareAndDispatch
|
||||
nop
|
||||
|
||||
ld r0,264(sp) # 248+16
|
||||
addi sp,sp,248
|
||||
mtlr r0
|
||||
blr
|
||||
|
||||
# .data section
|
||||
|
||||
.toc # 0x00000038
|
||||
T.18.SharedStub:
|
||||
.tc H.18.SharedStub{TC},SharedStub{DS}
|
||||
|
||||
.csect SharedStub{DS}
|
||||
.llong .SharedStub # "\0\0\0\0"
|
||||
.llong TOC{TC0} # "\0\0\0008"
|
||||
.llong 0x00000000 # "\0\0\0\0"
|
||||
# End csect SharedStub{DS}
|
||||
|
||||
# .bss section
|
|
@ -0,0 +1,114 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# IBM Corporation
|
||||
#
|
||||
.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
|
||||
.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
|
||||
.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
|
||||
.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
|
||||
.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
|
||||
.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
|
||||
.set r30,30; .set r31,31
|
||||
.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
|
||||
.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
|
||||
.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
|
||||
.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
|
||||
.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
|
||||
.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
|
||||
.set f30,30; .set f31,31
|
||||
# Define the correct name of the stub function based on the object model
|
||||
define(STUB_NAME,
|
||||
ifelse(AIX_OBJMODEL, ibm,
|
||||
`Stub'$1`__EI14nsXPTCStubBaseFv',
|
||||
`Stub'$1`__14nsXPTCStubBaseFv'))
|
||||
define(STUB_ENTRY, `
|
||||
.rename H.10.NO_SYMBOL{PR},""
|
||||
.rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`"
|
||||
.csect H.10.NO_SYMBOL{PR}
|
||||
.globl .'STUB_NAME($1)`
|
||||
.globl 'STUB_NAME($1)`{DS}
|
||||
.'STUB_NAME($1)`:
|
||||
li r12, '$1`
|
||||
b .SharedStub
|
||||
nop
|
||||
.toc
|
||||
T.18.'STUB_NAME($1)`:
|
||||
.tc H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS}
|
||||
.csect 'STUB_NAME($1)`{DS}
|
||||
.llong .'STUB_NAME($1)`
|
||||
.llong TOC{TC0}
|
||||
.llong 0x00000000
|
||||
')
|
||||
define(SENTINEL_ENTRY, `')
|
||||
include(xptcstubsdef.inc)
|
||||
.rename H.10.NO_SYMBOL{PR},""
|
||||
.rename H.18.SharedStub{TC},"SharedStub"
|
||||
# .text section
|
||||
.csect H.10.NO_SYMBOL{PR}
|
||||
.globl .SharedStub
|
||||
.globl SharedStub{DS}
|
||||
.extern .PrepareAndDispatch
|
||||
.SharedStub:
|
||||
mflr r0
|
||||
std r0,16(sp)
|
||||
stdu sp,-248(sp) # room for linkage (24*2), fprData (104), gprData(28*2)
|
||||
# outgoing params to PrepareAndDispatch (40)
|
||||
std r4,88(sp) # link area (48) + PrepareAndDispatch params (20)
|
||||
std r5,96(sp)
|
||||
std r6,104(sp)
|
||||
std r7,112(sp)
|
||||
std r8,120(sp)
|
||||
std r9,128(sp)
|
||||
std r10,136(sp)
|
||||
stfd f1,144(sp)
|
||||
stfd f2,152(sp)
|
||||
stfd f3,160(sp)
|
||||
stfd f4,168(sp)
|
||||
stfd f5,176(sp)
|
||||
stfd f6,184(sp)
|
||||
stfd f7,192(sp)
|
||||
stfd f8,200(sp)
|
||||
stfd f9,208(sp)
|
||||
stfd f10,216(sp)
|
||||
stfd f11,224(sp)
|
||||
stfd f12,232(sp)
|
||||
stfd f13,240(sp)
|
||||
addi r6,sp,88 # gprData
|
||||
addi r7,sp,144 # fprData
|
||||
# r3 has the 'self' pointer already
|
||||
mr r4,r12 # methodIndex selector (it is now LATER)
|
||||
addi r5,sp,328 # pointer to callers args area, beyond r3-r10
|
||||
# mapped range
|
||||
bl .PrepareAndDispatch
|
||||
nop
|
||||
ld r0,264(sp)
|
||||
addi sp,sp,248
|
||||
mtlr r0
|
||||
blr
|
||||
# .data section
|
||||
.toc # 0x00000038
|
||||
T.18.SharedStub:
|
||||
.tc H.18.SharedStub{TC},SharedStub{DS}
|
||||
.csect SharedStub{DS}
|
||||
.llong .SharedStub # "\0\0\0\0"
|
||||
.llong TOC{TC0} # "\0\0\0008"
|
||||
.llong 0x00000000 # "\0\0\0\0"
|
||||
# End csect SharedStub{DS}
|
||||
# .bss section
|
|
@ -203,13 +203,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args, P
|
|||
return result;
|
||||
}
|
||||
|
||||
extern "C" int SharedStub(int);
|
||||
|
||||
#define STUB_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Stub##n() \
|
||||
{ \
|
||||
return SharedStub(n); \
|
||||
} \
|
||||
#define STUB_ENTRY(n)
|
||||
|
||||
#define SENTINEL_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Sentinel##n() \
|
||||
|
|
|
@ -190,13 +190,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args, P
|
|||
return result;
|
||||
}
|
||||
|
||||
extern "C" int SharedStub(int);
|
||||
|
||||
#define STUB_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Stub##n() \
|
||||
{ \
|
||||
return SharedStub(n); \
|
||||
} \
|
||||
#define STUB_ENTRY(n)
|
||||
|
||||
#define SENTINEL_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Sentinel##n() \
|
||||
|
|
Загрузка…
Ссылка в новой задаче