mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
about:startup - merge with trunk, again. try: -b o -p linux,linux64,macosx64,win32 -m all -u crashtest -t all
This commit is contained in:
commit
88754df979
@ -171,7 +171,7 @@ ifdef MOZ_SYMBOLS_EXTRA_BUILDID
|
||||
EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
|
||||
endif
|
||||
|
||||
SYMBOL_INDEX_NAME = \
|
||||
export SYMBOL_INDEX_NAME = \
|
||||
$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
|
||||
|
||||
buildsymbols:
|
||||
|
@ -59,9 +59,9 @@ pref("extensions.logging.enabled", false);
|
||||
// Preferences for AMO integration
|
||||
pref("extensions.getAddons.cache.enabled", true);
|
||||
pref("extensions.getAddons.maxResults", 15);
|
||||
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/guid:%IDS%");
|
||||
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/guid:%IDS%?src=firefox");
|
||||
pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/%APP%/search?q=%TERMS%");
|
||||
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%");
|
||||
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox");
|
||||
pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/%APP%/discovery/%VERSION%/%OS%");
|
||||
|
||||
// Blocklist preferences
|
||||
|
@ -82,6 +82,7 @@ endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DCAN_DRAW_IN_TITLEBAR=1
|
||||
DEFINES += -DMENUBAR_CAN_AUTOHIDE=1
|
||||
endif
|
||||
|
||||
|
@ -104,6 +104,7 @@ body[dir="rtl"] #searchEngineLinks {
|
||||
}
|
||||
|
||||
#searchText {
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,6 @@
|
||||
<img id="searchEngineLogo"/>
|
||||
<form name="searchForm" onsubmit="onSearchSubmit(event)">
|
||||
<input type="text" name="searchText" value="" id="searchText" maxLength="256"/>
|
||||
<br/>
|
||||
<input type="submit" value="&abouthome.searchEngineButton.label;"/>
|
||||
<span id="searchEngineLinks">
|
||||
<a hidden="true" id="searchEngineAdvancedLink">&abouthome.searchEngineLinks.advanced;</a>
|
||||
|
@ -113,15 +113,6 @@
|
||||
label="&helpSafeMode.label;"
|
||||
oncommand="safeModeRestart();"/>
|
||||
<menuseparator/>
|
||||
<menuseparator id="updateSeparator"/>
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_UPDATER
|
||||
<menuitem id="checkForUpdates"
|
||||
label="&updateCmd.label;"
|
||||
class="menuitem-iconic"
|
||||
oncommand="checkForUpdates();"/>
|
||||
#endif
|
||||
#endif
|
||||
<menuseparator id="aboutSeparator"/>
|
||||
<menuitem id="aboutName"
|
||||
accesskey="&aboutProduct.accesskey;"
|
||||
|
409
browser/base/content/browser-appmenu.inc
Normal file
409
browser/base/content/browser-appmenu.inc
Normal file
@ -0,0 +1,409 @@
|
||||
# -*- Mode: HTML -*-
|
||||
# ***** 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 Firefox Application Menu.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# The Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2010
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Dão Gottwald <dao@mozilla.com>
|
||||
# Joshua M. <soapyhamhocks@gmail.com>
|
||||
# Margaret Leibovic <margaret.leibovic@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
<menupopup id="appmenu-popup"
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
onpopupshowing="updateEditUIVisibility();gSyncUI.updateUI();">
|
||||
#else
|
||||
onpopupshowing="updateEditUIVisibility();">
|
||||
#endif
|
||||
<hbox>
|
||||
<vbox id="appmenuPrimaryPane">
|
||||
<hbox flex="1"
|
||||
class="split-menuitem">
|
||||
<menuitem id="appmenu_newTab"
|
||||
class="menuitem-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
key="key_newNavigatorTab"/>
|
||||
<menu class="split-menuitem-menu">
|
||||
<menupopup>
|
||||
<menuitem id="appmenu_newTab_popup"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
key="key_newNavigatorTab"/>
|
||||
<menuitem id="appmenu_newNavigator"
|
||||
label="&newNavigatorCmd.label;"
|
||||
command="cmd_newNavigator"
|
||||
key="key_newNavigator"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_openFile"
|
||||
label="&openFileCmd.label;"
|
||||
command="Browser:OpenFile"
|
||||
key="openFileKb"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuitem id="appmenu_privateBrowsing"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip"
|
||||
label="&privateBrowsingCmd.start.label;"
|
||||
startlabel="&privateBrowsingCmd.start.label;"
|
||||
stoplabel="&privateBrowsingCmd.stop.label;"
|
||||
command="Tools:PrivateBrowsing"
|
||||
key="key_privatebrowsing"/>
|
||||
<menuitem label="&goOfflineCmd.label;"
|
||||
id="appmenu_offlineModeRecovery"
|
||||
type="checkbox"
|
||||
observes="workOfflineMenuitemState"
|
||||
oncommand="BrowserOffline.toggleOfflineStatus();"/>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<hbox>
|
||||
<menuitem id="appmenu-edit-label"
|
||||
label="&appMenuEdit.label;"
|
||||
disabled="true"/>
|
||||
<toolbarbutton id="appmenu-cut"
|
||||
class="appmenu-edit-button"
|
||||
command="cmd_cut"
|
||||
onclick="if (!this.disabled) hidePopup();"
|
||||
tooltiptext="&cutButton.tooltip;"/>
|
||||
<toolbarbutton id="appmenu-copy"
|
||||
class="appmenu-edit-button"
|
||||
command="cmd_copy"
|
||||
onclick="if (!this.disabled) hidePopup();"
|
||||
tooltiptext="©Button.tooltip;"/>
|
||||
<toolbarbutton id="appmenu-paste"
|
||||
class="appmenu-edit-button"
|
||||
command="cmd_paste"
|
||||
onclick="if (!this.disabled) hidePopup();"
|
||||
tooltiptext="&pasteButton.tooltip;"/>
|
||||
</hbox>
|
||||
<menuitem id="appmenu_find"
|
||||
class="menuitem-tooltip"
|
||||
label="&appMenuFind.label;"
|
||||
command="cmd_find"
|
||||
key="key_find"/>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<menuitem id="appmenu_savePage"
|
||||
class="menuitem-tooltip"
|
||||
label="&savePageCmd.label;"
|
||||
command="Browser:SavePage"
|
||||
key="key_savePage"/>
|
||||
<menuitem id="appmenu_sendLink"
|
||||
label="&sendPageCmd.label;"
|
||||
command="Browser:SendLink"/>
|
||||
<hbox flex="1"
|
||||
class="split-menuitem">
|
||||
<menuitem id="appmenu_print"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&printCmd.label;"
|
||||
command="cmd_print"
|
||||
key="printKb"/>
|
||||
<menu class="split-menuitem-menu">
|
||||
<menupopup>
|
||||
<menuitem id="appmenu_print_popup"
|
||||
class="menuitem-iconic"
|
||||
label="&printCmd.label;"
|
||||
command="cmd_print"
|
||||
key="printKb"/>
|
||||
<menuitem id="appmenu_printPreview"
|
||||
label="&printPreviewCmd.label;"
|
||||
command="cmd_printPreview"/>
|
||||
<menuitem id="appmenu_printSetup"
|
||||
label="&printSetupCmd.label;"
|
||||
command="cmd_pageSetup"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<menu id="appmenu_webDeveloper"
|
||||
label="&appMenuWebDeveloper.label;">
|
||||
<menupopup id="appmenu_webDeveloper_popup">
|
||||
<menuitem id="appmenu_webConsole"
|
||||
label="&webConsoleCmd.label;"
|
||||
oncommand="HUDConsoleUI.toggleHUD();"
|
||||
key="key_webConsole"/>
|
||||
<menuitem id="appmenu_pageInspect"
|
||||
hidden="true"
|
||||
label="&inspectMenu.label;"
|
||||
type="checkbox"
|
||||
command="Tools:Inspect"
|
||||
key="key_inspect"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_pageSource"
|
||||
label="&viewPageSourceCmd.label;"
|
||||
command="View:PageSource"
|
||||
key="key_viewSource"/>
|
||||
<menuseparator/>
|
||||
#define ID_PREFIX appmenu_developer_
|
||||
#include browser-charsetmenu.inc
|
||||
#undef ID_PREFIX
|
||||
<menuseparator/>
|
||||
<menuitem label="&goOfflineCmd.label;"
|
||||
type="checkbox"
|
||||
observes="workOfflineMenuitemState"
|
||||
oncommand="BrowserOffline.toggleOfflineStatus();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
#define ID_PREFIX appmenu_
|
||||
#include browser-charsetmenu.inc
|
||||
#undef ID_PREFIX
|
||||
<menuitem id="appmenu_fullScreen"
|
||||
class="menuitem-tooltip"
|
||||
label="&fullScreenCmd.label;"
|
||||
type="checkbox"
|
||||
observes="View:FullScreen"
|
||||
key="key_fullScreen"/>
|
||||
<menuitem id="appmenu-quit"
|
||||
class="menuitem-iconic"
|
||||
#ifdef XP_WIN
|
||||
label="&quitApplicationCmdWin.label;"
|
||||
#else
|
||||
label="&quitApplicationCmd.label;"
|
||||
#endif
|
||||
command="cmd_quitApplication"/>
|
||||
</vbox>
|
||||
<vbox id="appmenuSecondaryPane">
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_bookmarks"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&bookmarksMenu.label;"
|
||||
command="Browser:ShowAllBookmarks"
|
||||
key="manBookmarkKb"/>
|
||||
<menu id="appmenu_bookmarksMenu"
|
||||
class="split-menuitem-menu">
|
||||
<menupopup id="appmenu_bookmarksPopup"
|
||||
placespopup="true"
|
||||
context="placesContext"
|
||||
openInTabs="children"
|
||||
oncommand="BookmarksEventHandler.onCommand(event);"
|
||||
onclick="BookmarksEventHandler.onClick(event);"
|
||||
onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
|
||||
if (!this.parentNode._placesView)
|
||||
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
|
||||
tooltip="bhTooltip"
|
||||
popupsinherittooltip="true">
|
||||
<menuitem id="appmenu_showAllBookmarks"
|
||||
label="&showAllBookmarks.label;"
|
||||
command="Browser:ShowAllBookmarks"
|
||||
context=""
|
||||
key="manBookmarkKb"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_bookmarkThisPage"
|
||||
class="menuitem-iconic"
|
||||
label="&bookmarkThisPageCmd.label;"
|
||||
command="Browser:AddBookmarkAs"
|
||||
key="addBookmarkAsKb"/>
|
||||
<menuitem id="appmenu_subscribeToPage"
|
||||
class="menuitem-iconic"
|
||||
label="&subscribeToPageMenuitem.label;"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
observes="singleFeedMenuitemState"/>
|
||||
<menu id="appmenu_subscribeToPageMenu"
|
||||
class="menu-iconic"
|
||||
label="&subscribeToPageMenupopup.label;"
|
||||
observes="multipleFeedsMenuState">
|
||||
<menupopup id="appmenu_subscribeToPageMenupopup"
|
||||
onpopupshowing="return FeedHandler.buildFeedList(event.target);"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menu id="appmenu_bookmarksToolbar"
|
||||
placesanonid="toolbar-autohide"
|
||||
class="menu-iconic bookmark-item"
|
||||
label="&personalbarCmd.label;"
|
||||
container="true">
|
||||
<menupopup id="appmenu_bookmarksToolbarPopup"
|
||||
placespopup="true"
|
||||
context="placesContext"
|
||||
onpopupshowing="if (!this.parentNode._placesView)
|
||||
new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<!-- Bookmarks menu items -->
|
||||
<menuseparator builder="end"
|
||||
class="hide-if-empty-places-result"/>
|
||||
<menuitem id="appmenu_unsortedBookmarks"
|
||||
label="&appMenuUnsorted.label;"
|
||||
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"
|
||||
class="menuitem-iconic"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_history"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&historyMenu.label;"
|
||||
command="Browser:ShowAllHistory"
|
||||
key="showAllHistoryKb"/>
|
||||
<menu id="appmenu_historyMenu"
|
||||
class="split-menuitem-menu">
|
||||
<menupopup id="appmenu_historyMenupopup"
|
||||
placespopup="true"
|
||||
oncommand="this.parentNode._placesView._onCommand(event);"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
onpopupshowing="if (!this.parentNode._placesView)
|
||||
new HistoryMenu(event);"
|
||||
tooltip="bhTooltip"
|
||||
popupsinherittooltip="true">
|
||||
<menuitem id="appmenu_showAllHistory"
|
||||
label="&showAllHistoryCmd2.label;"
|
||||
command="Browser:ShowAllHistory"
|
||||
key="showAllHistoryKb"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_sanitizeHistory"
|
||||
label="&clearRecentHistory.label;"
|
||||
key="key_sanitize"
|
||||
command="Tools:Sanitize"/>
|
||||
<menuseparator class="hide-if-empty-places-result"/>
|
||||
<menuitem id="appmenu_restoreLastSession"
|
||||
class="restoreLastSession"
|
||||
label="&historyRestoreLastSession.label;"
|
||||
oncommand="restoreLastSession();"
|
||||
disabled="true"/>
|
||||
<menu id="appmenu_recentlyClosedTabsMenu"
|
||||
class="recentlyClosedTabsMenu"
|
||||
label="&historyUndoMenu.label;"
|
||||
disabled="true">
|
||||
<menupopup id="appmenu_recentlyClosedTabsMenupopup"
|
||||
onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoSubmenu();"/>
|
||||
</menu>
|
||||
<menu id="appmenu_recentlyClosedWindowsMenu"
|
||||
class="recentlyClosedWindowsMenu"
|
||||
label="&historyUndoWindowMenu.label;"
|
||||
disabled="true">
|
||||
<menupopup id="appmenu_recentlyClosedWindowsMenupopup"
|
||||
onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoWindowSubmenu();"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuitem id="appmenu_downloads"
|
||||
class="menuitem-tooltip"
|
||||
label="&downloads.label;"
|
||||
command="Tools:Downloads"
|
||||
key="key_openDownloads"/>
|
||||
<spacer id="appmenuSecondaryPane-spacer"/>
|
||||
<menuitem id="appmenu_addons"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip"
|
||||
label="&addons.label;"
|
||||
command="Tools:Addons"
|
||||
key="key_openAddons"/>
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_customize"
|
||||
#ifdef XP_UNIX
|
||||
label="&preferencesCmdUnix.label;"
|
||||
#else
|
||||
label="&preferencesCmd.label;"
|
||||
#endif
|
||||
class="split-menuitem-item"
|
||||
flex="1"
|
||||
oncommand="openPreferences();"/>
|
||||
<menu class="split-menuitem-menu"
|
||||
label="&preferencesCmd.label;">
|
||||
<menupopup id="appmenu_customizeMenu"
|
||||
onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleTabsOnTop').previousSibling);">
|
||||
<menuitem id="appmenu_preferences"
|
||||
#ifdef XP_UNIX
|
||||
label="&preferencesCmdUnix.label;"
|
||||
#else
|
||||
label="&preferencesCmd.label;"
|
||||
#endif
|
||||
oncommand="openPreferences();"/>
|
||||
<menuseparator/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_toggleTabsOnTop"
|
||||
label="&viewTabsOnTop.label;"
|
||||
type="checkbox"
|
||||
command="cmd_ToggleTabsOnTop"/>
|
||||
<menuitem id="appmenu_toolbarLayout"
|
||||
label="&appMenuToolbarLayout.label;"
|
||||
command="cmd_CustomizeToolbars"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_help"
|
||||
class="split-menuitem-item"
|
||||
flex="1"
|
||||
label="&helpMenu.label;"
|
||||
oncommand="openHelpLink('firefox-help')"/>
|
||||
<menu class="split-menuitem-menu">
|
||||
<menupopup id="appmenu_helpMenupopup">
|
||||
<menuitem id="appmenu_openHelp"
|
||||
label="&helpMenu.label;"
|
||||
oncommand="openHelpLink('firefox-help')"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="appmenu_gettingStarted"
|
||||
label="&appMenuGettingStarted.label;"
|
||||
oncommand="gBrowser.loadOneTab('http://www.mozilla.com/firefox/central/', {inBackground: false});"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="appmenu_troubleshootingInfo"
|
||||
label="&helpTroubleshootingInfo.label;"
|
||||
oncommand="openTroubleshootingPage()"
|
||||
onclick="checkForMiddleClick(this,event);"/>
|
||||
<menuitem id="appmenu_feedbackPage"
|
||||
label="&helpFeedbackPage.label;"
|
||||
oncommand="openFeedbackPage()"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_safeMode"
|
||||
accesskey="&appMenuSafeMode.accesskey;"
|
||||
label="&appMenuSafeMode.label;"
|
||||
oncommand="safeModeRestart();"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_about"
|
||||
label="&aboutProduct.label;"
|
||||
oncommand="openAboutDialog();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
<spacer flex="1"/>
|
||||
<!-- only one of sync-setup or sync-syncnow will be showing at once -->
|
||||
<menuitem id="sync-setup-appmenu"
|
||||
label="&syncSetup.label;"
|
||||
observes="sync-setup-state"
|
||||
oncommand="gSyncUI.openSetup()"/>
|
||||
<menuitem id="sync-syncnowitem-appmenu"
|
||||
label="&syncSyncNowItem.label;"
|
||||
observes="sync-syncnow-state"
|
||||
oncommand="gSyncUI.doSync(event);"/>
|
||||
#endif
|
||||
</vbox>
|
||||
</hbox>
|
||||
</menupopup>
|
@ -439,11 +439,17 @@
|
||||
command="Browser:AddBookmarkAs"
|
||||
key="addBookmarkAsKb"/>
|
||||
<menuitem id="subscribeToPageMenuitem"
|
||||
#ifndef XP_MACOSX
|
||||
class="menuitem-iconic"
|
||||
#endif
|
||||
label="&subscribeToPageMenuitem.label;"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
observes="singleFeedMenuitemState"/>
|
||||
<menu id="subscribeToPageMenupopup"
|
||||
#ifndef XP_MACOSX
|
||||
class="menu-iconic"
|
||||
#endif
|
||||
label="&subscribeToPageMenupopup.label;"
|
||||
observes="multipleFeedsMenuState">
|
||||
<menupopup id="subscribeToPageSubmenuMenupopup"
|
||||
|
@ -80,7 +80,7 @@ toolbar[printpreview="true"] {
|
||||
-moz-box-ordinal-group: 10;
|
||||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
%ifdef CAN_DRAW_IN_TITLEBAR
|
||||
#main-window[inFullscreen] > #titlebar {
|
||||
display: none;
|
||||
}
|
||||
|
@ -1928,6 +1928,11 @@ function BrowserGoHome(aEvent) {
|
||||
var where = whereToOpenLink(aEvent, false, true);
|
||||
var urls;
|
||||
|
||||
// Home page should open in a new tab when current tab is an app tab
|
||||
if (where == "current" &&
|
||||
gBrowser.selectedTab.pinned)
|
||||
where = "tab";
|
||||
|
||||
// openUILinkIn in utilityOverlay.js doesn't handle loading multiple pages
|
||||
switch (where) {
|
||||
case "current":
|
||||
@ -3489,9 +3494,10 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
|
||||
PlacesToolbarHelper.customizeDone();
|
||||
BookmarksMenuButton.customizeDone();
|
||||
|
||||
UpdateUrlbarSearchSplitterState();
|
||||
|
||||
// The url bar splitter state is dependent on whether stop/reload
|
||||
// and the location bar are combined, so we need this ordering
|
||||
CombinedStopReload.init();
|
||||
UpdateUrlbarSearchSplitterState();
|
||||
|
||||
// Update the urlbar
|
||||
if (gURLBar) {
|
||||
@ -4723,14 +4729,18 @@ function updateAppButtonDisplay() {
|
||||
window.menubar.visible &&
|
||||
document.getElementById("toolbar-menubar").getAttribute("autohide") == "true";
|
||||
|
||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
||||
document.getElementById("titlebar").hidden = !displayAppButton;
|
||||
|
||||
if (displayAppButton)
|
||||
document.documentElement.setAttribute("chromemargin", "0,-1,-1,-1");
|
||||
else
|
||||
document.documentElement.removeAttribute("chromemargin");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
||||
function onTitlebarMaxClick() {
|
||||
if (window.windowState == window.STATE_MAXIMIZED)
|
||||
window.restore();
|
||||
|
@ -429,7 +429,7 @@
|
||||
<tooltip id="tabbrowser-tab-tooltip" onpopupshowing="gBrowser.createTooltip(event);"/>
|
||||
</popupset>
|
||||
|
||||
#ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
||||
<vbox id="titlebar">
|
||||
<hbox id="titlebar-content">
|
||||
<hbox id="appmenu-button-container" align="start">
|
||||
@ -441,371 +441,7 @@
|
||||
label="&appMenuButton.label;"
|
||||
#endif
|
||||
style="-moz-user-focus: ignore;">
|
||||
<menupopup id="appmenu-popup"
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
onpopupshowing="updateEditUIVisibility();gSyncUI.updateUI();">
|
||||
#else
|
||||
onpopupshowing="updateEditUIVisibility();">
|
||||
#endif
|
||||
<hbox>
|
||||
<vbox id="appmenuPrimaryPane">
|
||||
<hbox flex="1"
|
||||
class="split-menuitem">
|
||||
<menuitem id="appmenu_newTab"
|
||||
class="menuitem-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
key="key_newNavigatorTab"/>
|
||||
<menu class="split-menuitem-menu">
|
||||
<menupopup>
|
||||
<menuitem id="appmenu_newTab_popup"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
key="key_newNavigatorTab"/>
|
||||
<menuitem id="appmenu_newNavigator"
|
||||
label="&newNavigatorCmd.label;"
|
||||
command="cmd_newNavigator"
|
||||
key="key_newNavigator"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_openFile"
|
||||
label="&openFileCmd.label;"
|
||||
command="Browser:OpenFile"
|
||||
key="openFileKb"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuitem id="appmenu_privateBrowsing"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip"
|
||||
label="&privateBrowsingCmd.start.label;"
|
||||
startlabel="&privateBrowsingCmd.start.label;"
|
||||
stoplabel="&privateBrowsingCmd.stop.label;"
|
||||
command="Tools:PrivateBrowsing"
|
||||
key="key_privatebrowsing"/>
|
||||
<menuitem label="&goOfflineCmd.label;"
|
||||
id="appmenu_offlineModeRecovery"
|
||||
type="checkbox"
|
||||
observes="workOfflineMenuitemState"
|
||||
oncommand="BrowserOffline.toggleOfflineStatus();"/>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<hbox>
|
||||
<menuitem id="appmenu-edit-label"
|
||||
label="&appMenuEdit.label;"
|
||||
disabled="true"/>
|
||||
<toolbarbutton id="appmenu-cut"
|
||||
class="appmenu-edit-button"
|
||||
command="cmd_cut"
|
||||
onclick="if (!this.disabled) hidePopup();"
|
||||
tooltiptext="&cutButton.tooltip;"/>
|
||||
<toolbarbutton id="appmenu-copy"
|
||||
class="appmenu-edit-button"
|
||||
command="cmd_copy"
|
||||
onclick="if (!this.disabled) hidePopup();"
|
||||
tooltiptext="©Button.tooltip;"/>
|
||||
<toolbarbutton id="appmenu-paste"
|
||||
class="appmenu-edit-button"
|
||||
command="cmd_paste"
|
||||
onclick="if (!this.disabled) hidePopup();"
|
||||
tooltiptext="&pasteButton.tooltip;"/>
|
||||
</hbox>
|
||||
<menuitem id="appmenu_find"
|
||||
class="menuitem-tooltip"
|
||||
label="&appMenuFind.label;"
|
||||
command="cmd_find"
|
||||
key="key_find"/>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<menuitem id="appmenu_savePage"
|
||||
class="menuitem-tooltip"
|
||||
label="&savePageCmd.label;"
|
||||
command="Browser:SavePage"
|
||||
key="key_savePage"/>
|
||||
<menuitem id="appmenu_sendLink"
|
||||
label="&sendPageCmd.label;"
|
||||
command="Browser:SendLink"/>
|
||||
<hbox flex="1"
|
||||
class="split-menuitem">
|
||||
<menuitem id="appmenu_print"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&printCmd.label;"
|
||||
command="cmd_print"
|
||||
key="printKb"/>
|
||||
<menu class="split-menuitem-menu">
|
||||
<menupopup>
|
||||
<menuitem id="appmenu_print_popup"
|
||||
class="menuitem-iconic"
|
||||
label="&printCmd.label;"
|
||||
command="cmd_print"
|
||||
key="printKb"/>
|
||||
<menuitem id="appmenu_printPreview"
|
||||
label="&printPreviewCmd.label;"
|
||||
command="cmd_printPreview"/>
|
||||
<menuitem id="appmenu_printSetup"
|
||||
label="&printSetupCmd.label;"
|
||||
command="cmd_pageSetup"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<menu id="appmenu_webDeveloper"
|
||||
label="&appMenuWebDeveloper.label;">
|
||||
<menupopup id="appmenu_webDeveloper_popup">
|
||||
<menuitem id="appmenu_webConsole"
|
||||
label="&webConsoleCmd.label;"
|
||||
oncommand="HUDConsoleUI.toggleHUD();"
|
||||
key="key_webConsole"/>
|
||||
<menuitem id="appmenu_pageInspect"
|
||||
hidden="true"
|
||||
label="&inspectMenu.label;"
|
||||
type="checkbox"
|
||||
command="Tools:Inspect"
|
||||
key="key_inspect"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_pageSource"
|
||||
label="&viewPageSourceCmd.label;"
|
||||
command="View:PageSource"
|
||||
key="key_viewSource"/>
|
||||
<menuseparator/>
|
||||
#define ID_PREFIX appmenu_developer_
|
||||
#include browser-charsetmenu.inc
|
||||
#undef ID_PREFIX
|
||||
<menuseparator/>
|
||||
<menuitem label="&goOfflineCmd.label;"
|
||||
type="checkbox"
|
||||
observes="workOfflineMenuitemState"
|
||||
oncommand="BrowserOffline.toggleOfflineStatus();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
#define ID_PREFIX appmenu_
|
||||
#include browser-charsetmenu.inc
|
||||
#undef ID_PREFIX
|
||||
<menuitem id="appmenu_fullScreen"
|
||||
class="menuitem-tooltip"
|
||||
label="&fullScreenCmd.label;"
|
||||
type="checkbox"
|
||||
observes="View:FullScreen"
|
||||
key="key_fullScreen"/>
|
||||
<menuitem id="appmenu-quit"
|
||||
class="menuitem-iconic"
|
||||
#ifdef XP_WIN
|
||||
label="&quitApplicationCmdWin.label;"
|
||||
#else
|
||||
label="&quitApplicationCmd.label;"
|
||||
#endif
|
||||
command="cmd_quitApplication"/>
|
||||
</vbox>
|
||||
<vbox id="appmenuSecondaryPane">
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_bookmarks"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&bookmarksMenu.label;"
|
||||
command="Browser:ShowAllBookmarks"
|
||||
key="manBookmarkKb"/>
|
||||
<menu id="appmenu_bookmarksMenu"
|
||||
class="split-menuitem-menu">
|
||||
<menupopup id="appmenu_bookmarksPopup"
|
||||
placespopup="true"
|
||||
context="placesContext"
|
||||
openInTabs="children"
|
||||
oncommand="BookmarksEventHandler.onCommand(event);"
|
||||
onclick="BookmarksEventHandler.onClick(event);"
|
||||
onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
|
||||
if (!this.parentNode._placesView)
|
||||
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
|
||||
tooltip="bhTooltip"
|
||||
popupsinherittooltip="true">
|
||||
<menuitem id="appmenu_showAllBookmarks"
|
||||
label="&showAllBookmarks.label;"
|
||||
command="Browser:ShowAllBookmarks"
|
||||
context=""
|
||||
key="manBookmarkKb"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_bookmarkThisPage"
|
||||
class="menuitem-iconic"
|
||||
label="&bookmarkThisPageCmd.label;"
|
||||
command="Browser:AddBookmarkAs"
|
||||
key="addBookmarkAsKb"/>
|
||||
<menuitem id="appmenu_subscribeToPage"
|
||||
class="menuitem-iconic"
|
||||
label="&subscribeToPageMenuitem.label;"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
observes="singleFeedMenuitemState"/>
|
||||
<menu id="appmenu_subscribeToPageMenu"
|
||||
class="menu-iconic"
|
||||
label="&subscribeToPageMenupopup.label;"
|
||||
observes="multipleFeedsMenuState">
|
||||
<menupopup id="appmenu_subscribeToPageMenupopup"
|
||||
onpopupshowing="return FeedHandler.buildFeedList(event.target);"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menu id="appmenu_bookmarksToolbar"
|
||||
placesanonid="toolbar-autohide"
|
||||
class="menu-iconic bookmark-item"
|
||||
label="&personalbarCmd.label;"
|
||||
container="true">
|
||||
<menupopup id="appmenu_bookmarksToolbarPopup"
|
||||
placespopup="true"
|
||||
context="placesContext"
|
||||
onpopupshowing="if (!this.parentNode._placesView)
|
||||
new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<!-- Bookmarks menu items -->
|
||||
<menuseparator builder="end"
|
||||
class="hide-if-empty-places-result"/>
|
||||
<menuitem id="appmenu_unsortedBookmarks"
|
||||
label="&appMenuUnsorted.label;"
|
||||
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"
|
||||
class="menuitem-iconic"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_history"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
|
||||
flex="1"
|
||||
label="&historyMenu.label;"
|
||||
command="Browser:ShowAllHistory"
|
||||
key="showAllHistoryKb"/>
|
||||
<menu id="appmenu_historyMenu"
|
||||
class="split-menuitem-menu">
|
||||
<menupopup id="appmenu_historyMenupopup"
|
||||
placespopup="true"
|
||||
oncommand="this.parentNode._placesView._onCommand(event);"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
onpopupshowing="if (!this.parentNode._placesView)
|
||||
new HistoryMenu(event);"
|
||||
tooltip="bhTooltip"
|
||||
popupsinherittooltip="true">
|
||||
<menuitem id="appmenu_showAllHistory"
|
||||
label="&showAllHistoryCmd2.label;"
|
||||
command="Browser:ShowAllHistory"
|
||||
key="showAllHistoryKb"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_sanitizeHistory"
|
||||
label="&clearRecentHistory.label;"
|
||||
key="key_sanitize"
|
||||
command="Tools:Sanitize"/>
|
||||
<menuseparator class="hide-if-empty-places-result"/>
|
||||
<menuitem id="appmenu_restoreLastSession"
|
||||
class="restoreLastSession"
|
||||
label="&historyRestoreLastSession.label;"
|
||||
oncommand="restoreLastSession();"
|
||||
disabled="true"/>
|
||||
<menu id="appmenu_recentlyClosedTabsMenu"
|
||||
class="recentlyClosedTabsMenu"
|
||||
label="&historyUndoMenu.label;"
|
||||
disabled="true">
|
||||
<menupopup id="appmenu_recentlyClosedTabsMenupopup"
|
||||
onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoSubmenu();"/>
|
||||
</menu>
|
||||
<menu id="appmenu_recentlyClosedWindowsMenu"
|
||||
class="recentlyClosedWindowsMenu"
|
||||
label="&historyUndoWindowMenu.label;"
|
||||
disabled="true">
|
||||
<menupopup id="appmenu_recentlyClosedWindowsMenupopup"
|
||||
onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoWindowSubmenu();"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuitem id="appmenu_downloads"
|
||||
class="menuitem-tooltip"
|
||||
label="&downloads.label;"
|
||||
command="Tools:Downloads"
|
||||
key="key_openDownloads"/>
|
||||
<spacer id="appmenuSecondaryPane-spacer"/>
|
||||
<menuitem id="appmenu_addons"
|
||||
class="menuitem-iconic menuitem-iconic-tooltip"
|
||||
label="&addons.label;"
|
||||
command="Tools:Addons"
|
||||
key="key_openAddons"/>
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_customize"
|
||||
label="&preferencesCmd.label;"
|
||||
class="split-menuitem-item"
|
||||
flex="1"
|
||||
oncommand="openPreferences();"/>
|
||||
<menu class="split-menuitem-menu"
|
||||
label="&preferencesCmd.label;">
|
||||
<menupopup id="appmenu_customizeMenu"
|
||||
onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleTabsOnTop').previousSibling);">
|
||||
<menuitem id="appmenu_preferences"
|
||||
#ifdef XP_UNIX
|
||||
label="&preferencesCmdUnix.label;"
|
||||
#else
|
||||
label="&preferencesCmd.label;"
|
||||
#endif
|
||||
oncommand="openPreferences();"/>
|
||||
<menuseparator/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_toggleTabsOnTop"
|
||||
label="&viewTabsOnTop.label;"
|
||||
type="checkbox"
|
||||
command="cmd_ToggleTabsOnTop"/>
|
||||
<menuitem id="appmenu_toolbarLayout"
|
||||
label="&appMenuToolbarLayout.label;"
|
||||
command="cmd_CustomizeToolbars"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
<hbox class="split-menuitem">
|
||||
<menuitem id="appmenu_help"
|
||||
class="split-menuitem-item"
|
||||
flex="1"
|
||||
label="&helpMenu.label;"
|
||||
oncommand="openHelpLink('firefox-help')"/>
|
||||
<menu class="split-menuitem-menu">
|
||||
<menupopup id="appmenu_helpMenupopup">
|
||||
<menuitem id="appmenu_openHelp"
|
||||
label="&helpMenu.label;"
|
||||
oncommand="openHelpLink('firefox-help')"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="appmenu_gettingStarted"
|
||||
label="&appMenuGettingStarted.label;"
|
||||
oncommand="gBrowser.loadOneTab('http://www.mozilla.com/firefox/central/', {inBackground: false});"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="appmenu_troubleshootingInfo"
|
||||
label="&helpTroubleshootingInfo.label;"
|
||||
oncommand="openTroubleshootingPage()"
|
||||
onclick="checkForMiddleClick(this,event);"/>
|
||||
<menuitem id="appmenu_feedbackPage"
|
||||
label="&helpFeedbackPage.label;"
|
||||
oncommand="openFeedbackPage()"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_safeMode"
|
||||
accesskey="&appMenuSafeMode.accesskey;"
|
||||
label="&appMenuSafeMode.label;"
|
||||
oncommand="safeModeRestart();"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_about"
|
||||
label="&aboutProduct.label;"
|
||||
oncommand="openAboutDialog();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</hbox>
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
<spacer flex="1"/>
|
||||
<!-- only one of sync-setup or sync-syncnow will be showing at once -->
|
||||
<menuitem id="sync-setup-appmenu"
|
||||
label="&syncSetup.label;"
|
||||
observes="sync-setup-state"
|
||||
oncommand="gSyncUI.openSetup()"/>
|
||||
<menuitem id="sync-syncnowitem-appmenu"
|
||||
label="&syncSyncNowItem.label;"
|
||||
observes="sync-syncnow-state"
|
||||
oncommand="gSyncUI.doSync(event);"/>
|
||||
#endif
|
||||
</vbox>
|
||||
</hbox>
|
||||
</menupopup>
|
||||
#include browser-appmenu.inc
|
||||
</button>
|
||||
</hbox>
|
||||
<spacer id="titlebar-spacer" flex="1"/>
|
||||
@ -944,13 +580,16 @@
|
||||
onclick="gURLBar.handleCommand(event);"/>
|
||||
</hbox>
|
||||
<toolbarbutton id="urlbar-go-button"
|
||||
class="chromeclass-toolbar-additional"
|
||||
onclick="gURLBar.handleCommand(event);"
|
||||
tooltiptext="&goEndCap.tooltip;"/>
|
||||
<toolbarbutton id="urlbar-reload-button"
|
||||
class="chromeclass-toolbar-additional"
|
||||
command="Browser:ReloadOrDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltiptext="&reloadButton.tooltip;"/>
|
||||
<toolbarbutton id="urlbar-stop-button"
|
||||
class="chromeclass-toolbar-additional"
|
||||
command="Browser:Stop"
|
||||
tooltiptext="&stopButton.tooltip;"/>
|
||||
</textbox>
|
||||
@ -1016,11 +655,17 @@
|
||||
command="Browser:AddBookmarkAs"
|
||||
key="addBookmarkAsKb"/>
|
||||
<menuitem id="BMB_subscribeToPageMenuitem"
|
||||
#ifndef XP_MACOSX
|
||||
class="menuitem-iconic"
|
||||
#endif
|
||||
label="&subscribeToPageMenuitem.label;"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
observes="singleFeedMenuitemState"/>
|
||||
<menu id="BMB_subscribeToPageMenupopup"
|
||||
#ifndef XP_MACOSX
|
||||
class="menu-iconic"
|
||||
#endif
|
||||
label="&subscribeToPageMenupopup.label;"
|
||||
observes="multipleFeedsMenuState">
|
||||
<menupopup id="BMB_subscribeToPageSubmenuMenupopup"
|
||||
|
@ -81,6 +81,8 @@ function GroupItem(listOfEls, options) {
|
||||
this.locked = (options.locked ? Utils.copy(options.locked) : {});
|
||||
this.topChild = null;
|
||||
this.hidden = false;
|
||||
this.fadeAwayUndoButtonDelay = 15000;
|
||||
this.fadeAwayUndoButtonDuration = 300;
|
||||
|
||||
this.keepProportional = false;
|
||||
|
||||
@ -277,6 +279,7 @@ function GroupItem(listOfEls, options) {
|
||||
|
||||
// ___ Undo Close
|
||||
this.$undoContainer = null;
|
||||
this._undoButtonTimeoutId = null;
|
||||
|
||||
// ___ Superclass initialization
|
||||
this._init($container[0]);
|
||||
@ -637,28 +640,6 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
});
|
||||
}, 50);
|
||||
|
||||
let remove = function() {
|
||||
// close all children
|
||||
let toClose = self._children.concat();
|
||||
toClose.forEach(function(child) {
|
||||
child.removeSubscriber(self, "close");
|
||||
child.close();
|
||||
});
|
||||
|
||||
// remove all children
|
||||
self.removeAll();
|
||||
GroupItems.unregister(self);
|
||||
self._sendToSubscribers("close");
|
||||
self.removeTrenches();
|
||||
|
||||
iQ(self.container).remove();
|
||||
self.$undoContainer.remove();
|
||||
self.$undoContainer = null;
|
||||
Items.unsquish();
|
||||
|
||||
self.deleteData();
|
||||
};
|
||||
|
||||
this.$undoContainer.click(function(e) {
|
||||
// Only do this for clicks on this actual element.
|
||||
if (e.target.nodeName != self.$undoContainer[0].nodeName)
|
||||
@ -667,6 +648,7 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
self.$undoContainer.fadeOut(function() {
|
||||
iQ(this).remove();
|
||||
self.hidden = false;
|
||||
self._cancelFadeAwayUndoButtonTimer();
|
||||
self.$undoContainer = null;
|
||||
|
||||
iQ(self.container).show().animate({
|
||||
@ -686,31 +668,92 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
});
|
||||
|
||||
undoClose.click(function() {
|
||||
self.$undoContainer.fadeOut(remove);
|
||||
self._cancelFadeAwayUndoButtonTimer();
|
||||
self.$undoContainer.fadeOut(function() { self._removeHiddenGroupItem(); });
|
||||
});
|
||||
|
||||
// After 15 seconds, fade away.
|
||||
const WAIT = 15000;
|
||||
const FADE = 300;
|
||||
this.setupFadeAwayUndoButtonTimer();
|
||||
// Cancel the fadeaway if you move the mouse over the undo
|
||||
// button, and restart the countdown once you move out of it.
|
||||
this.$undoContainer.mouseover(function() {
|
||||
self._cancelFadeAwayUndoButtonTimer();
|
||||
});
|
||||
this.$undoContainer.mouseout(function() {
|
||||
self.setupFadeAwayUndoButtonTimer();
|
||||
});
|
||||
},
|
||||
|
||||
let fadeaway = function() {
|
||||
if (self.$undoContainer)
|
||||
// ----------
|
||||
// Sets up fade away undo button timeout.
|
||||
setupFadeAwayUndoButtonTimer: function() {
|
||||
let self = this;
|
||||
|
||||
if (!this._undoButtonTimeoutId) {
|
||||
this._undoButtonTimeoutId = setTimeout(function() {
|
||||
self._fadeAwayUndoButton();
|
||||
}, this.fadeAwayUndoButtonDelay);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Cancels the fade away undo button timeout.
|
||||
_cancelFadeAwayUndoButtonTimer: function() {
|
||||
clearTimeout(this._undoButtonTimeoutId);
|
||||
this._undoButtonTimeoutId = null;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Fades away the undo button
|
||||
_fadeAwayUndoButton: function() {
|
||||
let self = this;
|
||||
|
||||
if (this.$undoContainer) {
|
||||
// if there is one or more orphan tabs or there is more than one group
|
||||
// and other groupS are not empty, fade away the undo button.
|
||||
let shouldFadeAway = GroupItems.getOrphanedTabs().length > 0;
|
||||
|
||||
if (!shouldFadeAway && GroupItems.groupItems.length > 1) {
|
||||
shouldFadeAway =
|
||||
GroupItems.groupItems.some(function(groupItem) {
|
||||
return (groupItem != self && groupItem.getChildren().length > 0);
|
||||
});
|
||||
}
|
||||
if (shouldFadeAway) {
|
||||
self.$undoContainer.animate({
|
||||
color: "transparent",
|
||||
opacity: 0
|
||||
}, {
|
||||
duration: FADE,
|
||||
complete: remove
|
||||
duration: this.fadeAwayUndoButtonDuration,
|
||||
complete: function() { self._removeHiddenGroupItem(); }
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
let timeoutId = setTimeout(fadeaway, WAIT);
|
||||
// Cancel the fadeaway if you move the mouse over the undo
|
||||
// button, and restart the countdown once you move out of it.
|
||||
this.$undoContainer.mouseover(function() clearTimeout(timeoutId));
|
||||
this.$undoContainer.mouseout(function() {
|
||||
timeoutId = setTimeout(fadeaway, WAIT);
|
||||
// ----------
|
||||
// Removes the group item, its children and its container.
|
||||
_removeHiddenGroupItem: function() {
|
||||
let self = this;
|
||||
|
||||
// close all children
|
||||
let toClose = this._children.concat();
|
||||
toClose.forEach(function(child) {
|
||||
child.removeSubscriber(self, "close");
|
||||
child.close();
|
||||
});
|
||||
|
||||
// remove all children
|
||||
this.removeAll();
|
||||
GroupItems.unregister(this);
|
||||
this._sendToSubscribers("close");
|
||||
this.removeTrenches();
|
||||
|
||||
iQ(this.container).remove();
|
||||
this.$undoContainer.remove();
|
||||
this.$undoContainer = null;
|
||||
Items.unsquish();
|
||||
|
||||
this.deleteData();
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -1,252 +0,0 @@
|
||||
/* ***** 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 infoitems.js.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ian Gilman <ian@iangilman.com>
|
||||
* Aza Raskin <aza@mozilla.com>
|
||||
* Michael Yoshitaka Erlewine <mitcho@mitcho.com>
|
||||
* Ehsan Akhgari <ehsan@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 ***** */
|
||||
|
||||
// **********
|
||||
// Title: infoitems.js
|
||||
|
||||
// ##########
|
||||
// Class: InfoItem
|
||||
// An <Item> in TabView used for displaying information, such as the welcome video.
|
||||
// Note that it implements the <Subscribable> interface.
|
||||
//
|
||||
// ----------
|
||||
// Constructor: InfoItem
|
||||
//
|
||||
// Parameters:
|
||||
// bounds - a <Rect> for where the item should be located
|
||||
// options - various options for this infoItem (see below)
|
||||
//
|
||||
// Possible options:
|
||||
// locked - see <Item.locked>; default is {}
|
||||
// dontPush - true if this infoItem shouldn't push away on creation; default is false
|
||||
// immediately - place the item immediately, without animation
|
||||
function InfoItem(bounds, options) {
|
||||
try {
|
||||
Utils.assertThrow(Utils.isRect(bounds), 'bounds');
|
||||
|
||||
if (typeof options == 'undefined')
|
||||
options = {};
|
||||
|
||||
this._inited = false;
|
||||
this.isAnInfoItem = true;
|
||||
this.defaultSize = bounds.size();
|
||||
this.locked = (options.locked ? Utils.copy(options.locked) : {});
|
||||
this.bounds = new Rect(bounds);
|
||||
this.isDragging = false;
|
||||
|
||||
var self = this;
|
||||
|
||||
var $container = iQ('<div>')
|
||||
.addClass('info-item')
|
||||
.css(this.bounds)
|
||||
.appendTo('body');
|
||||
|
||||
this.$contents = iQ('<div>')
|
||||
.appendTo($container);
|
||||
|
||||
var $close = iQ('<div>')
|
||||
.addClass('close')
|
||||
.click(function() {
|
||||
self.close();
|
||||
})
|
||||
.appendTo($container);
|
||||
|
||||
// ___ locking
|
||||
if (this.locked.bounds)
|
||||
$container.css({cursor: 'default'});
|
||||
|
||||
if (this.locked.close)
|
||||
$close.hide();
|
||||
|
||||
// ___ Superclass initialization
|
||||
this._init($container[0]);
|
||||
|
||||
if (this.$debug)
|
||||
this.$debug.css({zIndex: -1000});
|
||||
|
||||
// ___ Finish Up
|
||||
if (!this.locked.bounds)
|
||||
this.draggable();
|
||||
|
||||
// ___ Position
|
||||
if (!options.dontPush)
|
||||
this.snap(options.immediately);
|
||||
|
||||
this._inited = true;
|
||||
this.save();
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
// ----------
|
||||
InfoItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
|
||||
// ----------
|
||||
// Function: getStorageData
|
||||
// Returns all of the info worth storing about this item.
|
||||
getStorageData: function InfoItem_getStorageData() {
|
||||
var data = null;
|
||||
|
||||
try {
|
||||
data = {
|
||||
bounds: this.getBounds(),
|
||||
locked: Utils.copy(this.locked)
|
||||
};
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: save
|
||||
// Saves this item to persistent storage.
|
||||
save: function InfoItem_save() {
|
||||
try {
|
||||
if (!this._inited) // too soon to save now
|
||||
return;
|
||||
|
||||
var data = this.getStorageData();
|
||||
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: setBounds
|
||||
// Sets the bounds with the given <Rect>, animating unless "immediately" is false.
|
||||
setBounds: function InfoItem_setBounds(rect, immediately) {
|
||||
try {
|
||||
Utils.assertThrow(Utils.isRect(rect), 'InfoItem.setBounds: rect must be a real rectangle!');
|
||||
|
||||
// ___ Determine what has changed
|
||||
var css = {};
|
||||
|
||||
if (rect.left != this.bounds.left)
|
||||
css.left = rect.left;
|
||||
|
||||
if (rect.top != this.bounds.top)
|
||||
css.top = rect.top;
|
||||
|
||||
if (rect.width != this.bounds.width)
|
||||
css.width = rect.width;
|
||||
|
||||
if (rect.height != this.bounds.height)
|
||||
css.height = rect.height;
|
||||
|
||||
if (Utils.isEmptyObject(css))
|
||||
return;
|
||||
|
||||
this.bounds = new Rect(rect);
|
||||
Utils.assertThrow(Utils.isRect(this.bounds),
|
||||
'InfoItem.setBounds: this.bounds must be a real rectangle!');
|
||||
|
||||
// ___ Update our representation
|
||||
if (immediately) {
|
||||
iQ(this.container).css(css);
|
||||
} else {
|
||||
TabItems.pausePainting();
|
||||
iQ(this.container).animate(css, {
|
||||
duration: 350,
|
||||
easing: "tabviewBounce",
|
||||
complete: function() {
|
||||
TabItems.resumePainting();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this._updateDebugBounds();
|
||||
this.setTrenches(rect);
|
||||
this.save();
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: setZ
|
||||
// Set the Z order for the item's container.
|
||||
setZ: function InfoItem_setZ(value) {
|
||||
try {
|
||||
Utils.assertThrow(typeof value == 'number', 'value must be a number');
|
||||
|
||||
this.zIndex = value;
|
||||
|
||||
iQ(this.container).css({zIndex: value});
|
||||
|
||||
if (this.$debug)
|
||||
this.$debug.css({zIndex: value + 1});
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: close
|
||||
// Closes the item.
|
||||
close: function InfoItem_close() {
|
||||
try {
|
||||
this._sendToSubscribers("close");
|
||||
this.removeTrenches();
|
||||
iQ(this.container).fadeOut(function() {
|
||||
iQ(this).remove();
|
||||
Items.unsquish();
|
||||
});
|
||||
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: html
|
||||
// Sets the item's container's html to the specified value.
|
||||
html: function InfoItem_html(value) {
|
||||
try {
|
||||
Utils.assertThrow(typeof value == 'string', 'value must be a string');
|
||||
this.$contents.html(value);
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
}
|
||||
});
|
@ -52,8 +52,5 @@ XPCOMUtils.defineLazyGetter(this, "gPrivateBrowsing", function() {
|
||||
#include tabitems.js
|
||||
#include drag.js
|
||||
#include trench.js
|
||||
#include infoitems.js
|
||||
#include ui.js
|
||||
#include search.js
|
||||
|
||||
|
||||
|
@ -249,16 +249,19 @@ let UI = {
|
||||
// Resets the Panorama view to have just one group with all tabs
|
||||
// and, if firstTime == true, add the welcome video/tab
|
||||
reset: function UI_reset(firstTime) {
|
||||
let padding = 10;
|
||||
let infoWidth = 350;
|
||||
let infoHeight = 232;
|
||||
let padding = Trenches.defaultRadius;
|
||||
let welcomeWidth = 300;
|
||||
let pageBounds = Items.getPageBounds();
|
||||
pageBounds.inset(padding, padding);
|
||||
|
||||
let $actions = iQ("#actions");
|
||||
if ($actions)
|
||||
pageBounds.width -= $actions.width();
|
||||
|
||||
// ___ make a fresh groupItem
|
||||
let box = new Rect(pageBounds);
|
||||
box.width =
|
||||
Math.min(box.width * 0.667, pageBounds.width - (infoWidth + padding));
|
||||
box.width = Math.min(box.width * 0.667,
|
||||
pageBounds.width - (welcomeWidth + padding));
|
||||
box.height = box.height * 0.667;
|
||||
|
||||
GroupItems.groupItems.forEach(function(group) {
|
||||
@ -280,17 +283,18 @@ let UI = {
|
||||
if (firstTime) {
|
||||
gPrefBranch.setBoolPref("experienced_first_run", true);
|
||||
|
||||
// ___ make info item
|
||||
let video =
|
||||
"http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm";
|
||||
let html =
|
||||
"<div class='intro'>"
|
||||
+ "<video src='" + video + "' width='100%' preload controls>"
|
||||
+ "</div>";
|
||||
let infoBox = new Rect(box.right + padding, box.top,
|
||||
infoWidth, infoHeight);
|
||||
let infoItem = new InfoItem(infoBox);
|
||||
infoItem.html(html);
|
||||
let url = gPrefBranch.getCharPref("welcome_url");
|
||||
let newTab = gBrowser.loadOneTab(url, {inBackground: true});
|
||||
let newTabItem = newTab.tabItem;
|
||||
let parent = newTabItem.parent;
|
||||
Utils.assert(parent, "should have a parent");
|
||||
|
||||
newTabItem.parent.remove(newTabItem);
|
||||
let aspect = TabItems.tabHeight / TabItems.tabWidth;
|
||||
let welcomeBounds = new Rect(box.right + padding, box.top,
|
||||
welcomeWidth, welcomeWidth * aspect);
|
||||
newTabItem.setBounds(welcomeBounds, true);
|
||||
GroupItems.setActiveGroupItem(groupItem);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -33,26 +33,21 @@ function wait_for_install_dialog(aCallback) {
|
||||
info("Waiting for install dialog");
|
||||
Services.wm.addListener({
|
||||
onOpenWindow: function(aXULWindow) {
|
||||
info("Install dialog opened, waiting for load");
|
||||
info("Install dialog opened, waiting for focus");
|
||||
Services.wm.removeListener(this);
|
||||
|
||||
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowInternal);
|
||||
domwindow.addEventListener("load", function() {
|
||||
domwindow.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
waitForFocus(function() {
|
||||
info("Saw install dialog");
|
||||
is(domwindow.document.location.href, XPINSTALL_URL, "Should have seen the right window open");
|
||||
|
||||
// Allow other window load listeners to execute before passing to callback
|
||||
executeSoon(function() {
|
||||
info("Saw install dialog");
|
||||
// Override the countdown timer on the accept button
|
||||
var button = domwindow.document.documentElement.getButton("accept");
|
||||
button.disabled = false;
|
||||
// Override the countdown timer on the accept button
|
||||
var button = domwindow.document.documentElement.getButton("accept");
|
||||
button.disabled = false;
|
||||
|
||||
aCallback(domwindow);
|
||||
});
|
||||
}, false);
|
||||
aCallback(domwindow);
|
||||
}, domwindow);
|
||||
},
|
||||
|
||||
onCloseWindow: function(aXULWindow) {
|
||||
@ -597,7 +592,7 @@ var XPInstallObserver = {
|
||||
};
|
||||
|
||||
function test() {
|
||||
requestLongerTimeout(2);
|
||||
requestLongerTimeout(4);
|
||||
waitForExplicitFinish();
|
||||
|
||||
Services.prefs.setBoolPref("extensions.logging.enabled", true);
|
||||
|
@ -53,6 +53,7 @@ _BROWSER_FILES = \
|
||||
browser_tabview_bug594176.js \
|
||||
browser_tabview_bug595191.js \
|
||||
browser_tabview_bug595518.js \
|
||||
browser_tabview_bug595521.js \
|
||||
browser_tabview_bug595804.js \
|
||||
browser_tabview_bug595930.js \
|
||||
browser_tabview_bug595943.js \
|
||||
|
101
browser/base/content/test/tabview/browser_tabview_bug595521.js
Normal file
101
browser/base/content/test/tabview/browser_tabview_bug595521.js
Normal file
@ -0,0 +1,101 @@
|
||||
/* ***** 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 a test for bug 595521.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Raymond Lee <raymond@appcoast.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 ***** */
|
||||
|
||||
let fadeAwayUndoButtonDelay;
|
||||
let fadeAwayUndoButtonDuration;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("tabviewshown", testCloseLastGroup, false);
|
||||
TabView.toggle();
|
||||
}
|
||||
|
||||
function testCloseLastGroup() {
|
||||
window.removeEventListener("tabviewshown", testCloseLastGroup, false);
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
|
||||
is(contentWindow.GroupItems.groupItems.length, 1, "Has one group only");
|
||||
|
||||
let groupItem = contentWindow.GroupItems.groupItems[0];
|
||||
|
||||
let checkExistence = function() {
|
||||
is(contentWindow.GroupItems.groupItems.length, 1,
|
||||
"Still has one group after delay");
|
||||
|
||||
EventUtils.sendMouseEvent(
|
||||
{ type: "click" }, groupItem.$undoContainer[0], contentWindow);
|
||||
};
|
||||
|
||||
groupItem.addSubscriber(groupItem, "groupHidden", function() {
|
||||
groupItem.removeSubscriber(groupItem, "groupHidden");
|
||||
// it should still stay after 3 ms.
|
||||
setTimeout(checkExistence, 3);
|
||||
});
|
||||
|
||||
groupItem.addSubscriber(groupItem, "groupShown", function() {
|
||||
groupItem.removeSubscriber(groupItem, "groupShown");
|
||||
|
||||
let endGame = function() {
|
||||
window.removeEventListener("tabviewhidden", endGame, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
|
||||
groupItem.fadeAwayUndoButtonDelay = fadeAwayUndoButtonDelay;
|
||||
groupItem.fadeAwayUndoButtonDuration = fadeAwayUndoButtonDuration;
|
||||
|
||||
finish();
|
||||
};
|
||||
window.addEventListener("tabviewhidden", endGame, false);
|
||||
|
||||
TabView.toggle();
|
||||
});
|
||||
|
||||
let closeButton = groupItem.container.getElementsByClassName("close");
|
||||
ok(closeButton, "Group item close button exists");
|
||||
|
||||
// store the original values
|
||||
fadeAwayUndoButtonDelay = groupItem.fadeAwayUndoButtonDelay;
|
||||
fadeAwayUndoButtonDuration = groupItem.fadeAwayUndoButtonDuration;
|
||||
|
||||
// set both fade away delay and duration to 1ms
|
||||
groupItem.fadeAwayUndoButtonDelay = 1;
|
||||
groupItem.fadeAwayUndoButtonDuration = 1;
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" }, closeButton[0], contentWindow);
|
||||
}
|
@ -35,15 +35,8 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
let newWin;
|
||||
let prefService;
|
||||
|
||||
function test() {
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
prefService =
|
||||
Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).
|
||||
getBranch("browser.panorama.");
|
||||
// make sure we don't trigger the 'first run' behavior
|
||||
prefService.setBoolPref("experienced_first_run", true);
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
@ -104,7 +97,6 @@ function test() {
|
||||
is(contentWindow.GroupItems.getOrphanedTabs().length, 0, "No orphan tabs");
|
||||
|
||||
// clean up and finish
|
||||
prefService.setBoolPref("experienced_first_run", false);
|
||||
newWin.close();
|
||||
|
||||
finish();
|
||||
|
@ -44,8 +44,10 @@ function test() {
|
||||
|
||||
ok(!TabView.isVisible(), "Main window TabView is hidden");
|
||||
|
||||
ok(experienced(), "should start as experienced");
|
||||
|
||||
prefsBranch.setBoolPref("experienced_first_run", false);
|
||||
ok(!experienced(), "not experienced");
|
||||
ok(!experienced(), "set to not experienced");
|
||||
|
||||
newWindowWithTabView(checkFirstRun, part2);
|
||||
}
|
||||
@ -58,11 +60,14 @@ function experienced() {
|
||||
function checkFirstRun(win) {
|
||||
let contentWindow = win.document.getElementById("tab-view").contentWindow;
|
||||
|
||||
let infoItems = contentWindow.iQ(".info-item");
|
||||
is(infoItems.length, 1, "There should be an info item");
|
||||
|
||||
is(win.gBrowser.tabs.length, 2, "There should be two tabs");
|
||||
|
||||
let groupItems = contentWindow.GroupItems.groupItems;
|
||||
is(groupItems.length, 1, "There should be one group");
|
||||
is(groupItems[0].getChildren().length, 1, "...with one child");
|
||||
|
||||
let orphanTabCount = contentWindow.GroupItems.getOrphanedTabs().length;
|
||||
is(orphanTabCount, 1, "There should also be an orphaned tab");
|
||||
|
||||
ok(experienced(), "we're now experienced");
|
||||
}
|
||||
@ -74,12 +79,19 @@ function part2() {
|
||||
function checkNotFirstRun(win) {
|
||||
let contentWindow = win.document.getElementById("tab-view").contentWindow;
|
||||
|
||||
let infoItems = contentWindow.iQ(".info-item");
|
||||
is(infoItems.length, 0, "There should be no info items");
|
||||
is(win.gBrowser.tabs.length, 1, "There should be one tab");
|
||||
|
||||
let groupItems = contentWindow.GroupItems.groupItems;
|
||||
is(groupItems.length, 1, "There should be one group");
|
||||
is(groupItems[0].getChildren().length, 1, "...with one child");
|
||||
|
||||
let orphanTabCount = contentWindow.GroupItems.getOrphanedTabs().length;
|
||||
is(orphanTabCount, 0, "There should also be no orphaned tabs");
|
||||
}
|
||||
|
||||
function endGame() {
|
||||
ok(!TabView.isVisible(), "Main window TabView is still hidden");
|
||||
ok(experienced(), "should finish as experienced");
|
||||
finish();
|
||||
}
|
||||
|
||||
|
@ -55,13 +55,28 @@ function test() {
|
||||
function onTabViewLoadedAndShown() {
|
||||
window.removeEventListener("tabviewshown", onTabViewLoadedAndShown, false);
|
||||
|
||||
ok(TabView.isVisible(), "Tab View is visible. Count: " + tabViewShownCount);
|
||||
tabViewShownCount++;
|
||||
// Evidently sometimes isVisible (which is based on the selectedIndex of the
|
||||
// tabview deck) isn't updated immediately when called from button.doCommand,
|
||||
// so we add a little timeout here to get outside of the doCommand call.
|
||||
// If the initial timeout isn't enough, we keep waiting in case it's taking
|
||||
// longer than expected.
|
||||
// See bug 594909.
|
||||
let deck = document.getElementById("tab-view-deck");
|
||||
function waitForSwitch() {
|
||||
if (deck.selectedIndex == 1) {
|
||||
ok(TabView.isVisible(), "Tab View is visible. Count: " + tabViewShownCount);
|
||||
tabViewShownCount++;
|
||||
|
||||
// kick off the series
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
TabView.toggle();
|
||||
} else {
|
||||
setTimeout(waitForSwitch, 10);
|
||||
}
|
||||
}
|
||||
|
||||
// kick off the series
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
TabView.toggle();
|
||||
setTimeout(waitForSwitch, 1);
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
@ -161,7 +161,7 @@
|
||||
pasteAndGo.setAttribute("label", label);
|
||||
pasteAndGo.setAttribute("anonid", "paste-and-go");
|
||||
pasteAndGo.setAttribute("oncommand",
|
||||
"gURLBar.value = ''; goDoCommand('cmd_paste'); gURLBar.handleCommand();");
|
||||
"gURLBar.select(); goDoCommand('cmd_paste'); gURLBar.handleCommand();");
|
||||
cxmenu.insertBefore(pasteAndGo, insertLocation.nextSibling);
|
||||
}
|
||||
]]></constructor>
|
||||
@ -272,8 +272,13 @@
|
||||
if (aTriggeringEvent instanceof MouseEvent) {
|
||||
// We have a mouse event (from the go button), so use the standard
|
||||
// UI link behaviors
|
||||
openUILink(url, aTriggeringEvent, false, false,
|
||||
true /* allow third party fixup */, postData);
|
||||
let where = whereToOpenLink(aTriggeringEvent, false, false);
|
||||
if (where != "current") {
|
||||
this.handleRevert();
|
||||
content.focus();
|
||||
}
|
||||
openUILinkIn(url, where,
|
||||
{ allowThirdPartyFixup: true, postData: postData });
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -412,9 +412,8 @@ function isBidiEnabled() {
|
||||
function openAboutDialog() {
|
||||
var enumerator = Services.wm.getEnumerator("Browser:About");
|
||||
while (enumerator.hasMoreElements()) {
|
||||
// Only open one about window (Bug 599573)
|
||||
let win = enumerator.getNext();
|
||||
if (win.opener != window)
|
||||
continue;
|
||||
win.focus();
|
||||
return;
|
||||
}
|
||||
@ -486,107 +485,12 @@ function openFeedbackPage()
|
||||
openUILinkIn("http://input.mozilla.com/feedback", "tab");
|
||||
}
|
||||
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
/**
|
||||
* Opens the update manager and checks for updates to the application.
|
||||
*/
|
||||
function checkForUpdates()
|
||||
{
|
||||
var um =
|
||||
Components.classes["@mozilla.org/updates/update-manager;1"].
|
||||
getService(Components.interfaces.nsIUpdateManager);
|
||||
var prompter =
|
||||
Components.classes["@mozilla.org/updates/update-prompt;1"].
|
||||
createInstance(Components.interfaces.nsIUpdatePrompt);
|
||||
|
||||
// If there's an update ready to be applied, show the "Update Downloaded"
|
||||
// UI instead and let the user know they have to restart the browser for
|
||||
// the changes to be applied.
|
||||
if (um.activeUpdate && um.activeUpdate.state == "pending")
|
||||
prompter.showUpdateDownloaded(um.activeUpdate);
|
||||
else
|
||||
prompter.checkForUpdates();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
/**
|
||||
* Updates an element to reflect the state of available update services.
|
||||
*/
|
||||
function setupCheckForUpdates(checkForUpdates, aStringBundle)
|
||||
{
|
||||
var updates =
|
||||
Components.classes["@mozilla.org/updates/update-service;1"].
|
||||
getService(Components.interfaces.nsIApplicationUpdateService);
|
||||
var um =
|
||||
Components.classes["@mozilla.org/updates/update-manager;1"].
|
||||
getService(Components.interfaces.nsIUpdateManager);
|
||||
|
||||
// Disable the UI if the update enabled pref has been locked by the
|
||||
// administrator or if we cannot update for some other reason
|
||||
var canCheckForUpdates = updates.canCheckForUpdates;
|
||||
checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
|
||||
if (!canCheckForUpdates)
|
||||
return;
|
||||
|
||||
var activeUpdate = um.activeUpdate;
|
||||
|
||||
// If there's an active update, substitute its name into the label
|
||||
// we show for this item, otherwise display a generic label.
|
||||
function getStringWithUpdateName(key) {
|
||||
if (activeUpdate && activeUpdate.name)
|
||||
return aStringBundle.formatStringFromName(key, [activeUpdate.name], 1);
|
||||
return aStringBundle.GetStringFromName(key + "Fallback");
|
||||
}
|
||||
|
||||
// By default, show "Check for Updates..."
|
||||
var key = "default";
|
||||
if (activeUpdate) {
|
||||
switch (activeUpdate.state) {
|
||||
case "downloading":
|
||||
// If we're downloading an update at present, show the text:
|
||||
// "Downloading Firefox x.x..." otherwise we're paused, and show
|
||||
// "Resume Downloading Firefox x.x..."
|
||||
key = updates.isDownloading ? "downloading" : "resume";
|
||||
break;
|
||||
case "pending":
|
||||
// If we're waiting for the user to restart, show: "Apply Downloaded
|
||||
// Updates Now..."
|
||||
key = "pending";
|
||||
break;
|
||||
}
|
||||
}
|
||||
checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
|
||||
checkForUpdates.accessKey = aStringBundle.
|
||||
GetStringFromName("updatesItem_" + key + ".accesskey");
|
||||
if (um.activeUpdate && updates.isDownloading)
|
||||
checkForUpdates.setAttribute("loading", "true");
|
||||
else
|
||||
checkForUpdates.removeAttribute("loading");
|
||||
}
|
||||
#endif
|
||||
|
||||
function buildHelpMenu()
|
||||
{
|
||||
// Enable/disable the "Report Web Forgery" menu item. safebrowsing object
|
||||
// may not exist in OSX
|
||||
if (typeof safebrowsing != "undefined")
|
||||
safebrowsing.setReportPhishingMenu();
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_UPDATER
|
||||
var checkForUpdates = document.getElementById("checkForUpdates");
|
||||
var browserBundle = document.getElementById("bundle_browser").stringBundle;
|
||||
setupCheckForUpdates(checkForUpdates, browserBundle);
|
||||
#else
|
||||
// Needed by safebrowsing for inserting its menuitem so just hide it
|
||||
document.getElementById("updateSeparator").hidden = true;
|
||||
#endif
|
||||
#else
|
||||
// Needed by safebrowsing for inserting its menuitem so just hide it
|
||||
document.getElementById("updateSeparator").hidden = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
function isElementVisible(aElement)
|
||||
|
@ -1,5 +1,6 @@
|
||||
pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/");
|
||||
pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/");
|
||||
pref("browser.panorama.welcome_url", "http://www.mozilla.com/firefox/panorama/");
|
||||
// The time interval between checks for a new version (in seconds)
|
||||
// nightly=8 hours, official=24 hours
|
||||
pref("app.update.interval", 28800);
|
||||
|
@ -1,5 +1,6 @@
|
||||
pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/");
|
||||
pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/");
|
||||
pref("browser.panorama.welcome_url", "http://www.mozilla.com/firefox/panorama/");
|
||||
// The time interval between checks for a new version (in seconds)
|
||||
// nightly=8 hours, official=24 hours
|
||||
pref("app.update.interval", 28800);
|
||||
|
@ -499,10 +499,10 @@ PlacesViewBase.prototype = {
|
||||
// Many users consider toolbars as shortcuts containers, so explicitly
|
||||
// allow empty labels on toolbarbuttons. For any other element try to be
|
||||
// smarter, guessing a title from the uri.
|
||||
elt.label = PlacesUIUtils.getBestTitle(aPlacesNode);
|
||||
elt.setAttribute("label", PlacesUIUtils.getBestTitle(aPlacesNode));
|
||||
}
|
||||
else {
|
||||
elt.label = aNewTitle;
|
||||
elt.setAttribute("label", aNewTitle);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -291,8 +291,8 @@ var bookmarksObserver = {
|
||||
}
|
||||
else {
|
||||
if (!aNewValue && aElementOrTreeIndex.localName != "toolbarbutton")
|
||||
return aElementOrTreeIndex.label == PlacesUIUtils.getBestTitle(aElementOrTreeIndex._placesNode);
|
||||
return aElementOrTreeIndex.label == aNewValue;
|
||||
return aElementOrTreeIndex.getAttribute("label") == PlacesUIUtils.getBestTitle(aElementOrTreeIndex._placesNode);
|
||||
return aElementOrTreeIndex.getAttribute("label") == aNewValue;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -469,8 +469,10 @@ PrivateBrowsingService.prototype = {
|
||||
if (aCmdLine.handleFlag("private", false))
|
||||
; // It has already been handled
|
||||
else if (aCmdLine.handleFlag("private-toggle", false)) {
|
||||
if (this._autoStarted) {
|
||||
throw Cr.NS_ERROR_ABORT;
|
||||
}
|
||||
this.privateBrowsingEnabled = !this.privateBrowsingEnabled;
|
||||
this._autoStarted = false;
|
||||
this._lastChangedByCommandLine = true;
|
||||
}
|
||||
},
|
||||
|
@ -52,14 +52,14 @@
|
||||
<menuitem id="menu_HelpPopup_reportPhishingtoolmenu"
|
||||
label="&reportPhishSiteMenu.title2;"
|
||||
accesskey="&reportPhishSiteMenu.accesskey;"
|
||||
insertbefore="updateSeparator"
|
||||
insertbefore="aboutSeparator"
|
||||
observes="reportPhishingBroadcaster"
|
||||
oncommand="openUILink(safebrowsing.getReportURL('Phish'), event);"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="menu_HelpPopup_reportPhishingErrortoolmenu"
|
||||
label="&safeb.palm.notforgery.label2;"
|
||||
accesskey="&reportPhishSiteMenu.accesskey;"
|
||||
insertbefore="updateSeparator"
|
||||
insertbefore="aboutSeparator"
|
||||
observes="reportPhishingErrorBroadcaster"
|
||||
oncommand="openUILinkIn(safebrowsing.getReportURL('Error'), 'tab');"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
|
@ -605,7 +605,7 @@
|
||||
element.setAttribute("label", label);
|
||||
element.setAttribute("anonid", "paste-and-search");
|
||||
element.setAttribute("oncommand",
|
||||
"BrowserSearch.searchBar.value = ''; goDoCommand('cmd_paste'); BrowserSearch.searchBar.handleSearchCommand();");
|
||||
"BrowserSearch.searchBar.select(); goDoCommand('cmd_paste'); BrowserSearch.searchBar.handleSearchCommand();");
|
||||
cxmenu.insertBefore(element, insertLocation.nextSibling);
|
||||
pasteAndSearch = element;
|
||||
}
|
||||
|
@ -213,6 +213,7 @@
|
||||
@BINPATH@/components/necko_strconv.xpt
|
||||
@BINPATH@/components/necko_viewsource.xpt
|
||||
@BINPATH@/components/necko_wifi.xpt
|
||||
@BINPATH@/components/necko_wyciwyg.xpt
|
||||
@BINPATH@/components/necko.xpt
|
||||
@BINPATH@/components/loginmgr.xpt
|
||||
@BINPATH@/components/parentalcontrols.xpt
|
||||
|
@ -2,6 +2,7 @@ af
|
||||
ak
|
||||
ar
|
||||
as
|
||||
ast
|
||||
be
|
||||
bg
|
||||
bn-BD
|
||||
@ -18,6 +19,7 @@ en-GB
|
||||
en-ZA
|
||||
eo
|
||||
es-AR
|
||||
es-CL
|
||||
es-ES
|
||||
es-MX
|
||||
et
|
||||
@ -27,6 +29,7 @@ fi
|
||||
fr
|
||||
fy-NL
|
||||
ga-IE
|
||||
gd
|
||||
gl
|
||||
gu-IN
|
||||
he
|
||||
@ -40,12 +43,14 @@ it
|
||||
ja
|
||||
ja-JP-mac
|
||||
ka
|
||||
km
|
||||
kn
|
||||
ko
|
||||
ku
|
||||
lg
|
||||
lt
|
||||
lv
|
||||
mai
|
||||
mk
|
||||
ml
|
||||
mn
|
||||
@ -71,6 +76,7 @@ sq
|
||||
sr
|
||||
sv-SE
|
||||
ta
|
||||
ta-LK
|
||||
te
|
||||
th
|
||||
tr
|
||||
|
@ -71,7 +71,7 @@ can reach it easily. -->
|
||||
<!ENTITY personalbarCmd.accesskey "B">
|
||||
<!ENTITY bookmarksToolbarItem.label "Bookmarks Toolbar Items">
|
||||
<!ENTITY addonBarCmd.label "Add-on Bar">
|
||||
<!ENTITY addonBarCmd.accesskey "B">
|
||||
<!ENTITY addonBarCmd.accesskey "A">
|
||||
|
||||
<!ENTITY pageSourceCmd.label "Page Source">
|
||||
<!ENTITY pageSourceCmd.accesskey "o">
|
||||
|
@ -17,10 +17,12 @@ eo
|
||||
es-AR
|
||||
es-ES
|
||||
et
|
||||
eu
|
||||
fi
|
||||
fr
|
||||
fy-NL
|
||||
ga-IE
|
||||
gd
|
||||
he
|
||||
hu
|
||||
hy-AM
|
||||
@ -34,6 +36,7 @@ ku
|
||||
lg
|
||||
lt
|
||||
lv
|
||||
mk
|
||||
nb-NO
|
||||
nl
|
||||
nn-NO
|
||||
@ -42,6 +45,7 @@ pa-IN
|
||||
pl
|
||||
pt-BR
|
||||
pt-PT
|
||||
rm
|
||||
ro
|
||||
ru
|
||||
sk
|
||||
|
@ -233,7 +233,7 @@ menuitem.bookmark-item {
|
||||
}
|
||||
|
||||
/* Stock icons for the menu bar items */
|
||||
menuitem:not([type]) {
|
||||
menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip) {
|
||||
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
|
||||
}
|
||||
|
||||
@ -472,6 +472,13 @@ menuitem:not([type]) {
|
||||
-moz-image-region: rect(0px 48px 16px 32px);
|
||||
}
|
||||
|
||||
#subscribeToPageMenuitem:not([disabled]),
|
||||
#subscribeToPageMenupopup,
|
||||
#BMB_subscribeToPageMenuitem:not([disabled]),
|
||||
#BMB_subscribeToPageMenupopup {
|
||||
list-style-image: url("chrome://browser/skin/page-livemarks.png");
|
||||
}
|
||||
|
||||
#bookmarksToolbarFolderMenu,
|
||||
#BMB_bookmarksToolbar {
|
||||
list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png");
|
||||
|
@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
#sanitizeEverythingWarningIcon {
|
||||
list-style-image: url("chrome://global/skin/icons/warning-large.png");
|
||||
list-style-image: url("moz-icon://stock/gtk-dialog-warning?size=dialog");
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -14,11 +14,11 @@
|
||||
}
|
||||
|
||||
.statusIcon[status="error"] {
|
||||
list-style-image: url("chrome://global/skin/icons/error-16.png");
|
||||
list-style-image: url("moz-icon://stock/gtk-dialog-error?size=menu");
|
||||
}
|
||||
|
||||
.statusIcon[status="success"] {
|
||||
list-style-image: url("chrome://global/skin/icons/information-16.png");
|
||||
list-style-image: url("moz-icon://stock/gtk-dialog-info?size=menu");
|
||||
}
|
||||
|
||||
/* .data is only used by syncGenericChange.xul, but it seems unnecessary to have
|
||||
|
@ -1937,7 +1937,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||
}
|
||||
|
||||
#notification-popup {
|
||||
color: #fff;
|
||||
margin-left: -16px;
|
||||
margin-right: -16px;
|
||||
}
|
||||
|
@ -302,14 +302,6 @@
|
||||
list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric-16.png");
|
||||
}
|
||||
|
||||
#BMB_subscribeToPage:not([disabled]),
|
||||
#BMB_subscribeToPageMenu,
|
||||
#appmenu_subscribeToPage:not([disabled]),
|
||||
#appmenu_subscribeToPageMenu {
|
||||
list-style-image: url("chrome://browser/skin/feeds/feed-icons-16.png");
|
||||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
}
|
||||
|
||||
#BMB_bookmarkThisPage,
|
||||
#appmenu_bookmarkThisPage {
|
||||
list-style-image: url("chrome://browser/skin/places/bookmark.png");
|
||||
@ -1872,7 +1864,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
||||
}
|
||||
|
||||
.geolocation-text-link {
|
||||
padding-top: 5px;
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="xpinstall-disabled"],
|
||||
@ -1936,6 +1928,15 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
||||
}
|
||||
|
||||
/* Bookmarks roots menu-items */
|
||||
#appmenu_subscribeToPage:not([disabled]),
|
||||
#appmenu_subscribeToPageMenu,
|
||||
#subscribeToPageMenuitem:not([disabled]),
|
||||
#subscribeToPageMenupopup,
|
||||
#BMB_subscribeToPageMenuitem:not([disabled]),
|
||||
#BMB_subscribeToPageMenupopup {
|
||||
list-style-image: url("chrome://browser/skin/feeds/feedIcon16.png");
|
||||
}
|
||||
|
||||
#bookmarksToolbarFolderMenu,
|
||||
#appmenu_bookmarksToolbar,
|
||||
#BMB_bookmarksToolbar {
|
||||
|
@ -360,6 +360,7 @@ user_pref("network.http.prompt-temp-redirect", false);
|
||||
user_pref("media.cache_size", 100);
|
||||
user_pref("security.warn_viewing_mixed", false);
|
||||
user_pref("app.update.enabled", false);
|
||||
user_pref("browser.panorama.experienced_first_run", true); // Assume experienced
|
||||
|
||||
// Only load extensions from the application and user profile
|
||||
// AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
|
||||
|
@ -65,4 +65,7 @@
|
||||
<uses-permission android:name="android.permission.SET_TIME"></uses-permission>
|
||||
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.SET_TIME_ZONE"></uses-permission>
|
||||
|
||||
</manifest>
|
@ -51,6 +51,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.net.UnknownHostException;
|
||||
@ -59,9 +60,12 @@ import java.security.NoSuchAlgorithmException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
import java.util.Timer;
|
||||
import java.util.zip.Adler32;
|
||||
@ -87,6 +91,7 @@ import com.mozilla.SUTAgentAndroid.SUTAgentAndroid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlarmManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
@ -95,12 +100,14 @@ import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Debug;
|
||||
import android.os.Environment;
|
||||
import android.os.StatFs;
|
||||
import android.os.SystemClock;
|
||||
import android.provider.Settings;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
@ -118,13 +125,13 @@ public class DoCommand {
|
||||
String currentDir = "/";
|
||||
String sErrorPrefix = "##AGENT-WARNING## ";
|
||||
|
||||
private final String prgVersion = "SUTAgentAndroid Version 0.85";
|
||||
private final String prgVersion = "SUTAgentAndroid Version 0.87";
|
||||
|
||||
public enum Command
|
||||
{
|
||||
RUN ("run"),
|
||||
EXEC ("exec"),
|
||||
ARUN ("arun"),
|
||||
ENVRUN ("envrun"),
|
||||
KILL ("kill"),
|
||||
PS ("ps"),
|
||||
DEVINFO ("info"),
|
||||
@ -173,6 +180,8 @@ public class DoCommand {
|
||||
UNINST ("uninst"),
|
||||
TEST ("test"),
|
||||
VER ("ver"),
|
||||
TZGET ("tzget"),
|
||||
TZSET ("tzset"),
|
||||
UNKNOWN ("unknown");
|
||||
|
||||
private final String theCmd;
|
||||
@ -207,7 +216,7 @@ public class DoCommand {
|
||||
Command cCmd = null;
|
||||
Command cSubCmd = null;
|
||||
|
||||
String [] Argv = parseCmdLine(theCmdLine);
|
||||
String [] Argv = parseCmdLine2(theCmdLine);
|
||||
|
||||
int Argc = Argv.length;
|
||||
|
||||
@ -223,6 +232,17 @@ public class DoCommand {
|
||||
strReturn = GetClok();
|
||||
break;
|
||||
|
||||
case TZGET:
|
||||
strReturn = GetTimeZone();
|
||||
break;
|
||||
|
||||
case TZSET:
|
||||
if (Argc == 2)
|
||||
strReturn = SetTimeZone(Argv[1]);
|
||||
else
|
||||
strReturn = sErrorPrefix + "Wrong number of arguments for settz command!";
|
||||
break;
|
||||
|
||||
case UPDT:
|
||||
strReturn = StartUpdateOMatic(Argv[1], Argv[2]);
|
||||
break;
|
||||
@ -327,16 +347,6 @@ public class DoCommand {
|
||||
break;
|
||||
|
||||
case REBT:
|
||||
// try {
|
||||
// reboot(null);
|
||||
// Power.reboot(null);
|
||||
// Power.shutdown();
|
||||
// }
|
||||
// catch (IOException e)
|
||||
// {
|
||||
// TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
RunReboot(cmdOut);
|
||||
break;
|
||||
|
||||
@ -497,6 +507,25 @@ public class DoCommand {
|
||||
|
||||
case TEST:
|
||||
// boolean bRet = false;
|
||||
/*
|
||||
Configuration userConfig = new Configuration();
|
||||
Settings.System.getConfiguration( contextWrapper.getContentResolver(), userConfig );
|
||||
Calendar cal = Calendar.getInstance( userConfig.locale);
|
||||
TimeZone ctz = cal.getTimeZone();
|
||||
String sctzLongName = ctz.getDisplayName();
|
||||
String pstzName = TimeZone.getDefault().getDisplayName();
|
||||
*/
|
||||
String sTimeZoneName = GetTimeZone();
|
||||
|
||||
TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
|
||||
TimeZone tz2 = TimeZone.getTimeZone("GMT-08:00");
|
||||
int nOffset = (-8 * 3600000);
|
||||
String [] zoneNames = TimeZone.getAvailableIDs(nOffset);
|
||||
int nNumMatches = zoneNames.length;
|
||||
TimeZone.setDefault(tz);
|
||||
|
||||
String sOldTZ = System.setProperty("persist.sys.timezone", "America/Los_Angeles");
|
||||
|
||||
/*
|
||||
byte[] buffer = new byte [4096];
|
||||
int nRead = 0;
|
||||
@ -591,7 +620,7 @@ public class DoCommand {
|
||||
}
|
||||
*/
|
||||
// strReturn = InstallApplication();
|
||||
strReturn = InstallApp(Argv[1], cmdOut);
|
||||
// strReturn = InstallApp(Argv[1], cmdOut);
|
||||
|
||||
// strReturn = UninstallApplication();
|
||||
// String sPingCheck = SendPing("www.mozilla.org",null);
|
||||
@ -653,6 +682,24 @@ public class DoCommand {
|
||||
*/
|
||||
break;
|
||||
|
||||
case ENVRUN:
|
||||
if (Argc >= 2)
|
||||
{
|
||||
String [] theArgs = new String [Argc - 1];
|
||||
|
||||
for (int lcv = 1; lcv < Argc; lcv++)
|
||||
{
|
||||
theArgs[lcv - 1] = Argv[lcv];
|
||||
}
|
||||
|
||||
strReturn = StartPrg2(theArgs, cmdOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
|
||||
}
|
||||
break;
|
||||
|
||||
case EXEC:
|
||||
case RUN:
|
||||
if (Argc >= 2)
|
||||
@ -828,12 +875,28 @@ public class DoCommand {
|
||||
}
|
||||
}
|
||||
|
||||
public String [] parseCmdLine(String theCmdLine) {
|
||||
public String [] parseCmdLine2(String theCmdLine)
|
||||
{
|
||||
String cmdString;
|
||||
String workingString;
|
||||
String workingString2;
|
||||
String workingString3;
|
||||
List<String> lst = new ArrayList<String>();
|
||||
int nLength = theCmdLine.length();
|
||||
int nFirstSpace = theCmdLine.indexOf(' ');
|
||||
int nLength = 0;
|
||||
int nFirstSpace = -1;
|
||||
|
||||
// Null cmd line
|
||||
if (theCmdLine == null)
|
||||
{
|
||||
String [] theArgs = new String [1];
|
||||
theArgs[0] = new String("");
|
||||
return(theArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
nLength = theCmdLine.length();
|
||||
nFirstSpace = theCmdLine.indexOf(' ');
|
||||
}
|
||||
|
||||
if (nFirstSpace == -1)
|
||||
{
|
||||
@ -843,7 +906,134 @@ public class DoCommand {
|
||||
}
|
||||
|
||||
// Get the command
|
||||
lst.add(new String(theCmdLine.substring(0, nFirstSpace)));
|
||||
cmdString = new String(theCmdLine.substring(0, nFirstSpace));
|
||||
lst.add(cmdString);
|
||||
|
||||
// Jump past the command and trim
|
||||
workingString = (theCmdLine.substring(nFirstSpace + 1, nLength)).trim();
|
||||
|
||||
while ((nLength = workingString.length()) > 0)
|
||||
{
|
||||
int nEnd = 0;
|
||||
int nStart = 0;
|
||||
|
||||
// if we have a quote
|
||||
if (workingString.startsWith("\""))
|
||||
{
|
||||
// point to the first non quote char
|
||||
nStart = 1;
|
||||
// find the matching quote
|
||||
nEnd = workingString.indexOf('"', nStart);
|
||||
|
||||
char prevChar;
|
||||
|
||||
while(nEnd != -1)
|
||||
{
|
||||
// check to see if the quotation mark has been escaped
|
||||
prevChar = workingString.charAt(nEnd - 1);
|
||||
if (prevChar == '\\')
|
||||
{
|
||||
// if escaped, point past this quotation mark and find the next
|
||||
nEnd++;
|
||||
if (nEnd < nLength)
|
||||
nEnd = workingString.indexOf('"', nEnd);
|
||||
else
|
||||
nEnd = -1;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
// there isn't one
|
||||
if (nEnd == -1)
|
||||
{
|
||||
// point at the quote
|
||||
nStart = 0;
|
||||
// so find the next space
|
||||
nEnd = workingString.indexOf(' ', nStart);
|
||||
// there isn't one of those either
|
||||
if (nEnd == -1)
|
||||
nEnd = nLength; // Just grab the rest of the cmdline
|
||||
}
|
||||
}
|
||||
else // no quote so find the next space
|
||||
{
|
||||
nEnd = workingString.indexOf(' ', nStart);
|
||||
// there isn't one of those
|
||||
if (nEnd == -1)
|
||||
nEnd = nLength; // Just grab the rest of the cmdline
|
||||
}
|
||||
|
||||
// get the substring
|
||||
workingString2 = workingString.substring(nStart, nEnd);
|
||||
|
||||
// if we have escaped quotes
|
||||
if (workingString2.contains("\\\""))
|
||||
{
|
||||
do
|
||||
{
|
||||
// replace escaped quote with embedded quote
|
||||
workingString3 = workingString2.replace("\\\"", "\"");
|
||||
workingString2 = workingString3;
|
||||
}
|
||||
while(workingString2.contains("\\\""));
|
||||
}
|
||||
|
||||
// add it to the list
|
||||
lst.add(new String(workingString2));
|
||||
|
||||
// if we are dealing with a quote
|
||||
if (nStart > 0)
|
||||
nEnd++; // point past the end one
|
||||
|
||||
// jump past the substring and trim it
|
||||
workingString = (workingString.substring(nEnd)).trim();
|
||||
}
|
||||
|
||||
// ok we're done package up the results
|
||||
int nItems = lst.size();
|
||||
|
||||
String [] theArgs = new String [nItems];
|
||||
|
||||
for (int lcv = 0; lcv < nItems; lcv++)
|
||||
{
|
||||
theArgs[lcv] = lst.get(lcv);
|
||||
}
|
||||
|
||||
return(theArgs);
|
||||
}
|
||||
|
||||
public String [] parseCmdLine(String theCmdLine) {
|
||||
String cmdString;
|
||||
String workingString;
|
||||
String workingString2;
|
||||
List<String> lst = new ArrayList<String>();
|
||||
int nLength = 0;
|
||||
int nFirstSpace = -1;
|
||||
|
||||
// Null cmd line
|
||||
if (theCmdLine == null)
|
||||
{
|
||||
String [] theArgs = new String [1];
|
||||
theArgs[0] = new String("");
|
||||
return(theArgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
nLength = theCmdLine.length();
|
||||
nFirstSpace = theCmdLine.indexOf(' ');
|
||||
}
|
||||
|
||||
if (nFirstSpace == -1)
|
||||
{
|
||||
String [] theArgs = new String [1];
|
||||
theArgs[0] = new String(theCmdLine);
|
||||
return(theArgs);
|
||||
}
|
||||
|
||||
// Get the command
|
||||
cmdString = new String(theCmdLine.substring(0, nFirstSpace));
|
||||
lst.add(cmdString);
|
||||
|
||||
// Jump past the command and trim
|
||||
workingString = (theCmdLine.substring(nFirstSpace + 1, nLength)).trim();
|
||||
@ -871,6 +1061,11 @@ public class DoCommand {
|
||||
if (nEnd == -1)
|
||||
nEnd = nLength; // Just grab the rest of the cmdline
|
||||
}
|
||||
else
|
||||
{
|
||||
nStart = 0;
|
||||
nEnd++;
|
||||
}
|
||||
}
|
||||
else // no quote so find the next space
|
||||
{
|
||||
@ -887,8 +1082,8 @@ public class DoCommand {
|
||||
lst.add(new String(workingString2));
|
||||
|
||||
// if we are dealing with a quote
|
||||
if (nStart > 0)
|
||||
nEnd++; // point past the end one
|
||||
// if (nStart > 0)
|
||||
// nEnd++; // point past the end one
|
||||
|
||||
// jump past the substring and trim it
|
||||
workingString = (workingString.substring(nEnd)).trim();
|
||||
@ -1116,7 +1311,6 @@ public class DoCommand {
|
||||
public String StatProcess(String string)
|
||||
{
|
||||
String sRet = "";
|
||||
// ActivityManager aMgr = (ActivityManager) SUTAgentAndroid.me.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
int [] nPids = new int [1];
|
||||
|
||||
@ -1160,7 +1354,6 @@ public class DoCommand {
|
||||
public String GetAppRoot(String AppName)
|
||||
{
|
||||
String sRet = "";
|
||||
// Context ctx = SUTAgentAndroid.me.getApplicationContext();
|
||||
Context ctx = contextWrapper.getApplicationContext();
|
||||
|
||||
if (ctx != null)
|
||||
@ -1234,8 +1427,8 @@ public class DoCommand {
|
||||
try {
|
||||
digest = java.security.MessageDigest.getInstance("MD5");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
// TODO Auto-generated catch block
|
||||
catch (NoSuchAlgorithmException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -1420,12 +1613,10 @@ public class DoCommand {
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -1534,12 +1725,6 @@ public class DoCommand {
|
||||
@SuppressWarnings("unused")
|
||||
boolean bRet = ftp.completePendingCommand();
|
||||
outStream.flush();
|
||||
/*
|
||||
if (ftp.retrieveFile("pub/mozilla.org/firefox/releases/3.6b4/wince-arm/en-US/firefox-3.6b4.cab", outStream))
|
||||
{
|
||||
outStream.flush();
|
||||
}
|
||||
*/
|
||||
outStream.close();
|
||||
strRet = ftp.getReplyString();
|
||||
reply = ftp.getReplyCode();
|
||||
@ -1564,7 +1749,6 @@ public class DoCommand {
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
sRet = e.getMessage();
|
||||
strRet = ftp.getReplyString();
|
||||
reply = ftp.getReplyCode();
|
||||
@ -1573,7 +1757,6 @@ public class DoCommand {
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
sRet = e.getMessage();
|
||||
strRet = ftp.getReplyString();
|
||||
reply = ftp.getReplyCode();
|
||||
@ -1652,7 +1835,6 @@ public class DoCommand {
|
||||
theArgs[2] = "kill";
|
||||
|
||||
String sRet = sErrorPrefix + "Unable to kill " + sProcName + "\n";
|
||||
// ActivityManager aMgr = (ActivityManager) SUTAgentAndroid.me.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
List <ActivityManager.RunningAppProcessInfo> lProcesses = aMgr.getRunningAppProcesses();
|
||||
int lcv = 0;
|
||||
@ -1661,7 +1843,6 @@ public class DoCommand {
|
||||
|
||||
for (lcv = 0; lcv < lProcesses.size(); lcv++)
|
||||
{
|
||||
// if (lProcesses.get(lcv).processName.contentEquals(sProcName))
|
||||
if (lProcesses.get(lcv).processName.contains(sProcName))
|
||||
{
|
||||
strProcName = lProcesses.get(lcv).processName;
|
||||
@ -1684,12 +1865,9 @@ public class DoCommand {
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// SUTAgentAndroid.me.finishActivity(SUTAgentAndroid.START_PRG);
|
||||
|
||||
// Give the messages a chance to be processed
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
@ -1698,7 +1876,6 @@ public class DoCommand {
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
// aMgr.restartPackage(strProcName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1709,7 +1886,6 @@ public class DoCommand {
|
||||
lProcesses = aMgr.getRunningAppProcesses();
|
||||
for (lcv = 0; lcv < lProcesses.size(); lcv++)
|
||||
{
|
||||
// if (lProcesses.get(lcv).processName.contentEquals(sProcName))
|
||||
if (lProcesses.get(lcv).processName.contains(sProcName))
|
||||
{
|
||||
sRet = sErrorPrefix + "Unable to kill " + nPID + " " + strProcName + "\n";
|
||||
@ -1724,12 +1900,9 @@ public class DoCommand {
|
||||
public boolean IsProcessDead(String sProcName)
|
||||
{
|
||||
boolean bRet = false;
|
||||
// ActivityManager aMgr = (ActivityManager) SUTAgentAndroid.me.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
List <ActivityManager.ProcessErrorStateInfo> lProcesses = aMgr.getProcessesInErrorState();
|
||||
int lcv = 0;
|
||||
// String strProcName = "";
|
||||
// int nPID = 0;
|
||||
|
||||
if (lProcesses != null)
|
||||
{
|
||||
@ -1738,8 +1911,6 @@ public class DoCommand {
|
||||
if (lProcesses.get(lcv).processName.contentEquals(sProcName) &&
|
||||
lProcesses.get(lcv).condition != ActivityManager.ProcessErrorStateInfo.NO_ERROR)
|
||||
{
|
||||
// strProcName = lProcesses.get(lcv).processName;
|
||||
// nPID = lProcesses.get(lcv).pid;
|
||||
bRet = true;
|
||||
break;
|
||||
}
|
||||
@ -1752,7 +1923,6 @@ public class DoCommand {
|
||||
public String GetProcessInfo()
|
||||
{
|
||||
String sRet = "";
|
||||
// ActivityManager aMgr = (ActivityManager) SUTAgentAndroid.me.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
List <ActivityManager.RunningAppProcessInfo> lProcesses = aMgr.getRunningAppProcesses();
|
||||
int nProcs = lProcesses.size();
|
||||
@ -1817,12 +1987,10 @@ public class DoCommand {
|
||||
|
||||
public long GetMemoryConfig()
|
||||
{
|
||||
// ActivityManager aMgr = (ActivityManager) SUTAgentAndroid.me.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
|
||||
ActivityManager.MemoryInfo outInfo = new ActivityManager.MemoryInfo();
|
||||
aMgr.getMemoryInfo(outInfo);
|
||||
long lMem = outInfo.availMem;
|
||||
// float fMem = (float) lMem / (float)(1024.0 * 1024.0);
|
||||
|
||||
return (lMem);
|
||||
}
|
||||
@ -1866,12 +2034,10 @@ public class DoCommand {
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
sRet += "reg exception thrown";
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1911,25 +2077,76 @@ public class DoCommand {
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
sRet = e.getLocalizedMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (ClientProtocolException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
sRet = e.getLocalizedMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
sRet = e.getLocalizedMessage();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return(sRet);
|
||||
}
|
||||
|
||||
public String GetTimeZone()
|
||||
{
|
||||
String sRet = "";
|
||||
TimeZone tz;
|
||||
|
||||
tz = TimeZone.getDefault();
|
||||
Date now = new Date();
|
||||
sRet = tz.getDisplayName(tz.inDaylightTime(now), TimeZone.LONG);
|
||||
|
||||
return(sRet);
|
||||
}
|
||||
|
||||
public String SetTimeZone(String sTimeZone)
|
||||
{
|
||||
String sRet = "Unable to set timezone to " + sTimeZone;
|
||||
TimeZone tz = null;
|
||||
AlarmManager amgr = null;
|
||||
|
||||
if ((sTimeZone.length() > 0) && (sTimeZone.startsWith("GMT")))
|
||||
{
|
||||
amgr = (AlarmManager) contextWrapper.getSystemService(Context.ALARM_SERVICE);
|
||||
if (amgr != null)
|
||||
amgr.setTimeZone(sTimeZone);
|
||||
}
|
||||
else
|
||||
{
|
||||
String [] zoneNames = TimeZone.getAvailableIDs();
|
||||
int nNumMatches = zoneNames.length;
|
||||
int lcv = 0;
|
||||
|
||||
for (lcv = 0; lcv < nNumMatches; lcv++)
|
||||
{
|
||||
if (zoneNames[lcv].equalsIgnoreCase(sTimeZone))
|
||||
break;
|
||||
}
|
||||
|
||||
if (lcv < nNumMatches)
|
||||
{
|
||||
amgr = (AlarmManager) contextWrapper.getSystemService(Context.ALARM_SERVICE);
|
||||
if (amgr != null)
|
||||
amgr.setTimeZone(zoneNames[lcv]);
|
||||
}
|
||||
}
|
||||
|
||||
if (amgr != null)
|
||||
{
|
||||
tz = TimeZone.getDefault();
|
||||
Date now = new Date();
|
||||
sRet = tz.getDisplayName(tz.inDaylightTime(now), TimeZone.LONG);
|
||||
}
|
||||
|
||||
return(sRet);
|
||||
}
|
||||
|
||||
public String GetSystemTime()
|
||||
{
|
||||
@ -1943,17 +2160,8 @@ public class DoCommand {
|
||||
|
||||
public String SetSystemTime(String sDate, String sTime, OutputStream out)
|
||||
{
|
||||
// Debug.waitForDebugger();
|
||||
String sRet = "";
|
||||
|
||||
// Intent prgIntent = new Intent(android.provider.Settings.ACTION_DATE_SETTINGS);
|
||||
// prgIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// contextWrapper.startActivity(prgIntent);
|
||||
|
||||
// 2010/09/22
|
||||
// 15:41:00
|
||||
// 0123456789012345678
|
||||
|
||||
if (((sDate != null) && (sTime != null)) &&
|
||||
(sDate.contains("/") || sDate.contains(".")) &&
|
||||
(sTime.contains(":")))
|
||||
@ -1966,14 +2174,11 @@ public class DoCommand {
|
||||
int mins = Integer.parseInt(sTime.substring(3,5));
|
||||
int secs = Integer.parseInt(sTime.substring(6,8));
|
||||
|
||||
Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
|
||||
Calendar cal = new GregorianCalendar(TimeZone.getDefault());
|
||||
cal.set(year, month - 1, day, hour, mins, secs);
|
||||
long lMillisecs = cal.getTime().getTime();
|
||||
|
||||
// boolean bRet = SystemClock.setCurrentTimeMillis(lMillisecs);
|
||||
String sM = Long.toString(lMillisecs);
|
||||
// long lm = 1285175618316L;
|
||||
String sTest = cal.getTime().toGMTString();
|
||||
String sMillis = sM.substring(0, sM.length() - 3) + "." + sM.substring(sM.length() - 3);
|
||||
String [] theArgs = new String [3];
|
||||
|
||||
@ -1996,7 +2201,6 @@ public class DoCommand {
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -2045,24 +2249,6 @@ public class DoCommand {
|
||||
|
||||
return (sRet);
|
||||
}
|
||||
/*
|
||||
private boolean IsProcRunning(Process pProc)
|
||||
{
|
||||
boolean bRet = false;
|
||||
int nExitCode = 0;
|
||||
|
||||
try
|
||||
{
|
||||
nExitCode = pProc.exitValue();
|
||||
}
|
||||
catch (IllegalThreadStateException z)
|
||||
{
|
||||
bRet = true;
|
||||
}
|
||||
|
||||
return(bRet);
|
||||
}
|
||||
*/
|
||||
|
||||
public String NewKillProc(String sProcId, OutputStream out)
|
||||
{
|
||||
@ -2107,9 +2293,6 @@ public class DoCommand {
|
||||
try
|
||||
{
|
||||
pProc = Runtime.getRuntime().exec(theArgs);
|
||||
// sutErr = pProc.getErrorStream(); // Stderr
|
||||
// sutIn = pProc.getOutputStream(); // Stdin
|
||||
// sutOut = pProc.getInputStream(); // Stdout
|
||||
RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
|
||||
outThrd.start();
|
||||
outThrd.join(5000);
|
||||
@ -2123,7 +2306,6 @@ public class DoCommand {
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -2133,7 +2315,6 @@ public class DoCommand {
|
||||
public String GetTmpDir()
|
||||
{
|
||||
String sRet = "";
|
||||
// Context ctx = SUTAgentAndroid.me.getApplicationContext();
|
||||
Context ctx = contextWrapper.getApplicationContext();
|
||||
File dir = ctx.getFilesDir();
|
||||
ctx = null;
|
||||
@ -2245,7 +2426,6 @@ public class DoCommand {
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -2269,7 +2449,6 @@ public class DoCommand {
|
||||
outThrd.start();
|
||||
outThrd.join(60000);
|
||||
int nRet = pProc.exitValue();
|
||||
// boolean bRet = outThrd.isAlive();
|
||||
sRet = "\nuninst complete [" + nRet + "]";
|
||||
}
|
||||
catch (IOException e)
|
||||
@ -2403,7 +2582,6 @@ public class DoCommand {
|
||||
{
|
||||
String sRet = "";
|
||||
|
||||
// Context ctx = SUTAgentAndroid.me.getApplicationContext();
|
||||
Context ctx = contextWrapper.getApplicationContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
|
||||
@ -2435,17 +2613,12 @@ public class DoCommand {
|
||||
try
|
||||
{
|
||||
contextWrapper.startActivity(prgIntent);
|
||||
// Thread.sleep(5000);
|
||||
sRet = "exit";
|
||||
}
|
||||
catch(ActivityNotFoundException anf)
|
||||
{
|
||||
anf.printStackTrace();
|
||||
}
|
||||
// catch (InterruptedException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
ctx = null;
|
||||
return (sRet);
|
||||
@ -2458,7 +2631,6 @@ public class DoCommand {
|
||||
String sUrl = "";
|
||||
String sRedirFileName = "";
|
||||
|
||||
// Context ctx = SUTAgentAndroid.me.getApplicationContext();
|
||||
Context ctx = contextWrapper.getApplicationContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
|
||||
@ -2486,7 +2658,7 @@ public class DoCommand {
|
||||
|
||||
if (sArgs.length > 1)
|
||||
{
|
||||
if (sArgs[0].contains("android.browser"))
|
||||
// if (sArgs[0].contains("android.browser"))
|
||||
prgIntent.setAction(Intent.ACTION_VIEW);
|
||||
|
||||
if (sArgs[0].contains("fennec"))
|
||||
@ -2530,10 +2702,7 @@ public class DoCommand {
|
||||
|
||||
try
|
||||
{
|
||||
// ctx.startActivity(prgIntent);
|
||||
contextWrapper.startActivity(prgIntent);
|
||||
// SUTAgentAndroid.me.startActivity(prgIntent);
|
||||
// SUTAgentAndroid.me.startActivityForResult(prgIntent, SUTAgentAndroid.START_PRG);
|
||||
}
|
||||
catch(ActivityNotFoundException anf)
|
||||
{
|
||||
@ -2551,12 +2720,11 @@ public class DoCommand {
|
||||
try
|
||||
{
|
||||
pProc = Runtime.getRuntime().exec(progArray);
|
||||
sutErr = pProc.getErrorStream(); // Stderr
|
||||
sutIn = pProc.getOutputStream(); // Stdin
|
||||
sutOut = pProc.getInputStream(); // Stdout
|
||||
RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
|
||||
outThrd.start();
|
||||
outThrd.join(10000);
|
||||
int nRetCode = pProc.exitValue();
|
||||
sRet = "return code [" + nRetCode + "]";
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
@ -2564,8 +2732,147 @@ public class DoCommand {
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
sRet = "Timed out!";
|
||||
}
|
||||
|
||||
return (sRet);
|
||||
}
|
||||
/*
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void set(String key, String value) throws Exception
|
||||
{
|
||||
Class[] classes = Collections.class.getDeclaredClasses();
|
||||
Map env = System.getenv();
|
||||
for(Class cl : classes)
|
||||
{
|
||||
if("java.util.Collections$UnmodifiableMap".equals(cl.getName()))
|
||||
{
|
||||
Field field = cl.getDeclaredField("m");
|
||||
field.setAccessible(true);
|
||||
Object obj = field.get(env);
|
||||
Map<String, String> map = (Map<String, String>) obj;
|
||||
map.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
public String StartPrg2(String [] progArray, OutputStream out)
|
||||
{
|
||||
String sRet = "";
|
||||
|
||||
int nArraySize = 0;
|
||||
int nArgs = progArray.length - 1; // 1st arg is the environment string
|
||||
int lcv = 0;
|
||||
int temp = 0;
|
||||
|
||||
String sEnvString = progArray[0];
|
||||
|
||||
// Set up command line args stripping off the environment string
|
||||
String [] theArgs = new String [nArgs];
|
||||
for (lcv = 0; lcv < nArgs; lcv++)
|
||||
{
|
||||
theArgs[lcv] = progArray[lcv + 1];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
String [] envStrings = sEnvString.split(",");
|
||||
Map<String, String> newEnv = new HashMap<String, String>();
|
||||
|
||||
for (lcv = 0; lcv < envStrings.length; lcv++)
|
||||
{
|
||||
temp = envStrings[lcv].indexOf("=");
|
||||
if (temp > 0)
|
||||
{
|
||||
newEnv.put( envStrings[lcv].substring(0, temp),
|
||||
envStrings[lcv].substring(temp + 1, envStrings[lcv].length()));
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> sysEnv = System.getenv();
|
||||
|
||||
nArraySize = sysEnv.size();
|
||||
|
||||
for (Map.Entry<String, String> entry : newEnv.entrySet())
|
||||
{
|
||||
if (!sysEnv.containsKey(entry.getKey()))
|
||||
{
|
||||
nArraySize++;
|
||||
}
|
||||
}
|
||||
|
||||
String[] envArray = new String[nArraySize];
|
||||
|
||||
int i = 0;
|
||||
int offset;
|
||||
String sKey = "";
|
||||
String sValue = "";
|
||||
|
||||
for (Map.Entry<String, String> entry : sysEnv.entrySet())
|
||||
{
|
||||
sKey = entry.getKey();
|
||||
if (newEnv.containsKey(sKey))
|
||||
{
|
||||
sValue = newEnv.get(sKey);
|
||||
if ((offset = sValue.indexOf("$" + sKey)) != -1)
|
||||
{
|
||||
envArray[i++] = sKey +
|
||||
"=" +
|
||||
sValue.substring(0, offset) +
|
||||
entry.getValue() +
|
||||
sValue.substring(offset + sKey.length() + 1);
|
||||
}
|
||||
else
|
||||
envArray[i++] = sKey + "=" + sValue;
|
||||
newEnv.remove(sKey);
|
||||
}
|
||||
else
|
||||
envArray[i++] = entry.getKey() + "=" + entry.getValue();
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : newEnv.entrySet())
|
||||
{
|
||||
envArray[i++] = entry.getKey() + "=" + entry.getValue();
|
||||
}
|
||||
|
||||
pProc = Runtime.getRuntime().exec(theArgs, envArray);
|
||||
|
||||
RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
|
||||
outThrd.start();
|
||||
outThrd.join(10000);
|
||||
int nRetCode = pProc.exitValue();
|
||||
sRet = "return code [" + nRetCode + "]";
|
||||
}
|
||||
catch(UnsupportedOperationException e)
|
||||
{
|
||||
if (e != null)
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch(ClassCastException e)
|
||||
{
|
||||
if (e != null)
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch(IllegalArgumentException e)
|
||||
{
|
||||
if (e != null)
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch(NullPointerException e)
|
||||
{
|
||||
if (e != null)
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
sRet = "Timed out!";
|
||||
}
|
||||
|
||||
return (sRet);
|
||||
@ -2603,55 +2910,58 @@ public class DoCommand {
|
||||
*/
|
||||
private String PrintUsage()
|
||||
{
|
||||
String sRet = "run [executable] [args] - start program no wait\n" +
|
||||
"exec [executable] [args] - start program wait\n" +
|
||||
"fire [executable] [args] - start program no wait\n" +
|
||||
"arun [executable] [args] - start program no wait\n" +
|
||||
"kill [program name] - kill program no path\n" +
|
||||
"killall - kill all processes started\n" +
|
||||
"ps - list of running processes\n" +
|
||||
"info - list of device info\n" +
|
||||
" [os] - os version for device\n" +
|
||||
" [id] - unique identifier for device\n" +
|
||||
" [uptime] - uptime for device\n" +
|
||||
" [systime] - current system time on device\n" +
|
||||
" [screen] - width, height and bits per pixel for device\n" +
|
||||
" [memory] - physical, free, available, storage memory for device\n" +
|
||||
" [processes] - list of running processes see 'ps'\n" +
|
||||
"deadman timeout - set the duration for the deadman timer\n" +
|
||||
"alrt [on/off] - start or stop sysalert behavior\n" +
|
||||
"disk [arg] - prints disk space info\n" +
|
||||
"cp file1 file2 - copy file1 to file2 on device\n" +
|
||||
"time file - timestamp for file on device\n" +
|
||||
"hash file - generate hash for file on device\n" +
|
||||
"cd directory - change cwd on device\n" +
|
||||
"cat file - cat file on device\n" +
|
||||
"cwd - display cwd on device\n" +
|
||||
"mv file1 file2 - move file1 to file2 on device\n" +
|
||||
"push filename - push file to device\n" +
|
||||
"rm file - delete file on device\n" +
|
||||
"rmdr directory - delete directory on device even if not empty\n" +
|
||||
"mkdr directory - create directory on device\n" +
|
||||
"dirw directory - tests whether the directory is writable on the device\n" +
|
||||
"stat processid - stat process on device\n" +
|
||||
"dead processid - print whether the process is alive or hung on device\n" +
|
||||
"mems - dump memory stats on device\n" +
|
||||
"ls - print directory on device\n" +
|
||||
"tmpd - print temp directory on device\n" +
|
||||
"ping [hostname/ipaddr] - ping a network device\n" +
|
||||
"unzp zipfile destdir - unzip the zipfile into the destination dir\n" +
|
||||
"zip zipfile src - zip the source file/dir into zipfile\n" +
|
||||
"rebt - reboot device\n" +
|
||||
"inst /path/filename.apk - install the referenced apk file\n" +
|
||||
"uninst packagename - uninstall the referenced package\n" +
|
||||
"updt pkgname pkgfile - unpdate the referenced package\n" +
|
||||
"clok - the current device time expressed as the number of millisecs since epoch\n" +
|
||||
"settime date time - sets the device date and time (YYYY/MM/DD HH:MM:SS)\n" +
|
||||
"rebt - reboot device\n" +
|
||||
"quit - disconnect SUTAgent\n" +
|
||||
"exit - close SUTAgent\n" +
|
||||
"ver - SUTAgent version\n" +
|
||||
"help - you're reading it";
|
||||
String sRet =
|
||||
"run [executable] [args] - start program no wait\n" +
|
||||
"exec [executable] [args] - start program wait\n" +
|
||||
"fire [executable] [args] - start program no wait\n" +
|
||||
"envrun [env pairs] [cmdline] - start program no wait\n" +
|
||||
"kill [program name] - kill program no path\n" +
|
||||
"killall - kill all processes started\n" +
|
||||
"ps - list of running processes\n" +
|
||||
"info - list of device info\n" +
|
||||
" [os] - os version for device\n" +
|
||||
" [id] - unique identifier for device\n" +
|
||||
" [uptime] - uptime for device\n" +
|
||||
" [systime] - current system time on device\n" +
|
||||
" [screen] - width, height and bits per pixel for device\n" +
|
||||
" [memory] - physical, free, available, storage memory for device\n" +
|
||||
" [processes] - list of running processes see 'ps'\n" +
|
||||
"deadman timeout - set the duration for the deadman timer\n" +
|
||||
"alrt [on/off] - start or stop sysalert behavior\n" +
|
||||
"disk [arg] - prints disk space info\n" +
|
||||
"cp file1 file2 - copy file1 to file2 on device\n" +
|
||||
"time file - timestamp for file on device\n" +
|
||||
"hash file - generate hash for file on device\n" +
|
||||
"cd directory - change cwd on device\n" +
|
||||
"cat file - cat file on device\n" +
|
||||
"cwd - display cwd on device\n" +
|
||||
"mv file1 file2 - move file1 to file2 on device\n" +
|
||||
"push filename - push file to device\n" +
|
||||
"rm file - delete file on device\n" +
|
||||
"rmdr directory - delete directory on device even if not empty\n" +
|
||||
"mkdr directory - create directory on device\n" +
|
||||
"dirw directory - tests whether the directory is writable on the device\n" +
|
||||
"stat processid - stat process on device\n" +
|
||||
"dead processid - print whether the process is alive or hung on device\n" +
|
||||
"mems - dump memory stats on device\n" +
|
||||
"ls - print directory on device\n" +
|
||||
"tmpd - print temp directory on device\n" +
|
||||
"ping [hostname/ipaddr] - ping a network device\n" +
|
||||
"unzp zipfile destdir - unzip the zipfile into the destination dir\n" +
|
||||
"zip zipfile src - zip the source file/dir into zipfile\n" +
|
||||
"rebt - reboot device\n" +
|
||||
"inst /path/filename.apk - install the referenced apk file\n" +
|
||||
"uninst packagename - uninstall the referenced package\n" +
|
||||
"updt pkgname pkgfile - unpdate the referenced package\n" +
|
||||
"clok - the current device time expressed as the number of millisecs since epoch\n" +
|
||||
"settime date time - sets the device date and time (YYYY/MM/DD HH:MM:SS)\n" +
|
||||
"tzset timezone - sets the device timezone format is GMTxhh:mm x = +/- or a recognized Olsen string\n" +
|
||||
"tzget - returns the current timezone set on the device\n" +
|
||||
"rebt - reboot device\n" +
|
||||
"quit - disconnect SUTAgent\n" +
|
||||
"exit - close SUTAgent\n" +
|
||||
"ver - SUTAgent version\n" +
|
||||
"help - you're reading it";
|
||||
return (sRet);
|
||||
}
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ public class SUTAgentAndroid extends Activity
|
||||
{
|
||||
sb.append("Overheated ");
|
||||
sb.append((((float)(nBatteryTemp))/10));
|
||||
sb.append("(°C)");
|
||||
sb.append("(C)");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
16
client.mk
16
client.mk
@ -69,8 +69,7 @@
|
||||
#
|
||||
#######################################################################
|
||||
# Defines
|
||||
#
|
||||
CVS = cvs
|
||||
|
||||
comma := ,
|
||||
|
||||
CWD := $(CURDIR)
|
||||
@ -107,7 +106,6 @@ endif
|
||||
PERL ?= perl
|
||||
PYTHON ?= python
|
||||
|
||||
RUN_AUTOCONF_LOCALLY = 1
|
||||
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
|
||||
ifdef CONFIG_GUESS_SCRIPT
|
||||
CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
|
||||
@ -170,7 +168,6 @@ CONFIGURES += $(TOPSRCDIR)/js/src/configure
|
||||
|
||||
#######################################################################
|
||||
# Rules
|
||||
#
|
||||
|
||||
# The default rule is build
|
||||
build::
|
||||
@ -272,7 +269,6 @@ else
|
||||
CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
|
||||
CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
|
||||
|
||||
ifdef RUN_AUTOCONF_LOCALLY
|
||||
EXTRA_CONFIG_DEPS := \
|
||||
$(TOPSRCDIR)/aclocal.m4 \
|
||||
$(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
|
||||
@ -282,7 +278,6 @@ EXTRA_CONFIG_DEPS := \
|
||||
$(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
|
||||
@echo Generating $@ using autoconf
|
||||
cd $(@D); $(AUTOCONF)
|
||||
endif
|
||||
|
||||
CONFIG_STATUS_DEPS := \
|
||||
$(wildcard $(CONFIGURES)) \
|
||||
@ -290,8 +285,7 @@ CONFIG_STATUS_DEPS := \
|
||||
$(TOPSRCDIR)/.mozconfig.mk \
|
||||
$(wildcard $(TOPSRCDIR)/nsprpub/configure) \
|
||||
$(wildcard $(TOPSRCDIR)/config/milestone.txt) \
|
||||
$(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
|
||||
$(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
|
||||
$(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
|
||||
$(NULL)
|
||||
|
||||
# configure uses the program name to determine @srcdir@. Calling it without
|
||||
@ -303,10 +297,6 @@ else
|
||||
CONFIGURE = $(TOPSRCDIR)/configure
|
||||
endif
|
||||
|
||||
ifdef MOZ_TOOLS
|
||||
CONFIGURE = $(TOPSRCDIR)/configure
|
||||
endif
|
||||
|
||||
configure-files: $(CONFIGURES)
|
||||
|
||||
configure:: configure-files
|
||||
@ -417,4 +407,4 @@ echo-variable-%:
|
||||
# in parallel.
|
||||
.NOTPARALLEL:
|
||||
|
||||
.PHONY: checkout real_checkout depend build profiledbuild maybe_clobber_profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all
|
||||
.PHONY: checkout real_checkout depend build profiledbuild maybe_clobber_profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all upload sdk
|
||||
|
@ -132,6 +132,7 @@ export::
|
||||
-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
|
||||
-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
|
||||
-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
|
||||
-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
|
||||
$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
|
||||
$(INSTALL) system_wrappers $(DIST)
|
||||
|
||||
|
@ -101,7 +101,6 @@ MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@
|
||||
MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
|
||||
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
|
||||
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
|
||||
MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
|
||||
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
|
||||
MOZ_IPC = @MOZ_IPC@
|
||||
MOZ_IPDL_TESTS = @MOZ_IPDL_TESTS@
|
||||
@ -232,6 +231,10 @@ MOZ_NATIVE_LIBEVENT = @MOZ_NATIVE_LIBEVENT@
|
||||
MOZ_LIBEVENT_LIBS = @MOZ_LIBEVENT_LIBS@
|
||||
MOZ_LIBEVENT_INCLUDES = @MOZ_LIBEVENT_INCLUDES@
|
||||
|
||||
MOZ_NATIVE_LIBVPX = @MOZ_NATIVE_LIBVPX@
|
||||
MOZ_LIBVPX_LIBS = @MOZ_LIBVPX_LIBS@
|
||||
MOZ_LIBVPX_INCLUDES = @MOZ_LIBVPX_INCLUDES@
|
||||
|
||||
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
|
||||
MOZ_NATIVE_BZ2 = @SYSTEM_BZ2@
|
||||
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@
|
||||
@ -696,3 +699,16 @@ ANDROID_TOOLS = @ANDROID_TOOLS@
|
||||
ANDROID_VERSION = @ANDROID_VERSION@
|
||||
|
||||
JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
|
||||
|
||||
# We only want to do the pymake sanity on Windows, other os's can cope
|
||||
ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
|
||||
# Ensure invariants between GNU Make and pymake
|
||||
# Checked here since we want the sane error in a file that
|
||||
# actually can be found regardless of path-style.
|
||||
ifeq (_:,$(.PYMAKE)_$(findstring :,$(srcdir)))
|
||||
$(error Windows-style srcdir being used with GNU make. Did you mean to run $(topsrcdir)/build/pymake/make.py instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
|
||||
endif
|
||||
ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(srcdir))))
|
||||
$(error MSYS-style srcdir being used with Pymake. Did you mean to run GNU Make instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
|
||||
endif
|
||||
endif # Windows
|
||||
|
@ -171,8 +171,8 @@ SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-inter
|
||||
libs::
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py \
|
||||
$(testxpcobjdir)/all-test-dirs.list \
|
||||
$(addprefix $(relativesrcdir)/,$(XPCSHELL_TESTS))
|
||||
$(testxpcobjdir)/all-test-dirs.list \
|
||||
$(addprefix $(relativesrcdir)/,$(XPCSHELL_TESTS))
|
||||
|
||||
testxpcsrcdir = $(topsrcdir)/testing/xpcshell
|
||||
|
||||
@ -180,39 +180,39 @@ testxpcsrcdir = $(topsrcdir)/testing/xpcshell
|
||||
# See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
|
||||
xpcshell-tests:
|
||||
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
$(EXTRA_TEST_ARGS) \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
$(EXTRA_TEST_ARGS) \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||
|
||||
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
|
||||
# start the test. Instead, present the xpcshell prompt so the user can
|
||||
# attach a debugger and then start the test.
|
||||
check-interactive:
|
||||
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
--test-path=$(SOLO_FILE) \
|
||||
--profile-name=$(MOZ_APP_NAME) \
|
||||
--interactive \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
--test-path=$(SOLO_FILE) \
|
||||
--profile-name=$(MOZ_APP_NAME) \
|
||||
--interactive \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||
|
||||
# Execute a single test, specified in $(SOLO_FILE)
|
||||
check-one:
|
||||
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
--test-path=$(SOLO_FILE) \
|
||||
--profile-name=$(MOZ_APP_NAME) \
|
||||
--verbose \
|
||||
$(EXTRA_TEST_ARGS) \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
--test-path=$(SOLO_FILE) \
|
||||
--profile-name=$(MOZ_APP_NAME) \
|
||||
--verbose \
|
||||
$(EXTRA_TEST_ARGS) \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||
|
||||
endif # XPCSHELL_TESTS
|
||||
|
||||
@ -846,7 +846,7 @@ ifdef MODULE_NAME
|
||||
@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
|
||||
endif
|
||||
endif # BUILD_STATIC_LIBS
|
||||
else # !IS_COMPONENT
|
||||
else # !IS_COMPONENT
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
|
||||
endif # IS_COMPONENT
|
||||
endif # EXPORT_LIBRARY
|
||||
@ -874,7 +874,7 @@ endif # _LIBDIRS
|
||||
|
||||
endif # _LIBNAME_RELATIVE_PATHS
|
||||
|
||||
# Dependancies which, if modified, should cause everything to rebuild
|
||||
# Dependencies which, if modified, should cause everything to rebuild
|
||||
GLOBAL_DEPS += Makefile Makefile.in $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk
|
||||
|
||||
##############################################
|
||||
@ -1198,7 +1198,7 @@ CLEANUP2 := true
|
||||
endif
|
||||
SUB_LOBJS = $(shell for lib in $(SHARED_LIBRARY_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;)
|
||||
endif # EXPAND_FAKELIBS
|
||||
endif # SHARED_LIBARY_LIBS
|
||||
endif # SHARED_LIBRARY_LIBS
|
||||
endif
|
||||
ifdef MOZILLA_PROBE_LIBS
|
||||
PROBE_LOBJS = $(shell for lib in $(MOZILLA_PROBE_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;)
|
||||
@ -1578,7 +1578,7 @@ normalizepath = $(foreach p,$(1),$(shell cygpath -m $(p)))
|
||||
else
|
||||
# assume MSYS
|
||||
# We use 'pwd -W' to get DOS form of the path. However, since the given path
|
||||
# could be a file or a nonexistent path, we cannot call 'pwd -W' directly
|
||||
# could be a file or a non-existent path, we cannot call 'pwd -W' directly
|
||||
# on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
|
||||
# on it, then merge with the rest of the path.
|
||||
root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|")
|
||||
|
@ -1051,3 +1051,7 @@ pixman.h
|
||||
#if MOZ_ENABLE_MEEGOTOUCHSHARE
|
||||
shareuiinterface.h
|
||||
#endif
|
||||
#if MOZ_NATIVE_LIBVPX==1
|
||||
vpx/vpx_decoder.h
|
||||
vpx/vp8dx.h
|
||||
#endif
|
||||
|
83
configure.in
83
configure.in
@ -3408,11 +3408,9 @@ case $target in
|
||||
*-os2*)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, atan)
|
||||
AC_CHECK_LIB(dl, dlopen,
|
||||
AC_CHECK_HEADER(dlfcn.h,
|
||||
LIBS="-ldl $LIBS"
|
||||
AC_DEFINE(HAVE_LIBDL)))
|
||||
AC_SEARCH_LIBS(dlopen, dl,
|
||||
AC_CHECK_HEADER(dlfcn.h,
|
||||
AC_DEFINE(HAVE_DLOPEN)))
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -4728,10 +4726,10 @@ AC_CHECK_PROGS(YASM, yasm, "")
|
||||
if test -n "$YASM"; then
|
||||
dnl Pull out yasm's version string
|
||||
changequote(,)
|
||||
_YASM_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*|\1|p'
|
||||
_YASM_VER_FILTER='s|.* \([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\).*|\1|p'
|
||||
changequote([,])
|
||||
|
||||
YASM_VERSION=`yasm --version | sed -nre "$_YASM_VER_FILTER"`
|
||||
YASM_VERSION=`yasm --version | sed -ne "$_YASM_VER_FILTER"`
|
||||
_YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
|
||||
_YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
|
||||
_YASM_RELEASE=` echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
|
||||
@ -4942,7 +4940,6 @@ MOZ_ACTIVEX_SCRIPTING_SUPPORT=
|
||||
MOZ_BRANDING_DIRECTORY=
|
||||
MOZ_OFFICIAL_BRANDING=
|
||||
MOZ_FEEDS=1
|
||||
MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
|
||||
MOZ_INSTALLER=1
|
||||
MOZ_IPC=1
|
||||
MOZ_JAVAXPCOM=
|
||||
@ -5994,8 +5991,50 @@ MOZ_ARG_DISABLE_BOOL(webm,
|
||||
MOZ_WEBM=,
|
||||
MOZ_WEBM=1)
|
||||
|
||||
dnl system libvpx Support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_WITH_STRING(system-libvpx,
|
||||
[ --with-system-libvpx=[PFX]
|
||||
Use system libvpx [installed at prefix PFX]],
|
||||
LIBVPX_DIR=$withval)
|
||||
|
||||
MOZ_NATIVE_LIBVPX=
|
||||
MOZ_LIBVPX_INCLUDES=
|
||||
MOZ_LIBVPX_LIBS=
|
||||
|
||||
if test -n "$MOZ_WEBM"; then
|
||||
AC_DEFINE(MOZ_WEBM)
|
||||
|
||||
if test -n "$LIBVPX_DIR" -a "$LIBVPX_DIR" != no; then
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
if test "${LIBVPX_DIR}" = "yes"; then
|
||||
LIBVPX_DIR=/usr
|
||||
fi
|
||||
CFLAGS="-I${LIBVPX_DIR}/include $CFLAGS"
|
||||
LDFLAGS="-L${LIBVPX_DIR}/lib $LDFLAGS"
|
||||
AC_CHECK_HEADER(vpx/vpx_decoder.h,
|
||||
[if test ! -f "${LIBVPX_DIR}/include/vpx/vpx_decoder.h"; then
|
||||
AC_MSG_ERROR([vpx/vpx_decoder.h found, but is not in ${LIBVPX_DIR}/include])
|
||||
fi],
|
||||
AC_MSG_ERROR([--with-system-libvpx requested but vpx/vpx_decoder.h not found]))
|
||||
AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver,
|
||||
[MOZ_NATIVE_LIBVPX=1
|
||||
MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include"
|
||||
MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"],
|
||||
([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found]))
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_NATIVE_LIBVPX)
|
||||
AC_SUBST(MOZ_LIBVPX_INCLUDES)
|
||||
AC_SUBST(MOZ_LIBVPX_LIBS)
|
||||
|
||||
if test -n "$MOZ_WEBM" -a -z "$MOZ_NATIVE_LIBVPX"; then
|
||||
MOZ_SYDNEYAUDIO=1
|
||||
MOZ_MEDIA=1
|
||||
case "$target_cpu" in
|
||||
@ -6418,33 +6457,6 @@ for extension in $MOZ_EXTENSIONS; do
|
||||
fi
|
||||
done
|
||||
|
||||
dnl ========================================================
|
||||
dnl Image encoders
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_STRING(image-encoders,
|
||||
[ --enable-image-encoders[={mod1,mod2,default,all,none}]
|
||||
Enable specific image encoders],
|
||||
[ for option in `echo $enableval | sed 's/,/ /g'`; do
|
||||
if test "$option" = "yes" -o "$option" = "all"; then
|
||||
addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
|
||||
elif test "$option" = "no" -o "$option" = "none"; then
|
||||
MOZ_IMG_ENCODERS=""
|
||||
addencoder=""
|
||||
elif test "$option" = "default"; then
|
||||
addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
|
||||
elif test `echo "$option" | grep -c \^-` != 0; then
|
||||
option=`echo $option | sed 's/^-//'`
|
||||
addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
|
||||
else
|
||||
addencoder="$option"
|
||||
fi
|
||||
MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
|
||||
done],
|
||||
MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
|
||||
|
||||
dnl Remove dupes
|
||||
MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
|
||||
|
||||
dnl ========================================================
|
||||
dnl MathML on by default
|
||||
dnl ========================================================
|
||||
@ -8848,7 +8860,6 @@ AC_SUBST(MOZ_DEBUG_FLAGS)
|
||||
AC_SUBST(MOZ_DEBUG_LDFLAGS)
|
||||
AC_SUBST(WARNINGS_AS_ERRORS)
|
||||
AC_SUBST(MOZ_EXTENSIONS)
|
||||
AC_SUBST(MOZ_IMG_ENCODERS)
|
||||
AC_SUBST(MOZ_JSDEBUGGER)
|
||||
AC_SUBST(MOZ_PLUGINS)
|
||||
AC_SUBST(MOZ_LOG_REFCNT)
|
||||
|
57
content/base/public/FromParser.h
Normal file
57
content/base/public/FromParser.h
Normal file
@ -0,0 +1,57 @@
|
||||
/* ***** 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
|
||||
* Ms2ger <Ms2ger@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef mozilla_dom_FromParser_h
|
||||
#define mozilla_dom_FromParser_h
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
/**
|
||||
* Constants for passing as aFromParser
|
||||
*/
|
||||
enum FromParser {
|
||||
NOT_FROM_PARSER = 0,
|
||||
FROM_PARSER_NETWORK = 1,
|
||||
FROM_PARSER_DOCUMENT_WRITE = 1 << 1,
|
||||
FROM_PARSER_FRAGMENT = 1 << 2,
|
||||
FROM_PARSER_XSLT = 1 << 3
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_FromParser_h
|
@ -84,8 +84,9 @@ $(NULL)
|
||||
EXPORTS_NAMESPACES = mozilla/dom
|
||||
|
||||
EXPORTS_mozilla/dom = \
|
||||
Element.h \
|
||||
$(NULL)
|
||||
Element.h \
|
||||
FromParser.h \
|
||||
$(NULL)
|
||||
|
||||
ifndef DISABLE_XFORMS_HOOKS
|
||||
EXPORTS += nsIXFormsUtilityService.h
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "mozilla/dom/FromParser.h"
|
||||
|
||||
/**
|
||||
* Functions to create content, to be used only inside Gecko
|
||||
@ -56,17 +57,10 @@ class imgIRequest;
|
||||
class nsNodeInfoManager;
|
||||
class nsGenericHTMLElement;
|
||||
|
||||
/**
|
||||
* Constants for passing as aFromParser
|
||||
*/
|
||||
#define NS_NOT_FROM_PARSER 0
|
||||
#define NS_FROM_PARSER_NETWORK 1
|
||||
#define NS_FROM_PARSER_DOCUMENT_WRITE (1 << 1)
|
||||
#define NS_FROM_PARSER_FRAGMENT (1 << 2)
|
||||
|
||||
nsresult
|
||||
NS_NewElement(nsIContent** aResult, PRInt32 aElementType,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo, PRUint32 aFromParser);
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
nsresult
|
||||
NS_NewXMLElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
@ -109,13 +103,13 @@ NS_NewXMLCDATASection(nsIContent** aInstancePtrResult,
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser);
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
// First argument should be nsHTMLTag, but that adds dependency to parser
|
||||
// for a bunch of files.
|
||||
already_AddRefed<nsGenericHTMLElement>
|
||||
CreateHTMLElement(PRUint32 aNodeType, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser);
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
nsresult
|
||||
@ -134,7 +128,7 @@ NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNod
|
||||
#ifdef MOZ_SVG
|
||||
nsresult
|
||||
NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser);
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
|
@ -58,7 +58,7 @@ class nsIScriptElement : public nsIScriptLoaderObserver {
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTELEMENT_IID)
|
||||
|
||||
nsIScriptElement(PRUint32 aFromParser)
|
||||
nsIScriptElement(mozilla::dom::FromParser aFromParser)
|
||||
: mLineNumber(0),
|
||||
mAlreadyStarted(PR_FALSE),
|
||||
mMalformed(PR_FALSE),
|
||||
@ -66,7 +66,10 @@ public:
|
||||
mFrozen(PR_FALSE),
|
||||
mDefer(PR_FALSE),
|
||||
mAsync(PR_FALSE),
|
||||
mParserCreated((PRUint8)aFromParser),
|
||||
mParserCreated(aFromParser == mozilla::dom::FROM_PARSER_FRAGMENT ?
|
||||
mozilla::dom::NOT_FROM_PARSER : aFromParser),
|
||||
// Fragment parser-created scripts (if executable)
|
||||
// behave like script-created scripts.
|
||||
mCreatorParser(nsnull)
|
||||
{
|
||||
}
|
||||
@ -120,10 +123,9 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a constant defined in nsContentCreatorFunctions.h. Non-zero
|
||||
* values mean parser-created and zero means not parser-created.
|
||||
* Returns how the element was created.
|
||||
*/
|
||||
PRUint32 GetParserCreated()
|
||||
mozilla::dom::FromParser GetParserCreated()
|
||||
{
|
||||
return mParserCreated;
|
||||
}
|
||||
@ -156,7 +158,7 @@ public:
|
||||
mFrozen = PR_FALSE;
|
||||
mUri = nsnull;
|
||||
mCreatorParser = nsnull;
|
||||
mParserCreated = NS_NOT_FROM_PARSER;
|
||||
mParserCreated = mozilla::dom::NOT_FROM_PARSER;
|
||||
}
|
||||
|
||||
void SetCreatorParser(nsIParser* aParser)
|
||||
@ -234,7 +236,7 @@ protected:
|
||||
/**
|
||||
* Whether this element was parser-created.
|
||||
*/
|
||||
PRUint8 mParserCreated;
|
||||
mozilla::dom::FromParser mParserCreated;
|
||||
|
||||
/**
|
||||
* The effective src (or null if no src).
|
||||
|
@ -4803,8 +4803,12 @@ static void ProcessViewportToken(nsIDocument *aDocument,
|
||||
return;
|
||||
|
||||
/* Extract the key and value. */
|
||||
const nsAString &key = Substring(tail, tip);
|
||||
const nsAString &value = Substring(++tip, end);
|
||||
const nsAString &key =
|
||||
nsContentUtils::TrimWhitespace<nsCRT::IsAsciiSpace>(Substring(tail, tip),
|
||||
PR_TRUE);
|
||||
const nsAString &value =
|
||||
nsContentUtils::TrimWhitespace<nsCRT::IsAsciiSpace>(Substring(++tip, end),
|
||||
PR_TRUE);
|
||||
|
||||
/* Check for known keys. If we find a match, insert the appropriate
|
||||
* information into the document header. */
|
||||
@ -4823,7 +4827,9 @@ static void ProcessViewportToken(nsIDocument *aDocument,
|
||||
aDocument->SetHeaderData(nsGkAtoms::viewport_user_scalable, value);
|
||||
}
|
||||
|
||||
#define IS_SEPARATOR(c) ((c == ' ') || (c == ',') || (c == ';'))
|
||||
#define IS_SEPARATOR(c) ((c == '=') || (c == ',') || (c == ';') || \
|
||||
(c == '\t') || (c == '\n') || (c == '\r'))
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
nsContentUtils::ProcessViewportInfo(nsIDocument *aDocument,
|
||||
@ -4839,12 +4845,12 @@ nsContentUtils::ProcessViewportInfo(nsIDocument *aDocument,
|
||||
viewportInfo.EndReading(end);
|
||||
|
||||
/* Read the tip to the first non-separator character. */
|
||||
while ((tip != end) && IS_SEPARATOR(*tip))
|
||||
while ((tip != end) && (IS_SEPARATOR(*tip) || nsCRT::IsAsciiSpace(*tip)))
|
||||
++tip;
|
||||
|
||||
/* Read through and find tokens separated by separators. */
|
||||
while (tip != end) {
|
||||
|
||||
|
||||
/* Synchronize tip and tail. */
|
||||
tail = tip;
|
||||
|
||||
@ -4852,11 +4858,22 @@ nsContentUtils::ProcessViewportInfo(nsIDocument *aDocument,
|
||||
while ((tip != end) && !IS_SEPARATOR(*tip))
|
||||
++tip;
|
||||
|
||||
/* Allow white spaces that surround the '=' character */
|
||||
if ((tip != end) && (*tip == '=')) {
|
||||
++tip;
|
||||
|
||||
while ((tip != end) && nsCRT::IsAsciiSpace(*tip))
|
||||
++tip;
|
||||
|
||||
while ((tip != end) && !(IS_SEPARATOR(*tip) || nsCRT::IsAsciiSpace(*tip)))
|
||||
++tip;
|
||||
}
|
||||
|
||||
/* Our token consists of the characters between tail and tip. */
|
||||
ProcessViewportToken(aDocument, Substring(tail, tip));
|
||||
|
||||
/* Skip separators. */
|
||||
while ((tip != end) && IS_SEPARATOR(*tip))
|
||||
while ((tip != end) && (IS_SEPARATOR(*tip) || nsCRT::IsAsciiSpace(*tip)))
|
||||
++tip;
|
||||
}
|
||||
|
||||
|
@ -4371,7 +4371,8 @@ nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
PRInt32 ns = nodeInfo->NamespaceID();
|
||||
rv = NS_NewElement(getter_AddRefs(content), ns, nodeInfo.forget(), PR_FALSE);
|
||||
rv = NS_NewElement(getter_AddRefs(content), ns, nodeInfo.forget(),
|
||||
NOT_FROM_PARSER);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return CallQueryInterface(content, aReturn);
|
||||
@ -6848,7 +6849,8 @@ nsDocument::CreateElem(const nsAString& aName, nsIAtom *aPrefix, PRInt32 aNamesp
|
||||
getter_AddRefs(nodeInfo));
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
return NS_NewElement(aResult, elementType, nodeInfo.forget(), PR_FALSE);
|
||||
return NS_NewElement(aResult, elementType, nodeInfo.forget(),
|
||||
NOT_FROM_PARSER);
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
@ -653,7 +653,18 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mDocShell);
|
||||
NS_ASSERTION(baseWindow, "Found a nsIDocShell that isn't a nsIBaseWindow.");
|
||||
baseWindow->InitWindow(nsnull, view->GetWidget(), 0, 0, 10, 10);
|
||||
nsIntSize size;
|
||||
if (!(frame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
// We have a useful size already; use it, since we might get no
|
||||
// more size updates.
|
||||
size = GetSubDocumentSize(frame);
|
||||
} else {
|
||||
// Pick some default size for now. Using 10x10 because that's what the
|
||||
// code here used to do.
|
||||
size.SizeTo(10, 10);
|
||||
}
|
||||
baseWindow->InitWindow(nsnull, view->GetWidget(), 0, 0,
|
||||
size.width, size.height);
|
||||
// This is kinda whacky, this "Create()" call doesn't really
|
||||
// create anything, one starts to wonder why this was named
|
||||
// "Create"...
|
||||
|
@ -315,7 +315,7 @@ nsInProcessTabChildGlobal::InitTabChildGlobal()
|
||||
nsresult rv =
|
||||
xpc->InitClassesWithNewWrappedGlobal(cx, scopeSupports,
|
||||
NS_GET_IID(nsISupports),
|
||||
GetPrincipal(), EmptyCString(),
|
||||
GetPrincipal(), nsnull,
|
||||
flags, getter_AddRefs(mGlobal));
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
|
@ -57,6 +57,8 @@
|
||||
static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
||||
#endif
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
PRBool NS_SVGEnabled();
|
||||
#endif
|
||||
@ -227,7 +229,7 @@ NameSpaceManagerImpl::GetNameSpaceID(const nsAString& aURI)
|
||||
|
||||
nsresult
|
||||
NS_NewElement(nsIContent** aResult, PRInt32 aElementType,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo, PRUint32 aFromParser)
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser)
|
||||
{
|
||||
if (aElementType == kNameSpaceID_XHTML) {
|
||||
return NS_NewHTMLElement(aResult, aNodeInfo, aFromParser);
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
||||
|
||||
nsScriptElement(PRUint32 aFromParser)
|
||||
nsScriptElement(mozilla::dom::FromParser aFromParser)
|
||||
: nsIScriptElement(aFromParser)
|
||||
{
|
||||
}
|
||||
|
@ -157,6 +157,10 @@ nsScriptLoader::~nsScriptLoader()
|
||||
mParserBlockingRequest->FireScriptAvailable(NS_ERROR_ABORT);
|
||||
}
|
||||
|
||||
for (PRUint32 i = 0; i < mXSLTRequests.Length(); i++) {
|
||||
mXSLTRequests[i]->FireScriptAvailable(NS_ERROR_ABORT);
|
||||
}
|
||||
|
||||
for (PRUint32 i = 0; i < mDeferRequests.Length(); i++) {
|
||||
mDeferRequests[i]->FireScriptAvailable(NS_ERROR_ABORT);
|
||||
}
|
||||
@ -577,8 +581,9 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
// a parser-inserted script is being run, we came here by the parser
|
||||
// running the script, which means the parser is still alive and the
|
||||
// parse is ongoing.
|
||||
NS_ASSERTION(mDocument->GetCurrentContentSink(),
|
||||
"Defer script on a document without an active parser; bug 592366.");
|
||||
NS_ASSERTION(mDocument->GetCurrentContentSink() ||
|
||||
aElement->GetParserCreated() == FROM_PARSER_XSLT,
|
||||
"Non-XSLT Defer script on a document without an active parser; bug 592366.");
|
||||
mDeferRequests.AppendElement(request);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -591,11 +596,24 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
if (!request->mLoading) {
|
||||
// The request has already been loaded. If the script comes from the
|
||||
// network stream, cheat for performance reasons and avoid a trip
|
||||
// through the event loop.
|
||||
if (aElement->GetParserCreated() == NS_FROM_PARSER_NETWORK) {
|
||||
|
||||
if (aElement->GetParserCreated() == FROM_PARSER_XSLT) {
|
||||
// Need to maintain order for XSLT-inserted scripts
|
||||
NS_ASSERTION(!mParserBlockingRequest,
|
||||
"Parser-blocking scripts and XSLT scripts in the same doc!");
|
||||
mXSLTRequests.AppendElement(request);
|
||||
if (!request->mLoading) {
|
||||
// The script is available already. Run it ASAP when the event
|
||||
// loop gets a chance to spin.
|
||||
ProcessPendingRequestsAsync();
|
||||
}
|
||||
return NS_ERROR_HTMLPARSER_BLOCK;
|
||||
}
|
||||
if (!request->mLoading && ReadyToExecuteScripts()) {
|
||||
// The request has already been loaded and there are no pending style
|
||||
// sheets. If the script comes from the network stream, cheat for
|
||||
// performance reasons and avoid a trip through the event loop.
|
||||
if (aElement->GetParserCreated() == FROM_PARSER_NETWORK) {
|
||||
return ProcessRequest(request);
|
||||
}
|
||||
// Otherwise, we've got a document.written script, make a trip through
|
||||
@ -603,14 +621,18 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
// Web page.
|
||||
NS_ASSERTION(!mParserBlockingRequest,
|
||||
"There can be only one parser-blocking script at a time");
|
||||
NS_ASSERTION(mXSLTRequests.IsEmpty(),
|
||||
"Parser-blocking scripts and XSLT scripts in the same doc!");
|
||||
mParserBlockingRequest = request;
|
||||
ProcessPendingRequestsAsync();
|
||||
return NS_ERROR_HTMLPARSER_BLOCK;
|
||||
}
|
||||
// The script hasn't loaded yet and is parser-inserted and non-async.
|
||||
// It'll be executed when it has loaded.
|
||||
// The script hasn't loaded yet or there's a style sheet blocking it.
|
||||
// The script will be run when it loads or the style sheet loads.
|
||||
NS_ASSERTION(!mParserBlockingRequest,
|
||||
"There can be only one parser-blocking script at a time");
|
||||
NS_ASSERTION(mXSLTRequests.IsEmpty(),
|
||||
"Parser-blocking scripts and XSLT scripts in the same doc!");
|
||||
mParserBlockingRequest = request;
|
||||
return NS_ERROR_HTMLPARSER_BLOCK;
|
||||
}
|
||||
@ -641,18 +663,28 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
request->mURI = mDocument->GetDocumentURI();
|
||||
request->mLineNo = aElement->GetScriptLineNumber();
|
||||
|
||||
if (aElement->GetParserCreated() == NS_NOT_FROM_PARSER) {
|
||||
if (aElement->GetParserCreated() == FROM_PARSER_XSLT &&
|
||||
(!ReadyToExecuteScripts() || !mXSLTRequests.IsEmpty())) {
|
||||
// Need to maintain order for XSLT-inserted scripts
|
||||
NS_ASSERTION(!mParserBlockingRequest,
|
||||
"Parser-blocking scripts and XSLT scripts in the same doc!");
|
||||
mXSLTRequests.AppendElement(request);
|
||||
return NS_ERROR_HTMLPARSER_BLOCK;
|
||||
}
|
||||
if (aElement->GetParserCreated() == NOT_FROM_PARSER) {
|
||||
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||
"A script-inserted script is inserted without an update batch?");
|
||||
nsContentUtils::AddScriptRunner(new nsScriptRequestProcessor(this,
|
||||
request));
|
||||
return NS_OK;
|
||||
}
|
||||
if (aElement->GetParserCreated() == NS_FROM_PARSER_NETWORK &&
|
||||
if (aElement->GetParserCreated() == FROM_PARSER_NETWORK &&
|
||||
!ReadyToExecuteScripts()) {
|
||||
NS_ASSERTION(!mParserBlockingRequest,
|
||||
"There can be only one parser-blocking script at a time");
|
||||
mParserBlockingRequest = request;
|
||||
NS_ASSERTION(mXSLTRequests.IsEmpty(),
|
||||
"Parser-blocking scripts and XSLT scripts in the same doc!");
|
||||
return NS_ERROR_HTMLPARSER_BLOCK;
|
||||
}
|
||||
// We now have a document.written inline script or we have an inline script
|
||||
@ -856,6 +888,14 @@ nsScriptLoader::ProcessPendingRequests()
|
||||
ProcessRequest(request);
|
||||
}
|
||||
|
||||
while (ReadyToExecuteScripts() &&
|
||||
!mXSLTRequests.IsEmpty() &&
|
||||
!mXSLTRequests[0]->mLoading) {
|
||||
request.swap(mXSLTRequests[0]);
|
||||
mXSLTRequests.RemoveElementAt(0);
|
||||
ProcessRequest(request);
|
||||
}
|
||||
|
||||
PRUint32 i = 0;
|
||||
while (mEnabled && i < mAsyncRequests.Length()) {
|
||||
if (!mAsyncRequests[i]->mLoading) {
|
||||
@ -867,7 +907,7 @@ nsScriptLoader::ProcessPendingRequests()
|
||||
++i;
|
||||
}
|
||||
|
||||
if (mDocumentParsingDone) {
|
||||
if (mDocumentParsingDone && mXSLTRequests.IsEmpty()) {
|
||||
while (!mDeferRequests.IsEmpty() && !mDeferRequests[0]->mLoading) {
|
||||
request.swap(mDeferRequests[0]);
|
||||
mDeferRequests.RemoveElementAt(0);
|
||||
@ -883,7 +923,7 @@ nsScriptLoader::ProcessPendingRequests()
|
||||
|
||||
if (mDocumentParsingDone && mDocument &&
|
||||
!mParserBlockingRequest && mAsyncRequests.IsEmpty() &&
|
||||
mDeferRequests.IsEmpty()) {
|
||||
mXSLTRequests.IsEmpty() && mDeferRequests.IsEmpty()) {
|
||||
// No more pending scripts; time to unblock onload.
|
||||
// OK to unblock onload synchronously here, since callers must be
|
||||
// prepared for the world changing anyway.
|
||||
@ -1053,7 +1093,8 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||
aString);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (mDeferRequests.RemoveElement(request) ||
|
||||
mAsyncRequests.RemoveElement(request)) {
|
||||
mAsyncRequests.RemoveElement(request) ||
|
||||
mXSLTRequests.RemoveElement(request)) {
|
||||
FireScriptAvailable(rv, request);
|
||||
} else if (mParserBlockingRequest == request) {
|
||||
mParserBlockingRequest = nsnull;
|
||||
@ -1131,6 +1172,7 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest,
|
||||
// wrong, especially if you see it more than once.
|
||||
NS_ASSERTION(mDeferRequests.IndexOf(aRequest) >= 0 ||
|
||||
mAsyncRequests.IndexOf(aRequest) >= 0 ||
|
||||
mXSLTRequests.IndexOf(aRequest) >= 0 ||
|
||||
mPreloads.Contains(aRequest, PreloadRequestComparator()) ||
|
||||
mParserBlockingRequest,
|
||||
"aRequest should be pending!");
|
||||
@ -1183,6 +1225,7 @@ nsScriptLoader::ParsingComplete(PRBool aTerminated)
|
||||
if (aTerminated) {
|
||||
mDeferRequests.Clear();
|
||||
mAsyncRequests.Clear();
|
||||
mXSLTRequests.Clear();
|
||||
mParserBlockingRequest = nsnull;
|
||||
}
|
||||
|
||||
|
@ -299,6 +299,7 @@ private:
|
||||
nsCOMArray<nsIScriptLoaderObserver> mObservers;
|
||||
nsTArray<nsRefPtr<nsScriptLoadRequest> > mAsyncRequests;
|
||||
nsTArray<nsRefPtr<nsScriptLoadRequest> > mDeferRequests;
|
||||
nsTArray<nsRefPtr<nsScriptLoadRequest> > mXSLTRequests;
|
||||
nsRefPtr<nsScriptLoadRequest> mParserBlockingRequest;
|
||||
|
||||
// In mRequests, the additional information here is stored by the element.
|
||||
|
@ -431,6 +431,13 @@ _TEST_FILES2 = \
|
||||
test_bug601803.html \
|
||||
file_bug601803a.html \
|
||||
file_bug601803b.html \
|
||||
test_bug604660.html \
|
||||
file_bug604660-1.xml \
|
||||
file_bug604660-2.xsl \
|
||||
file_bug604660-3.js \
|
||||
file_bug604660-4.js \
|
||||
file_bug604660-5.xml \
|
||||
file_bug604660-6.xsl \
|
||||
test_bug605982.html \
|
||||
$(NULL)
|
||||
|
||||
|
3
content/base/test/file_bug604660-1.xml
Normal file
3
content/base/test/file_bug604660-1.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/xsl" href="file_bug604660-2.xsl" ?>
|
||||
<placeholder/>
|
19
content/base/test/file_bug604660-2.xsl
Normal file
19
content/base/test/file_bug604660-2.xsl
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<title>XSLT script execution test</title>
|
||||
</head>
|
||||
<body>
|
||||
<script defer="" src="data:text/javascript,parent.scriptRan(5);"></script>
|
||||
<script>parent.scriptRan(1);</script>
|
||||
<script async="" src="data:text/javascript,parent.asyncRan();"></script>
|
||||
<script src="file_bug604660-3.js"></script>
|
||||
<script>parent.scriptRan(3);</script>
|
||||
<script src="file_bug604660-4.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
1
content/base/test/file_bug604660-3.js
Normal file
1
content/base/test/file_bug604660-3.js
Normal file
@ -0,0 +1 @@
|
||||
parent.scriptRan(2);
|
1
content/base/test/file_bug604660-4.js
Normal file
1
content/base/test/file_bug604660-4.js
Normal file
@ -0,0 +1 @@
|
||||
parent.scriptRan(4);
|
2
content/base/test/file_bug604660-5.xml
Normal file
2
content/base/test/file_bug604660-5.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0"?>
|
||||
<placeholder/>
|
9
content/base/test/file_bug604660-6.xsl
Normal file
9
content/base/test/file_bug604660-6.xsl
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<script>xsltProcessorCreatedScriptRan();</script>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
77
content/base/test/test_bug604660.html
Normal file
77
content/base/test/test_bug604660.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=604660
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 604660</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=604660">Mozilla Bug 604660</a>
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var asyncState = false;
|
||||
var scriptState = 0;
|
||||
|
||||
function scriptRan(num) {
|
||||
++scriptState;
|
||||
is(scriptState, num, "Scripts ran in the wrong sequence.");
|
||||
}
|
||||
|
||||
function asyncRan() {
|
||||
asyncState = true;
|
||||
}
|
||||
|
||||
</script>
|
||||
<p id="display"><iframe src="file_bug604660-1.xml" onload="iframeloaded()";></iframe></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
var xlstProcessorState = false;
|
||||
|
||||
function xsltProcessorCreatedScriptRan() {
|
||||
xlstProcessorState = true;
|
||||
}
|
||||
|
||||
function iframeloaded() {
|
||||
ok(asyncState, "Async script should have run.");
|
||||
is(scriptState, 5, "Five scripts should have run.");
|
||||
|
||||
var processor = new XSLTProcessor();
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function() {
|
||||
if (this.readyState == 4) {
|
||||
processor.importStylesheet(this.responseXML);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (this.readyState == 4) {
|
||||
var doc = processor.transformToDocument(this.responseXML);
|
||||
var target = document.getElementById("display");
|
||||
target.appendChild(doc.documentElement.firstChild);
|
||||
ok(!xlstProcessorState, "Scripts created by transformToDocument should not run.");
|
||||
|
||||
var fragment = processor.transformToFragment(this.responseXML, document);
|
||||
target.appendChild(fragment.firstChild.firstChild);
|
||||
ok(xlstProcessorState, "Scripts created by transformToFragment should run.");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
xhr.open("GET", "file_bug604660-5.xml");
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
xhr.open("GET", "file_bug604660-6.xsl");
|
||||
xhr.send();
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -16,24 +16,35 @@
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
var path = "/tests/content/base/test/";
|
||||
// contains { test_frame_id : expected_result }
|
||||
var testExpectedResults = { "control1": true,
|
||||
"control2": true,
|
||||
"deny": false,
|
||||
"sameorigin1": true,
|
||||
"sameorigin2": false
|
||||
};
|
||||
|
||||
var testFramesLoaded = function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var harness = document.getElementById("harness");
|
||||
|
||||
for (var t in testExpectedResults) {
|
||||
var frame = harness.contentDocument.getElementById(t);
|
||||
// test if frame loaded by checking for a contentDocument we can access
|
||||
test = frame.contentDocument.getElementById("test");
|
||||
is(test != null, testExpectedResults[t], "test "+t);
|
||||
}
|
||||
// iframe from same origin, no X-F-O header - should load
|
||||
var frame = harness.contentDocument.getElementById("control1");
|
||||
var test1 = frame.contentDocument.getElementById("test").textContent;
|
||||
is(test1, "control1", "test control1");
|
||||
|
||||
// iframe from different origin, no X-F-O header - should load
|
||||
frame = harness.contentDocument.getElementById("control2");
|
||||
var test2 = frame.contentDocument.getElementById("test").textContent;
|
||||
is(test2, "control2", "test control2");
|
||||
|
||||
// iframe from same origin, X-F-O: DENY - should not load
|
||||
frame = harness.contentDocument.getElementById("deny");
|
||||
var test3 = frame.contentDocument.getElementById("test");
|
||||
is(test3, null, "test deny");
|
||||
|
||||
// iframe from same origin, X-F-O: SAMEORIGIN - should load
|
||||
frame = harness.contentDocument.getElementById("sameorigin1");
|
||||
var test4 = frame.contentDocument.getElementById("test").textContent;
|
||||
is(test4, "sameorigin1", "test sameorigin1");
|
||||
|
||||
// iframe from different origin, X-F-O: SAMEORIGIN - should not load
|
||||
frame = harness.contentDocument.getElementById("sameorigin2");
|
||||
var test5 = frame.contentDocument.getElementById("test");
|
||||
is(test5, null, "test sameorigin2");
|
||||
|
||||
// call tests to check principal comparison, e.g. a document can open a window
|
||||
// to a data: or javascript: document which frames an
|
||||
|
@ -343,10 +343,10 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
if (forceOSMesa) {
|
||||
gl = gl::GLContextProviderOSMesa::CreateOffscreen(gfxIntSize(width, height), format);
|
||||
if (!gl || !InitAndValidateGL()) {
|
||||
LogMessage("WebGL: OSMesa forced, but creating context failed -- aborting!");
|
||||
LogMessage("OSMesa forced, but creating context failed -- aborting!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LogMessage("WebGL: Using software rendering via OSMesa (THIS WILL BE SLOW)");
|
||||
LogMessage("Using software rendering via OSMesa (THIS WILL BE SLOW)");
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
@ -399,8 +399,18 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
}
|
||||
#endif
|
||||
|
||||
// finally, try OSMesa
|
||||
if (!gl) {
|
||||
LogMessage("WebGL: Can't get a usable WebGL context");
|
||||
gl = gl::GLContextProviderOSMesa::CreateOffscreen(gfxIntSize(width, height), format);
|
||||
if (!gl || !InitAndValidateGL()) {
|
||||
gl = nsnull;
|
||||
} else {
|
||||
LogMessage("Using software rendering via OSMesa (THIS WILL BE SLOW)");
|
||||
}
|
||||
}
|
||||
|
||||
if (!gl) {
|
||||
LogMessage("Can't get a usable WebGL context");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -474,10 +474,7 @@ protected:
|
||||
WebGLObjectRefPtr<WebGLBuffer> mBoundElementArrayBuffer;
|
||||
WebGLObjectRefPtr<WebGLProgram> mCurrentProgram;
|
||||
|
||||
// XXX these 3 are wrong types, and aren't used atm (except for the length of the attachments)
|
||||
nsTArray<WebGLObjectRefPtr<WebGLTexture> > mFramebufferColorAttachments;
|
||||
nsRefPtr<WebGLFramebuffer> mFramebufferDepthAttachment;
|
||||
nsRefPtr<WebGLFramebuffer> mFramebufferStencilAttachment;
|
||||
PRUint32 mMaxFramebufferColorAttachments;
|
||||
|
||||
nsRefPtr<WebGLFramebuffer> mBoundFramebuffer;
|
||||
nsRefPtr<WebGLRenderbuffer> mBoundRenderbuffer;
|
||||
@ -510,6 +507,7 @@ public:
|
||||
void LogMessageIfVerbose(const char *fmt, va_list ap);
|
||||
|
||||
friend class WebGLTexture;
|
||||
friend class WebGLFramebuffer;
|
||||
};
|
||||
|
||||
// this class is a mixin for the named type wrappers, and is used
|
||||
@ -1003,12 +1001,14 @@ public:
|
||||
|
||||
if (!areAllLevel0ImagesDefined) {
|
||||
if (mTarget == LOCAL_GL_TEXTURE_2D) {
|
||||
mContext->LogMessage("We are currently drawing stuff, but some 2D texture has not yet been "
|
||||
"uploaded any image at level 0. Until it's uploaded, this texture will look black.");
|
||||
mContext->LogMessageIfVerbose(
|
||||
"We are currently drawing stuff, but some 2D texture has not yet been "
|
||||
"uploaded any image at level 0. Until it's uploaded, this texture will look black.");
|
||||
} else {
|
||||
mContext->LogMessage("We are currently drawing stuff, but some cube map texture has not yet been "
|
||||
"uploaded any image at level 0, for at least one of its six faces. "
|
||||
"Until it's uploaded, this texture will look black.");
|
||||
mContext->LogMessageIfVerbose(
|
||||
"We are currently drawing stuff, but some cube map texture has not yet been "
|
||||
"uploaded any image at level 0, for at least one of its six faces. "
|
||||
"Until it's uploaded, this texture will look black.");
|
||||
}
|
||||
mFakeBlackStatus = DoNeedFakeBlack;
|
||||
return PR_TRUE;
|
||||
@ -1234,6 +1234,7 @@ public:
|
||||
mMapUniformLocations.Clear();
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
already_AddRefed<WebGLUniformLocation> GetUniformLocationObject(GLint glLocation);
|
||||
|
||||
@ -1265,6 +1266,54 @@ protected:
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLProgram, WEBGLPROGRAM_PRIVATE_IID)
|
||||
|
||||
#define WEBGLRENDERBUFFER_PRIVATE_IID \
|
||||
{0x3cbc2067, 0x5831, 0x4e3f, {0xac, 0x52, 0x7e, 0xf4, 0x5c, 0x04, 0xff, 0xae}}
|
||||
class WebGLRenderbuffer :
|
||||
public nsIWebGLRenderbuffer,
|
||||
public WebGLZeroingObject,
|
||||
public WebGLRectangleObject,
|
||||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLRENDERBUFFER_PRIVATE_IID)
|
||||
|
||||
WebGLRenderbuffer(WebGLContext *context, WebGLuint name, WebGLuint secondBufferName = 0) :
|
||||
WebGLContextBoundObject(context),
|
||||
mName(name),
|
||||
mInternalFormat(0),
|
||||
mDeleted(PR_FALSE), mInitialized(PR_FALSE)
|
||||
{ }
|
||||
|
||||
void Delete() {
|
||||
if (mDeleted)
|
||||
return;
|
||||
ZeroOwners();
|
||||
mDeleted = PR_TRUE;
|
||||
}
|
||||
PRBool Deleted() const { return mDeleted; }
|
||||
WebGLuint GLName() const { return mName; }
|
||||
|
||||
PRBool Initialized() const { return mInitialized; }
|
||||
void SetInitialized(PRBool aInitialized) { mInitialized = aInitialized; }
|
||||
|
||||
WebGLenum InternalFormat() const { return mInternalFormat; }
|
||||
void SetInternalFormat(WebGLenum aInternalFormat) { mInternalFormat = aInternalFormat; }
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBGLRENDERBUFFER
|
||||
|
||||
protected:
|
||||
WebGLuint mName;
|
||||
WebGLenum mInternalFormat;
|
||||
|
||||
PRBool mDeleted;
|
||||
PRBool mInitialized;
|
||||
|
||||
friend class WebGLFramebuffer;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLRenderbuffer, WEBGLRENDERBUFFER_PRIVATE_IID)
|
||||
|
||||
#define WEBGLFRAMEBUFFER_PRIVATE_IID \
|
||||
{0x0052a16f, 0x4bc9, 0x4a55, {0x9d, 0xa3, 0x54, 0x95, 0xaa, 0x4e, 0x80, 0xb9}}
|
||||
class WebGLFramebuffer :
|
||||
@ -1278,7 +1327,10 @@ public:
|
||||
|
||||
WebGLFramebuffer(WebGLContext *context, WebGLuint name) :
|
||||
WebGLContextBoundObject(context),
|
||||
mName(name), mDeleted(PR_FALSE)
|
||||
mName(name), mDeleted(PR_FALSE),
|
||||
mHasDepthAttachment(PR_FALSE),
|
||||
mHasStencilAttachment(PR_FALSE),
|
||||
mHasDepthStencilAttachment(PR_FALSE)
|
||||
{ }
|
||||
|
||||
void Delete() {
|
||||
@ -1290,49 +1342,285 @@ public:
|
||||
PRBool Deleted() { return mDeleted; }
|
||||
WebGLuint GLName() { return mName; }
|
||||
|
||||
nsresult FramebufferRenderbuffer(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum rbtarget,
|
||||
nsIWebGLRenderbuffer *rbobj)
|
||||
{
|
||||
WebGLuint renderbuffername;
|
||||
PRBool isNull;
|
||||
WebGLRenderbuffer *wrb;
|
||||
|
||||
if (!mContext->GetConcreteObjectAndGLName("framebufferRenderbuffer: renderbuffer",
|
||||
rbobj, &wrb, &renderbuffername, &isNull))
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (target != LOCAL_GL_FRAMEBUFFER)
|
||||
return mContext->ErrorInvalidEnumInfo("framebufferRenderbuffer: target", target);
|
||||
|
||||
if (rbtarget != LOCAL_GL_RENDERBUFFER)
|
||||
return mContext->ErrorInvalidEnumInfo("framebufferRenderbuffer: renderbuffer target:", rbtarget);
|
||||
|
||||
const char *badAttachmentFormatMsg =
|
||||
"framebufferRenderbuffer: this renderbuffer does not have a suitable format for this attachment point";
|
||||
|
||||
switch (attachment) {
|
||||
case LOCAL_GL_DEPTH_ATTACHMENT:
|
||||
if (!isNull) {
|
||||
if (wrb->mInternalFormat != LOCAL_GL_DEPTH_COMPONENT16)
|
||||
return mContext->ErrorInvalidOperation(badAttachmentFormatMsg);
|
||||
}
|
||||
mDepthOrStencilRenderbufferAttachment = wrb;
|
||||
mHasDepthAttachment = !isNull;
|
||||
break;
|
||||
case LOCAL_GL_STENCIL_ATTACHMENT:
|
||||
if (!isNull) {
|
||||
if (wrb->mInternalFormat != LOCAL_GL_STENCIL_INDEX8)
|
||||
return mContext->ErrorInvalidOperation(badAttachmentFormatMsg);
|
||||
}
|
||||
mDepthOrStencilRenderbufferAttachment = wrb;
|
||||
mHasStencilAttachment = !isNull;
|
||||
break;
|
||||
case LOCAL_GL_DEPTH_STENCIL_ATTACHMENT:
|
||||
if (!isNull) {
|
||||
if (wrb->mInternalFormat != LOCAL_GL_DEPTH_STENCIL)
|
||||
return mContext->ErrorInvalidOperation(badAttachmentFormatMsg);
|
||||
}
|
||||
mDepthOrStencilRenderbufferAttachment = wrb;
|
||||
mHasDepthStencilAttachment = !isNull;
|
||||
break;
|
||||
default:
|
||||
// finish checking that the 'attachment' parameter is among the allowed values
|
||||
if ((attachment < LOCAL_GL_COLOR_ATTACHMENT0 ||
|
||||
attachment >= LOCAL_GL_COLOR_ATTACHMENT0 + mContext->mMaxFramebufferColorAttachments))
|
||||
{
|
||||
return mContext->ErrorInvalidEnumInfo("framebufferRenderbuffer: attachment", attachment);
|
||||
}
|
||||
if (!isNull) {
|
||||
if (wrb->mInternalFormat != LOCAL_GL_RGBA4 &&
|
||||
wrb->mInternalFormat != LOCAL_GL_RGB565 &&
|
||||
wrb->mInternalFormat != LOCAL_GL_RGB5_A1)
|
||||
{
|
||||
return mContext->ErrorInvalidOperation(badAttachmentFormatMsg);
|
||||
}
|
||||
}
|
||||
mColorRenderbufferAttachment = wrb;
|
||||
break;
|
||||
}
|
||||
|
||||
// dimensions are kept for readPixels primarily, function only uses COLOR_ATTACHMENT0
|
||||
if (attachment == LOCAL_GL_COLOR_ATTACHMENT0)
|
||||
setDimensions(wrb);
|
||||
|
||||
mContext->MakeContextCurrent();
|
||||
mContext->gl->fFramebufferRenderbuffer(target, attachment, rbtarget, renderbuffername);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult FramebufferTexture2D(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum textarget,
|
||||
nsIWebGLTexture *tobj,
|
||||
WebGLint level)
|
||||
{
|
||||
WebGLuint texturename;
|
||||
PRBool isNull;
|
||||
WebGLTexture *wtex;
|
||||
|
||||
if (!mContext->GetConcreteObjectAndGLName("framebufferTexture2D: texture",
|
||||
tobj, &wtex, &texturename, &isNull))
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (target != LOCAL_GL_FRAMEBUFFER)
|
||||
return mContext->ErrorInvalidEnumInfo("framebufferTexture2D: target", target);
|
||||
|
||||
if (!isNull && textarget != LOCAL_GL_TEXTURE_2D &&
|
||||
(textarget < LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
|
||||
textarget > LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))
|
||||
return mContext->ErrorInvalidEnumInfo("framebufferTexture2D: invalid texture target", textarget);
|
||||
|
||||
if (!isNull && level > 0)
|
||||
return mContext->ErrorInvalidValue("framebufferTexture2D: level must be 0");
|
||||
|
||||
switch (attachment) {
|
||||
case LOCAL_GL_DEPTH_ATTACHMENT:
|
||||
case LOCAL_GL_STENCIL_ATTACHMENT:
|
||||
case LOCAL_GL_DEPTH_STENCIL_ATTACHMENT:
|
||||
return mContext->ErrorInvalidOperation("framebufferTexture2D: depth and stencil attachments can "
|
||||
"only be renderbuffers, not textures, as there is no suitable texture format.");
|
||||
break;
|
||||
default:
|
||||
if ((attachment < LOCAL_GL_COLOR_ATTACHMENT0 ||
|
||||
attachment >= LOCAL_GL_COLOR_ATTACHMENT0 + mContext->mMaxFramebufferColorAttachments))
|
||||
{
|
||||
return mContext->ErrorInvalidEnumInfo("framebufferTexture2D: attachment", attachment);
|
||||
}
|
||||
// nothing to do for color buffers. all textures have a color-renderable format.
|
||||
break;
|
||||
}
|
||||
|
||||
// dimensions are kept for readPixels primarily, function only uses COLOR_ATTACHMENT0
|
||||
if (attachment == LOCAL_GL_COLOR_ATTACHMENT0)
|
||||
setDimensions(wtex);
|
||||
|
||||
mContext->MakeContextCurrent();
|
||||
mContext->gl->fFramebufferTexture2D(target, attachment, textarget, texturename, level);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// implement inline, as it's performance critical (called by draw-functions).
|
||||
// the generic case for which we're optimizing is the case where there's nothing to initialize.
|
||||
inline PRBool CheckAndInitializeRenderbuffers()
|
||||
{
|
||||
if (HasConflictingAttachments()) {
|
||||
mContext->SynthesizeGLError(LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION);
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if ((mColorRenderbufferAttachment && !mColorRenderbufferAttachment->Initialized()) ||
|
||||
(mDepthOrStencilRenderbufferAttachment && !mDepthOrStencilRenderbufferAttachment->Initialized()))
|
||||
{
|
||||
InitializeRenderbuffers();
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBGLFRAMEBUFFER
|
||||
|
||||
PRBool HasConflictingAttachments() const {
|
||||
return int(mHasDepthAttachment) +
|
||||
int(mHasStencilAttachment) +
|
||||
int(mHasDepthStencilAttachment) > 1;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// protected because WebGLContext should only call InitializeRenderbuffers
|
||||
void InitializeRenderbuffers()
|
||||
{
|
||||
mContext->MakeContextCurrent();
|
||||
|
||||
if (mContext->gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) != LOCAL_GL_FRAMEBUFFER_COMPLETE)
|
||||
return;
|
||||
|
||||
PRBool initializeColorBuffer = mColorRenderbufferAttachment &&
|
||||
!mColorRenderbufferAttachment->Initialized();
|
||||
PRBool initializeDepthOrStencilBuffer = mDepthOrStencilRenderbufferAttachment &&
|
||||
!mDepthOrStencilRenderbufferAttachment->Initialized();
|
||||
PRBool initializeDepthBuffer = initializeDepthOrStencilBuffer && HasDepthBuffer();
|
||||
PRBool initializeStencilBuffer = initializeDepthOrStencilBuffer && HasStencilBuffer();
|
||||
|
||||
realGLboolean savedColorMask[] = {0}, savedDepthMask = 0;
|
||||
GLuint savedStencilMask = 0;
|
||||
GLfloat savedColorClearValue[] = {0.f}, savedDepthClearValue = 0.f;
|
||||
GLint savedStencilClearValue = 0;
|
||||
GLuint clearBits = 0;
|
||||
|
||||
realGLboolean wasScissorTestEnabled = mContext->gl->fIsEnabled(LOCAL_GL_SCISSOR_TEST);
|
||||
mContext->gl->fDisable(LOCAL_GL_SCISSOR_TEST);
|
||||
|
||||
realGLboolean wasDitherEnabled = mContext->gl->fIsEnabled(LOCAL_GL_DITHER);
|
||||
mContext->gl->fDisable(LOCAL_GL_DITHER);
|
||||
|
||||
mContext->gl->PushViewportRect(nsIntRect(0,0,width(),height()));
|
||||
|
||||
if (initializeColorBuffer) {
|
||||
mContext->gl->fGetBooleanv(LOCAL_GL_COLOR_WRITEMASK, savedColorMask);
|
||||
mContext->gl->fGetFloatv(LOCAL_GL_COLOR_CLEAR_VALUE, savedColorClearValue);
|
||||
mContext->gl->fColorMask(1, 1, 1, 1);
|
||||
mContext->gl->fClearColor(0.f, 0.f, 0.f, 0.f);
|
||||
clearBits |= LOCAL_GL_COLOR_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if (initializeDepthBuffer) {
|
||||
mContext->gl->fGetBooleanv(LOCAL_GL_DEPTH_WRITEMASK, &savedDepthMask);
|
||||
mContext->gl->fGetFloatv(LOCAL_GL_DEPTH_CLEAR_VALUE, &savedDepthClearValue);
|
||||
mContext->gl->fDepthMask(1);
|
||||
mContext->gl->fClearDepth(0.f);
|
||||
clearBits |= LOCAL_GL_DEPTH_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if (initializeStencilBuffer) {
|
||||
mContext->gl->fGetIntegerv(LOCAL_GL_STENCIL_WRITEMASK, reinterpret_cast<GLint*>(&savedStencilMask));
|
||||
mContext->gl->fGetIntegerv(LOCAL_GL_STENCIL_CLEAR_VALUE, &savedStencilClearValue);
|
||||
mContext->gl->fStencilMask(0xffffffff);
|
||||
mContext->gl->fClearStencil(0);
|
||||
clearBits |= LOCAL_GL_STENCIL_BUFFER_BIT;
|
||||
}
|
||||
|
||||
// the one useful line of code
|
||||
mContext->gl->fClear(clearBits);
|
||||
|
||||
if (initializeColorBuffer) {
|
||||
mContext->gl->fColorMask(savedColorMask[0],
|
||||
savedColorMask[1],
|
||||
savedColorMask[2],
|
||||
savedColorMask[3]);
|
||||
mContext->gl->fClearColor(savedColorClearValue[0],
|
||||
savedColorClearValue[1],
|
||||
savedColorClearValue[2],
|
||||
savedColorClearValue[3]);
|
||||
mColorRenderbufferAttachment->SetInitialized(PR_TRUE);
|
||||
}
|
||||
|
||||
if (initializeDepthBuffer) {
|
||||
mContext->gl->fDepthMask(savedDepthMask);
|
||||
mContext->gl->fClearDepth(savedDepthClearValue);
|
||||
mDepthOrStencilRenderbufferAttachment->SetInitialized(PR_TRUE);
|
||||
}
|
||||
|
||||
if (initializeStencilBuffer) {
|
||||
mContext->gl->fStencilMask(savedStencilMask);
|
||||
mContext->gl->fClearStencil(savedStencilClearValue);
|
||||
mDepthOrStencilRenderbufferAttachment->SetInitialized(PR_TRUE);
|
||||
}
|
||||
|
||||
mContext->gl->PopViewportRect();
|
||||
|
||||
if (wasDitherEnabled)
|
||||
mContext->gl->fEnable(LOCAL_GL_DITHER);
|
||||
else
|
||||
mContext->gl->fDisable(LOCAL_GL_DITHER);
|
||||
|
||||
if (wasScissorTestEnabled)
|
||||
mContext->gl->fEnable(LOCAL_GL_DITHER);
|
||||
else
|
||||
mContext->gl->fDisable(LOCAL_GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
PRBool HasDepthBuffer() const {
|
||||
return mHasDepthAttachment || mHasDepthStencilAttachment;
|
||||
}
|
||||
|
||||
PRBool HasStencilBuffer() const {
|
||||
return mHasStencilAttachment || mHasDepthStencilAttachment;
|
||||
}
|
||||
|
||||
WebGLuint mName;
|
||||
PRBool mDeleted;
|
||||
|
||||
// we only store pointers to attached renderbuffers, not to attached textures, because
|
||||
// we will only need to initialize renderbuffers. Textures are already initialized.
|
||||
nsRefPtr<WebGLRenderbuffer> mColorRenderbufferAttachment;
|
||||
nsRefPtr<WebGLRenderbuffer> mDepthOrStencilRenderbufferAttachment;
|
||||
|
||||
// these boolean values keep track of all attachments: renderbuffers and textures.
|
||||
// thus they are not at all redundant with the above member pointers.
|
||||
PRBool mHasDepthAttachment;
|
||||
PRBool mHasStencilAttachment;
|
||||
PRBool mHasDepthStencilAttachment;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLFramebuffer, WEBGLFRAMEBUFFER_PRIVATE_IID)
|
||||
|
||||
#define WEBGLRENDERBUFFER_PRIVATE_IID \
|
||||
{0x3cbc2067, 0x5831, 0x4e3f, {0xac, 0x52, 0x7e, 0xf4, 0x5c, 0x04, 0xff, 0xae}}
|
||||
class WebGLRenderbuffer :
|
||||
public nsIWebGLRenderbuffer,
|
||||
public WebGLZeroingObject,
|
||||
public WebGLRectangleObject,
|
||||
public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLRENDERBUFFER_PRIVATE_IID)
|
||||
|
||||
WebGLRenderbuffer(WebGLContext *context, WebGLuint name) :
|
||||
WebGLContextBoundObject(context),
|
||||
mName(name), mDeleted(PR_FALSE)
|
||||
{ }
|
||||
|
||||
void Delete() {
|
||||
if (mDeleted)
|
||||
return;
|
||||
ZeroOwners();
|
||||
mDeleted = PR_TRUE;
|
||||
}
|
||||
PRBool Deleted() { return mDeleted; }
|
||||
WebGLuint GLName() { return mName; }
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWEBGLRENDERBUFFER
|
||||
protected:
|
||||
WebGLuint mName;
|
||||
PRBool mDeleted;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(WebGLRenderbuffer, WEBGLRENDERBUFFER_PRIVATE_IID)
|
||||
|
||||
#define WEBGLUNIFORMLOCATION_PRIVATE_IID \
|
||||
{0x01a8a614, 0xb109, 0x42f1, {0xb4, 0x40, 0x8d, 0x8b, 0x87, 0x0b, 0x43, 0xa7}}
|
||||
class WebGLUniformLocation :
|
||||
|
@ -349,7 +349,7 @@ NS_IMETHODIMP
|
||||
WebGLContext::BufferData(PRInt32 dummy)
|
||||
{
|
||||
// this should never be called
|
||||
LogMessage("BufferData");
|
||||
LogMessageIfVerbose("BufferData");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@ -522,9 +522,13 @@ WebGLContext::CheckFramebufferStatus(WebGLenum target, WebGLenum *retval)
|
||||
|
||||
MakeContextCurrent();
|
||||
if (target != LOCAL_GL_FRAMEBUFFER)
|
||||
return ErrorInvalidEnum("CheckFramebufferStatus: target must be FRAMEBUFFER");
|
||||
return ErrorInvalidEnum("checkFramebufferStatus: target must be FRAMEBUFFER");
|
||||
|
||||
if (mBoundFramebuffer && mBoundFramebuffer->HasConflictingAttachments())
|
||||
*retval = LOCAL_GL_FRAMEBUFFER_UNSUPPORTED;
|
||||
else
|
||||
*retval = gl->fCheckFramebufferStatus(target);
|
||||
|
||||
*retval = gl->fCheckFramebufferStatus(target);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -532,6 +536,10 @@ NS_IMETHODIMP
|
||||
WebGLContext::Clear(PRUint32 mask)
|
||||
{
|
||||
MakeContextCurrent();
|
||||
|
||||
if (mBoundFramebuffer && !mBoundFramebuffer->CheckAndInitializeRenderbuffers())
|
||||
return NS_OK;
|
||||
|
||||
gl->fClear(mask);
|
||||
Invalidate();
|
||||
|
||||
@ -760,6 +768,7 @@ WebGLContext::DeleteRenderbuffer(nsIWebGLRenderbuffer *rbobj)
|
||||
*/
|
||||
|
||||
gl->fDeleteRenderbuffers(1, &rbufname);
|
||||
|
||||
rbuf->Delete();
|
||||
mMapRenderbuffers.Remove(rbufname);
|
||||
|
||||
@ -1047,6 +1056,9 @@ WebGLContext::DrawArrays(GLenum mode, WebGLint first, WebGLsizei count)
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
if (mBoundFramebuffer && !mBoundFramebuffer->CheckAndInitializeRenderbuffers())
|
||||
return NS_OK;
|
||||
|
||||
BindFakeBlackTextures();
|
||||
DoFakeVertexAttrib0(checked_firstPlusCount.value());
|
||||
|
||||
@ -1124,6 +1136,9 @@ WebGLContext::DrawElements(WebGLenum mode, WebGLsizei count, WebGLenum type, Web
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
if (mBoundFramebuffer && !mBoundFramebuffer->CheckAndInitializeRenderbuffers())
|
||||
return NS_OK;
|
||||
|
||||
BindFakeBlackTextures();
|
||||
DoFakeVertexAttrib0(checked_neededCount.value());
|
||||
|
||||
@ -1171,43 +1186,13 @@ WebGLContext::EnableVertexAttribArray(WebGLuint index)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// XXX need to track this -- see glDeleteRenderbuffer above and man page for DeleteRenderbuffers
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::FramebufferRenderbuffer(WebGLenum target, WebGLenum attachment, WebGLenum rbtarget, nsIWebGLRenderbuffer *rbobj)
|
||||
{
|
||||
WebGLuint renderbuffername;
|
||||
PRBool isNull;
|
||||
WebGLRenderbuffer *wrb;
|
||||
|
||||
if (!GetConcreteObjectAndGLName("framebufferRenderbuffer: renderbuffer", rbobj, &wrb, &renderbuffername, &isNull))
|
||||
return NS_OK;
|
||||
|
||||
if (target != LOCAL_GL_FRAMEBUFFER)
|
||||
return ErrorInvalidEnumInfo("framebufferRenderbuffer: target", target);
|
||||
|
||||
if ((attachment < LOCAL_GL_COLOR_ATTACHMENT0 ||
|
||||
attachment >= LOCAL_GL_COLOR_ATTACHMENT0 + mFramebufferColorAttachments.Length()) &&
|
||||
attachment != LOCAL_GL_DEPTH_ATTACHMENT &&
|
||||
attachment != LOCAL_GL_STENCIL_ATTACHMENT)
|
||||
{
|
||||
return ErrorInvalidEnumInfo("framebufferRenderbuffer: attachment", attachment);
|
||||
}
|
||||
|
||||
if (rbtarget != LOCAL_GL_RENDERBUFFER)
|
||||
return ErrorInvalidEnumInfo("framebufferRenderbuffer: renderbuffer target:", rbtarget);
|
||||
|
||||
if (!mBoundFramebuffer)
|
||||
return ErrorInvalidOperation("FramebufferRenderbuffer: cannot modify framebuffer 0");
|
||||
|
||||
// dimensions are kept for readPixels primarily, function only uses COLOR_ATTACHMENT0
|
||||
if (attachment == LOCAL_GL_COLOR_ATTACHMENT0)
|
||||
mBoundFramebuffer->setDimensions(wrb);
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
gl->fFramebufferRenderbuffer(target, attachment, rbtarget, renderbuffername);
|
||||
|
||||
return NS_OK;
|
||||
if (mBoundFramebuffer)
|
||||
return mBoundFramebuffer->FramebufferRenderbuffer(target, attachment, rbtarget, rbobj);
|
||||
else
|
||||
return ErrorInvalidOperation("framebufferRenderbuffer: cannot modify framebuffer 0");
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -1217,44 +1202,10 @@ WebGLContext::FramebufferTexture2D(WebGLenum target,
|
||||
nsIWebGLTexture *tobj,
|
||||
WebGLint level)
|
||||
{
|
||||
WebGLuint texturename;
|
||||
PRBool isNull;
|
||||
WebGLTexture *wtex;
|
||||
|
||||
if (!GetConcreteObjectAndGLName("framebufferTexture2D: texture", tobj, &wtex, &texturename, &isNull))
|
||||
return NS_OK;
|
||||
|
||||
if (target != LOCAL_GL_FRAMEBUFFER)
|
||||
return ErrorInvalidEnumInfo("framebufferTexture2D: target", target);
|
||||
|
||||
if ((attachment < LOCAL_GL_COLOR_ATTACHMENT0 ||
|
||||
attachment >= LOCAL_GL_COLOR_ATTACHMENT0 + mFramebufferColorAttachments.Length()) &&
|
||||
attachment != LOCAL_GL_DEPTH_ATTACHMENT &&
|
||||
attachment != LOCAL_GL_STENCIL_ATTACHMENT)
|
||||
return ErrorInvalidEnumInfo("framebufferTexture2D: attachment", attachment);
|
||||
|
||||
if (textarget != LOCAL_GL_TEXTURE_2D &&
|
||||
(textarget < LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
|
||||
textarget > LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))
|
||||
return ErrorInvalidEnumInfo("framebufferTexture2D: invalid texture target", textarget);
|
||||
|
||||
if (level != 0)
|
||||
return ErrorInvalidValue("FramebufferTexture2D: level must be 0");
|
||||
|
||||
if (!mBoundFramebuffer)
|
||||
return ErrorInvalidOperation("FramebufferTexture2D: cannot modify framebuffer 0");
|
||||
|
||||
// dimensions are kept for readPixels primarily, function only uses COLOR_ATTACHMENT0
|
||||
if (attachment == LOCAL_GL_COLOR_ATTACHMENT0)
|
||||
mBoundFramebuffer->setDimensions(wtex);
|
||||
|
||||
// XXXXX we need to store/reference this attachment!
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
gl->fFramebufferTexture2D(target, attachment, textarget, texturename, level);
|
||||
|
||||
return NS_OK;
|
||||
if (mBoundFramebuffer)
|
||||
return mBoundFramebuffer->FramebufferTexture2D(target, attachment, textarget, tobj, level);
|
||||
else
|
||||
return ErrorInvalidOperation("framebufferTexture2D: cannot modify framebuffer 0");
|
||||
}
|
||||
|
||||
GL_SAME_METHOD_0(Flush, Flush)
|
||||
@ -1639,7 +1590,7 @@ WebGLContext::GetParameter(PRUint32 pname, nsIVariant **retval)
|
||||
case LOCAL_GL_SCISSOR_BOX: // 4 ints
|
||||
case LOCAL_GL_VIEWPORT: // 4 ints
|
||||
{
|
||||
GLint iv[2] = { 0 };
|
||||
GLint iv[4] = { 0 };
|
||||
gl->fGetIntegerv(pname, iv);
|
||||
wrval->SetAsArray(nsIDataType::VTYPE_INT32, nsnull,
|
||||
4, static_cast<void*>(iv));
|
||||
@ -2540,8 +2491,6 @@ WebGLContext::ReadPixels_base(WebGLint x, WebGLint y, WebGLsizei width, WebGLsiz
|
||||
return ErrorInvalidEnumInfo("ReadPixels: type", type);
|
||||
}
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
CheckedUint32 checked_plainRowSize = CheckedUint32(width) * size;
|
||||
|
||||
PRUint32 packAlignment = mPixelStorePackAlignment;
|
||||
@ -2559,6 +2508,12 @@ WebGLContext::ReadPixels_base(WebGLint x, WebGLint y, WebGLsizei width, WebGLsiz
|
||||
if (checked_neededByteLength.value() > byteLength)
|
||||
return ErrorInvalidOperation("ReadPixels: buffer too small");
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
// prevent readback of arbitrary video memory through uninitialized renderbuffers!
|
||||
if (mBoundFramebuffer && !mBoundFramebuffer->CheckAndInitializeRenderbuffers())
|
||||
return NS_OK;
|
||||
|
||||
if (CanvasUtils::CheckSaneSubrectSize(x, y, width, height, boundWidth, boundHeight)) {
|
||||
// the easy case: we're not reading out-of-range pixels
|
||||
gl->fReadPixels(x, y, width, height, format, type, data);
|
||||
@ -2645,32 +2600,57 @@ WebGLContext::ReadPixels_buf(WebGLint x, WebGLint y, WebGLsizei width, WebGLsize
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::RenderbufferStorage(WebGLenum target, WebGLenum internalformat, WebGLsizei width, WebGLsizei height)
|
||||
{
|
||||
if (target != LOCAL_GL_RENDERBUFFER)
|
||||
return ErrorInvalidEnumInfo("RenderbufferStorage: target", target);
|
||||
|
||||
switch (internalformat) {
|
||||
case LOCAL_GL_RGBA4:
|
||||
// XXX case LOCAL_GL_RGB565:
|
||||
case LOCAL_GL_RGB5_A1:
|
||||
case LOCAL_GL_DEPTH_COMPONENT:
|
||||
case LOCAL_GL_DEPTH_COMPONENT16:
|
||||
case LOCAL_GL_STENCIL_INDEX8:
|
||||
break;
|
||||
default:
|
||||
return ErrorInvalidEnumInfo("RenderbufferStorage: internalformat", internalformat);
|
||||
}
|
||||
if (!mBoundRenderbuffer || !mBoundRenderbuffer->GLName())
|
||||
return ErrorInvalidOperation("renderbufferStorage called on renderbuffer 0");
|
||||
|
||||
if (target != LOCAL_GL_RENDERBUFFER)
|
||||
return ErrorInvalidEnumInfo("renderbufferStorage: target", target);
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return ErrorInvalidValue("RenderbufferStorage: width and height must be > 0");
|
||||
return ErrorInvalidValue("renderbufferStorage: width and height must be > 0");
|
||||
|
||||
if (mBoundRenderbuffer)
|
||||
mBoundRenderbuffer->setDimensions(width, height);
|
||||
if (!mBoundRenderbuffer || !mBoundRenderbuffer->GLName())
|
||||
return ErrorInvalidOperation("renderbufferStorage called on renderbuffer 0");
|
||||
|
||||
MakeContextCurrent();
|
||||
gl->fRenderbufferStorage(target, internalformat, width, height);
|
||||
|
||||
// now we need to initialize the renderbuffer to 0 as per the thread "about RenderBufferStorage"
|
||||
// on the public_webgl list
|
||||
// certain OpenGL ES renderbuffer formats may not exist on desktop OpenGL
|
||||
WebGLenum internalformatForGL = internalformat;
|
||||
|
||||
switch (internalformat) {
|
||||
case LOCAL_GL_RGBA4:
|
||||
case LOCAL_GL_RGB5_A1:
|
||||
// 16-bit RGBA formats are not supported on desktop GL
|
||||
if (!gl->IsGLES2()) internalformatForGL = LOCAL_GL_RGBA8;
|
||||
break;
|
||||
case LOCAL_GL_RGB565:
|
||||
// the RGB565 format is not supported on desktop GL
|
||||
if (!gl->IsGLES2()) internalformatForGL = LOCAL_GL_RGB8;
|
||||
break;
|
||||
case LOCAL_GL_DEPTH_COMPONENT16:
|
||||
case LOCAL_GL_STENCIL_INDEX8:
|
||||
// nothing to do for these ones
|
||||
break;
|
||||
case LOCAL_GL_DEPTH_STENCIL:
|
||||
// this one is available in newer OpenGL (at least since 3.1); will probably become available
|
||||
// in OpenGL ES 3 (at least it will have some DEPTH_STENCIL) and is the same value that
|
||||
// is otherwise provided by EXT_packed_depth_stencil and OES_packed_depth_stencil extensions
|
||||
// which means it's supported on most GL and GL ES systems already.
|
||||
//
|
||||
// So we just use it hoping that it's available (perhaps as an extension) and if it's not available,
|
||||
// we just let the GL generate an error and don't do anything about it ourselves.
|
||||
internalformatForGL = LOCAL_GL_DEPTH24_STENCIL8;
|
||||
break;
|
||||
default:
|
||||
ErrorInvalidEnumInfo("renderbufferStorage: internalformat", internalformat);
|
||||
}
|
||||
|
||||
gl->fRenderbufferStorage(target, internalformatForGL, width, height);
|
||||
|
||||
mBoundRenderbuffer->SetInternalFormat(internalformat);
|
||||
mBoundRenderbuffer->setDimensions(width, height);
|
||||
mBoundRenderbuffer->SetInitialized(PR_FALSE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -3183,6 +3163,14 @@ WebGLContext::ValidateProgram(nsIWebGLProgram *pobj)
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
if (gl->Vendor() == gl::GLContext::VendorNVIDIA) {
|
||||
LogMessageIfVerbose("validateProgram: implemented as a no-operation "
|
||||
"on Mac/NVIDIA to work around a driver crash");
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
gl->fValidateProgram(progname);
|
||||
|
||||
return NS_OK;
|
||||
@ -3245,7 +3233,6 @@ WebGLContext::CompileShader(nsIWebGLShader *sobj)
|
||||
#if defined(USE_ANGLE)
|
||||
if (shader->NeedsTranslation() && mShaderValidation) {
|
||||
ShHandle compiler = 0;
|
||||
int debugFlags = 0;
|
||||
ShBuiltInResources resources;
|
||||
memset(&resources, 0, sizeof(ShBuiltInResources));
|
||||
|
||||
|
@ -362,10 +362,6 @@ WebGLContext::InitAndValidateGL()
|
||||
mBoundElementArrayBuffer = nsnull;
|
||||
mCurrentProgram = nsnull;
|
||||
|
||||
mFramebufferColorAttachments.Clear();
|
||||
mFramebufferDepthAttachment = nsnull;
|
||||
mFramebufferStencilAttachment = nsnull;
|
||||
|
||||
mBoundFramebuffer = nsnull;
|
||||
mBoundRenderbuffer = nsnull;
|
||||
|
||||
@ -433,7 +429,7 @@ WebGLContext::InitAndValidateGL()
|
||||
// Always 1 for GLES2
|
||||
val = 1;
|
||||
#endif
|
||||
mFramebufferColorAttachments.SetLength(val);
|
||||
mMaxFramebufferColorAttachments = val;
|
||||
|
||||
#if defined(DEBUG_vladimir) && defined(USE_GLES2)
|
||||
gl->fGetIntegerv(LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT, (GLint*) &val);
|
||||
|
@ -3,9 +3,6 @@ conformance/constants.html
|
||||
conformance/context-attributes-alpha-depth-stencil-antialias.html
|
||||
conformance/context-attributes.html
|
||||
conformance/context-type-test.html
|
||||
conformance/framebuffer-object-attachment.html
|
||||
conformance/get-active-test.html
|
||||
conformance/gl-enum-tests.html
|
||||
conformance/gl-get-calls.html
|
||||
conformance/gl-teximage.html
|
||||
conformance/glsl-conformance.html
|
||||
@ -13,10 +10,8 @@ conformance/methods.html
|
||||
conformance/program-test.html
|
||||
conformance/read-pixels-pack-alignment.html
|
||||
conformance/tex-image-and-sub-image-2d-with-video.html
|
||||
conformance/tex-image-with-format-and-type.html
|
||||
conformance/tex-image-with-invalid-data.html
|
||||
conformance/tex-input-validation.html
|
||||
conformance/texture-active-bind.html
|
||||
more/conformance/constants.html
|
||||
more/conformance/getContext.html
|
||||
more/conformance/quickCheckAPI.html
|
||||
|
@ -51,7 +51,7 @@ class nsHTMLAudioElement : public nsHTMLMediaElement,
|
||||
{
|
||||
public:
|
||||
nsHTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLAudioElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
};
|
||||
|
||||
nsHTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLMediaElement();
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ class nsHTMLVideoElement : public nsHTMLMediaElement,
|
||||
{
|
||||
public:
|
||||
nsHTMLVideoElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLVideoElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -2322,6 +2322,10 @@ nsGenericHTMLFormElement::nsGenericHTMLFormElement(already_AddRefed<nsINodeInfo>
|
||||
|
||||
nsGenericHTMLFormElement::~nsGenericHTMLFormElement()
|
||||
{
|
||||
if (mFieldSet) {
|
||||
static_cast<nsHTMLFieldSetElement*>(mFieldSet)->RemoveElement(this);
|
||||
}
|
||||
|
||||
// Check that this element doesn't know anything about its form at this point.
|
||||
NS_ASSERTION(!mForm, "mForm should be null at this point!");
|
||||
}
|
||||
@ -2939,13 +2943,20 @@ nsGenericHTMLFormElement::UpdateFieldSet()
|
||||
static_cast<nsHTMLFieldSetElement*>(parent);
|
||||
|
||||
if (!prev || fieldset->GetFirstLegend() != prev) {
|
||||
if (mFieldSet) {
|
||||
static_cast<nsHTMLFieldSetElement*>(mFieldSet)->RemoveElement(this);
|
||||
}
|
||||
mFieldSet = fieldset;
|
||||
fieldset->AddElement(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No fieldset found.
|
||||
if (mFieldSet) {
|
||||
static_cast<nsHTMLFieldSetElement*>(mFieldSet)->RemoveElement(this);
|
||||
}
|
||||
mFieldSet = nsnull;
|
||||
}
|
||||
|
||||
|
@ -874,6 +874,19 @@ public:
|
||||
FieldSetDisabledChanged(nsEventStates(), aNotify);
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback is called by a fieldset on all it's elements when it's being
|
||||
* destroyed. When called, the elements should check that aFieldset is there
|
||||
* first parent fieldset and null mFieldset in that case only.
|
||||
*
|
||||
* @param aFieldSet The fieldset being removed.
|
||||
*/
|
||||
void ForgetFieldSet(nsIContent* aFieldset) {
|
||||
if (mFieldSet == aFieldset) {
|
||||
mFieldSet = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the control can be disabled.
|
||||
*/
|
||||
@ -987,10 +1000,10 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
|
||||
{
|
||||
public:
|
||||
nsGenericHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
mozilla::dom::FromParser aFromParser)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
mNetworkCreated = aFromParser == NS_FROM_PARSER_NETWORK;
|
||||
mNetworkCreated = aFromParser == mozilla::dom::FROM_PARSER_NETWORK;
|
||||
}
|
||||
virtual ~nsGenericHTMLFrameElement();
|
||||
|
||||
@ -1045,25 +1058,6 @@ protected:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A macro to implement the NS_NewHTMLXXXElement() functions.
|
||||
*/
|
||||
#define NS_IMPL_NS_NEW_HTML_ELEMENT(_elementName) \
|
||||
nsGenericHTMLElement* \
|
||||
NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
PRUint32 aFromParser) \
|
||||
{ \
|
||||
return new nsHTML##_elementName##Element(aNodeInfo); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(_elementName) \
|
||||
nsGenericHTMLElement* \
|
||||
NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
PRUint32 aFromParser) \
|
||||
{ \
|
||||
return new nsHTML##_elementName##Element(aNodeInfo, aFromParser); \
|
||||
}
|
||||
|
||||
/**
|
||||
* A macro to implement the getter and setter for a given string
|
||||
* valued content property. The method uses the generic GetAttr and
|
||||
@ -1073,12 +1067,12 @@ NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
NS_IMETHODIMP \
|
||||
_class::Get##_method(nsAString& aValue) \
|
||||
{ \
|
||||
return GetAttrHelper(nsGkAtoms::_atom, aValue); \
|
||||
return GetAttrHelper(nsGkAtoms::_atom, aValue); \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
_class::Set##_method(const nsAString& aValue) \
|
||||
{ \
|
||||
return SetAttrHelper(nsGkAtoms::_atom, aValue); \
|
||||
return SetAttrHelper(nsGkAtoms::_atom, aValue); \
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1430,26 +1424,46 @@ NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
NS_OFFSET_AND_INTERFACE_TABLE_END
|
||||
|
||||
|
||||
// Element class factory methods
|
||||
|
||||
/**
|
||||
* A macro to declare the NS_NewHTMLXXXElement() functions.
|
||||
*/
|
||||
#define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName) \
|
||||
nsGenericHTMLElement* \
|
||||
NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
|
||||
#define NS_DECLARE_NS_NEW_HTML_ELEMENT_AS_SHARED(_elementName) \
|
||||
inline nsGenericHTMLElement* \
|
||||
NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
PRUint32 aFromParser = 0) \
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER) \
|
||||
{ \
|
||||
return NS_NewHTMLSharedElement(aNodeInfo, aFromParser); \
|
||||
}
|
||||
|
||||
/**
|
||||
* A macro to implement the NS_NewHTMLXXXElement() functions.
|
||||
*/
|
||||
#define NS_IMPL_NS_NEW_HTML_ELEMENT(_elementName) \
|
||||
nsGenericHTMLElement* \
|
||||
NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
mozilla::dom::FromParser aFromParser) \
|
||||
{ \
|
||||
return new nsHTML##_elementName##Element(aNodeInfo); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(_elementName) \
|
||||
nsGenericHTMLElement* \
|
||||
NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
|
||||
mozilla::dom::FromParser aFromParser) \
|
||||
{ \
|
||||
return new nsHTML##_elementName##Element(aNodeInfo, aFromParser); \
|
||||
}
|
||||
|
||||
// Here, we expand 'NS_DECLARE_NS_NEW_HTML_ELEMENT()' by hand.
|
||||
// (Calling the macro directly (with no args) produces compiler warnings.)
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(Shared)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedList)
|
||||
|
@ -68,9 +68,11 @@
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMProgressEvent.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
{
|
||||
/*
|
||||
* nsHTMLAudioElement's will be created without a nsINodeInfo passed in
|
||||
@ -107,7 +109,7 @@ NS_IMPL_ELEMENT_CLONE(nsHTMLAudioElement)
|
||||
|
||||
|
||||
nsHTMLAudioElement::nsHTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsHTMLMediaElement(aNodeInfo, aFromParser)
|
||||
{
|
||||
}
|
||||
|
@ -56,11 +56,12 @@
|
||||
#define DEFAULT_CANVAS_HEIGHT 150
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layers;
|
||||
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
{
|
||||
return new nsHTMLCanvasElement(aNodeInfo);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
class nsHTMLElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLElement
|
||||
@ -69,7 +70,7 @@ public:
|
||||
// (Calling the macro directly (with no args) produces compiler warnings.)
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
{
|
||||
return new nsHTMLElement(aNodeInfo);
|
||||
}
|
||||
|
@ -58,6 +58,10 @@ nsHTMLFieldSetElement::nsHTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNode
|
||||
|
||||
nsHTMLFieldSetElement::~nsHTMLFieldSetElement()
|
||||
{
|
||||
PRUint32 length = mDependentElements.Length();
|
||||
for (PRUint32 i=0; i<length; ++i) {
|
||||
mDependentElements[i]->ForgetFieldSet(this);
|
||||
}
|
||||
}
|
||||
|
||||
// nsISupports
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLFieldSetElement.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
#include "nsTPtrArray.h"
|
||||
|
||||
|
||||
class nsHTMLFieldSetElement : public nsGenericHTMLFormElement,
|
||||
@ -87,6 +88,14 @@ public:
|
||||
|
||||
const nsIContent* GetFirstLegend() const { return mFirstLegend; }
|
||||
|
||||
void AddElement(nsGenericHTMLFormElement* aElement) {
|
||||
mDependentElements.AppendElement(aElement);
|
||||
}
|
||||
|
||||
void RemoveElement(nsGenericHTMLFormElement* aElement) {
|
||||
mDependentElements.RemoveElement(aElement);
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLFieldSetElement,
|
||||
nsGenericHTMLFormElement)
|
||||
private:
|
||||
@ -104,6 +113,9 @@ private:
|
||||
// listed form controls elements.
|
||||
nsRefPtr<nsContentList> mElements;
|
||||
|
||||
// List of elements which have this fieldset as first fieldset ancestor.
|
||||
nsTPtrArray<nsGenericHTMLFormElement> mDependentElements;
|
||||
|
||||
nsIContent* mFirstLegend;
|
||||
};
|
||||
|
||||
|
@ -85,6 +85,8 @@
|
||||
|
||||
#include "nsIDOMHTMLButtonElement.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static const int NS_FORM_CONTROL_LIST_HASHTABLE_SIZE = 16;
|
||||
|
||||
static const PRUint8 NS_FORM_AUTOCOMPLETE_ON = 1;
|
||||
@ -234,12 +236,9 @@ ShouldBeInElements(nsIFormControl* aFormControl)
|
||||
// construction, destruction
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
{
|
||||
nsHTMLFormElement* it = new nsHTMLFormElement(aNodeInfo);
|
||||
if (!it) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsresult rv = it->Init();
|
||||
|
||||
|
@ -41,13 +41,14 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
class nsHTMLFrameElement : public nsGenericHTMLFrameElement,
|
||||
public nsIDOMHTMLFrameElement
|
||||
{
|
||||
public:
|
||||
nsHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = NS_NOT_FROM_PARSER);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLFrameElement();
|
||||
|
||||
// nsISupports
|
||||
@ -81,7 +82,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Frame)
|
||||
|
||||
|
||||
nsHTMLFrameElement::nsHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
|
||||
{
|
||||
}
|
||||
|
@ -48,15 +48,17 @@
|
||||
#include "nsRuleData.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
class nsHTMLIFrameElement : public nsGenericHTMLFrameElement,
|
||||
public nsIDOMHTMLIFrameElement
|
||||
using namespace mozilla::dom;
|
||||
|
||||
class nsHTMLIFrameElement : public nsGenericHTMLFrameElement
|
||||
, public nsIDOMHTMLIFrameElement
|
||||
#ifdef MOZ_SVG
|
||||
, public nsIDOMGetSVGDocument
|
||||
, public nsIDOMGetSVGDocument
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
nsHTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = NS_NOT_FROM_PARSER);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLIFrameElement();
|
||||
|
||||
// nsISupports
|
||||
@ -96,7 +98,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(IFrame)
|
||||
|
||||
|
||||
nsHTMLIFrameElement::nsHTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
|
||||
{
|
||||
}
|
||||
|
@ -76,6 +76,8 @@
|
||||
|
||||
#include "nsLayoutUtils.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
// XXX nav attrs: suppress
|
||||
|
||||
class nsHTMLImageElement : public nsGenericHTMLElement,
|
||||
@ -154,7 +156,7 @@ protected:
|
||||
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
{
|
||||
/*
|
||||
* nsHTMLImageElement's will be created without a nsINodeInfo passed in
|
||||
|
@ -127,6 +127,8 @@
|
||||
|
||||
#include "nsHTMLInputElement.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
// XXX align=left, hspace, vspace, border? other nav4 attrs
|
||||
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
@ -612,14 +614,14 @@ static nsresult FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Input)
|
||||
|
||||
nsHTMLInputElement::nsHTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElement(aNodeInfo),
|
||||
mType(kInputDefaultType->value),
|
||||
mBitField(0)
|
||||
{
|
||||
SET_BOOLBIT(mBitField, BF_PARSER_CREATING, aFromParser);
|
||||
SET_BOOLBIT(mBitField, BF_INHIBIT_RESTORATION,
|
||||
aFromParser & NS_FROM_PARSER_FRAGMENT);
|
||||
aFromParser & mozilla::dom::FROM_PARSER_FRAGMENT);
|
||||
mInputData.mState = new nsTextEditorState(this);
|
||||
NS_ADDREF(mInputData.mState);
|
||||
|
||||
@ -702,10 +704,7 @@ nsHTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
|
||||
*aResult = nsnull;
|
||||
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
nsHTMLInputElement *it = new nsHTMLInputElement(ni.forget(), PR_FALSE);
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsHTMLInputElement *it = new nsHTMLInputElement(ni.forget(), NOT_FROM_PARSER);
|
||||
|
||||
nsCOMPtr<nsINode> kungFuDeathGrip = it;
|
||||
nsresult rv = CopyInnerTo(it);
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
|
||||
nsHTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser);
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
virtual ~nsHTMLInputElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -121,6 +121,7 @@ static PRLogModuleInfo* gMediaElementEventsLog;
|
||||
#include "nsIChannelPolicy.h"
|
||||
#include "nsChannelPolicy.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layers;
|
||||
|
||||
// Under certain conditions there may be no-one holding references to
|
||||
@ -226,7 +227,7 @@ public:
|
||||
return nsContentUtils::DispatchTrustedEvent(mElement->GetOwnerDoc(),
|
||||
mSource,
|
||||
NS_LITERAL_STRING("error"),
|
||||
PR_TRUE,
|
||||
PR_FALSE,
|
||||
PR_TRUE);
|
||||
}
|
||||
};
|
||||
@ -1265,7 +1266,7 @@ NS_IMETHODIMP nsHTMLMediaElement::SetMuted(PRBool aMuted)
|
||||
}
|
||||
|
||||
nsHTMLMediaElement::nsHTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mCurrentLoadID(0),
|
||||
mNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY),
|
||||
@ -2265,7 +2266,7 @@ nsresult nsHTMLMediaElement::DispatchEvent(const nsAString& aName)
|
||||
return nsContentUtils::DispatchTrustedEvent(GetOwnerDoc(),
|
||||
static_cast<nsIContent*>(this),
|
||||
aName,
|
||||
PR_TRUE,
|
||||
PR_FALSE,
|
||||
PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -52,20 +52,21 @@
|
||||
#include "nsIPluginInstance.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
class nsHTMLObjectElement : public nsGenericHTMLFormElement,
|
||||
public nsObjectLoadingContent,
|
||||
public nsIDOMHTMLObjectElement,
|
||||
public nsIConstraintValidation
|
||||
class nsHTMLObjectElement : public nsGenericHTMLFormElement
|
||||
, public nsObjectLoadingContent
|
||||
, public nsIDOMHTMLObjectElement
|
||||
, public nsIConstraintValidation
|
||||
#ifdef MOZ_SVG
|
||||
, public nsIDOMGetSVGDocument
|
||||
, public nsIDOMGetSVGDocument
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
|
||||
nsHTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLObjectElement();
|
||||
|
||||
// nsISupports
|
||||
@ -158,12 +159,12 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Object)
|
||||
|
||||
|
||||
nsHTMLObjectElement::nsHTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElement(aNodeInfo),
|
||||
mIsDoneAddingChildren(!aFromParser)
|
||||
{
|
||||
RegisterFreezableElement();
|
||||
SetIsNetworkCreated(aFromParser == NS_FROM_PARSER_NETWORK);
|
||||
SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);
|
||||
|
||||
// <object> is always barred from constraint validation.
|
||||
SetBarredFromConstraintValidation(PR_TRUE);
|
||||
|
@ -66,13 +66,15 @@
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "mozAutoDocUpdate.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
/**
|
||||
* Implementation of <option>
|
||||
*/
|
||||
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLOptionElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
{
|
||||
/*
|
||||
* nsHTMLOptionElement's will be created without a nsINodeInfo passed in
|
||||
|
@ -58,6 +58,8 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
//
|
||||
// Helper class used to support <SCRIPT FOR=object EVENT=handler ...>
|
||||
// style script tags...
|
||||
@ -308,7 +310,7 @@ class nsHTMLScriptElement : public nsGenericHTMLElement,
|
||||
{
|
||||
public:
|
||||
nsHTMLScriptElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser);
|
||||
FromParser aFromParser);
|
||||
virtual ~nsHTMLScriptElement();
|
||||
|
||||
// nsISupports
|
||||
@ -361,7 +363,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Script)
|
||||
|
||||
|
||||
nsHTMLScriptElement::nsHTMLScriptElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
, nsScriptElement(aFromParser)
|
||||
{
|
||||
@ -419,10 +421,8 @@ nsHTMLScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
|
||||
*aResult = nsnull;
|
||||
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
nsHTMLScriptElement* it = new nsHTMLScriptElement(ni.forget(), PR_FALSE);
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsHTMLScriptElement* it =
|
||||
new nsHTMLScriptElement(ni.forget(), NOT_FROM_PARSER);
|
||||
|
||||
nsCOMPtr<nsINode> kungFuDeathGrip = it;
|
||||
nsresult rv = CopyInnerTo(it);
|
||||
|
@ -140,13 +140,13 @@ nsSafeOptionListMutation::~nsSafeOptionListMutation()
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Select)
|
||||
|
||||
nsHTMLSelectElement::nsHTMLSelectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElement(aNodeInfo),
|
||||
mOptions(new nsHTMLOptionCollection(this)),
|
||||
mIsDoneAddingChildren(!aFromParser),
|
||||
mDisabledChanged(PR_FALSE),
|
||||
mMutating(PR_FALSE),
|
||||
mInhibitStateRestoration(!!(aFromParser & NS_FROM_PARSER_FRAGMENT)),
|
||||
mInhibitStateRestoration(!!(aFromParser & FROM_PARSER_FRAGMENT)),
|
||||
mNonOptionChildren(0),
|
||||
mOptGroupCount(0),
|
||||
mSelectedIndex(-1)
|
||||
|
@ -244,7 +244,7 @@ public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
|
||||
nsHTMLSelectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLSelectElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -57,17 +57,19 @@
|
||||
#undef GetObject
|
||||
#endif
|
||||
|
||||
class nsHTMLSharedObjectElement : public nsGenericHTMLElement,
|
||||
public nsObjectLoadingContent,
|
||||
public nsIDOMHTMLAppletElement,
|
||||
public nsIDOMHTMLEmbedElement
|
||||
using namespace mozilla::dom;
|
||||
|
||||
class nsHTMLSharedObjectElement : public nsGenericHTMLElement
|
||||
, public nsObjectLoadingContent
|
||||
, public nsIDOMHTMLAppletElement
|
||||
, public nsIDOMHTMLEmbedElement
|
||||
#ifdef MOZ_SVG
|
||||
, public nsIDOMGetSVGDocument
|
||||
, public nsIDOMGetSVGDocument
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
nsHTMLSharedObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
virtual ~nsHTMLSharedObjectElement();
|
||||
|
||||
// nsISupports
|
||||
@ -178,7 +180,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(SharedObject)
|
||||
|
||||
|
||||
nsHTMLSharedObjectElement::nsHTMLSharedObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mIsDoneAddingChildren(mNodeInfo->Equals(nsGkAtoms::embed) || !aFromParser)
|
||||
{
|
||||
|
@ -81,6 +81,8 @@
|
||||
|
||||
#include "nsTextEditorState.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
|
||||
|
||||
#define NS_NO_CONTENT_DISPATCH (1 << 0)
|
||||
@ -97,7 +99,7 @@ public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
|
||||
nsHTMLTextAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser = 0);
|
||||
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@ -278,12 +280,12 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(TextArea)
|
||||
|
||||
|
||||
nsHTMLTextAreaElement::nsHTMLTextAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElement(aNodeInfo),
|
||||
mValueChanged(PR_FALSE),
|
||||
mHandlingSelect(PR_FALSE),
|
||||
mDoneAddingChildren(!aFromParser),
|
||||
mInhibitStateRestoration(!!(aFromParser & NS_FROM_PARSER_FRAGMENT)),
|
||||
mInhibitStateRestoration(!!(aFromParser & FROM_PARSER_FRAGMENT)),
|
||||
mDisabledChanged(PR_FALSE),
|
||||
mState(new nsTextEditorState(this))
|
||||
{
|
||||
|
@ -66,6 +66,8 @@
|
||||
#include "nsIDOMProgressEvent.h"
|
||||
#include "nsMediaError.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Video)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsHTMLVideoElement, nsHTMLMediaElement)
|
||||
@ -101,7 +103,7 @@ NS_IMETHODIMP nsHTMLVideoElement::GetVideoHeight(PRUint32 *aVideoHeight)
|
||||
}
|
||||
|
||||
nsHTMLVideoElement::nsHTMLVideoElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
PRUint32 aFromParser)
|
||||
FromParser aFromParser)
|
||||
: nsHTMLMediaElement(aNodeInfo, aFromParser)
|
||||
{
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user