Merge trunk into HTML5 repo
|
@ -66,7 +66,7 @@
|
|||
#include "nsIStringBundle.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsRootAccessible.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
|
@ -776,33 +776,24 @@ already_AddRefed<nsIDOMNode> nsAccessNode::GetCurrentFocus()
|
|||
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
|
||||
NS_ENSURE_TRUE(doc, nsnull);
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(doc->GetWindow()));
|
||||
if (!privateDOMWindow) {
|
||||
return nsnull;
|
||||
}
|
||||
nsIFocusController *focusController = privateDOMWindow->GetRootFocusController();
|
||||
if (!focusController) {
|
||||
return nsnull;
|
||||
}
|
||||
nsIDOMWindow* win = doc->GetWindow();
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> focusedWindow;
|
||||
nsCOMPtr<nsIDOMElement> focusedElement;
|
||||
focusController->GetFocusedElement(getter_AddRefs(focusedElement));
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm)
|
||||
fm->GetFocusedElementForWindow(win, PR_TRUE, getter_AddRefs(focusedWindow),
|
||||
getter_AddRefs(focusedElement));
|
||||
|
||||
nsIDOMNode *focusedNode = nsnull;
|
||||
if (!focusedElement) {
|
||||
// Document itself has focus
|
||||
nsCOMPtr<nsIDOMWindowInternal> focusedWinInternal;
|
||||
focusController->GetFocusedWindow(getter_AddRefs(focusedWinInternal));
|
||||
if (!focusedWinInternal) {
|
||||
return nsnull;
|
||||
}
|
||||
nsCOMPtr<nsIDOMDocument> focusedDOMDocument;
|
||||
focusedWinInternal->GetDocument(getter_AddRefs(focusedDOMDocument));
|
||||
if (!focusedDOMDocument) {
|
||||
return nsnull;
|
||||
}
|
||||
focusedDOMDocument->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&focusedNode);
|
||||
if (focusedElement) {
|
||||
CallQueryInterface(focusedElement, &focusedNode);
|
||||
}
|
||||
else {
|
||||
focusedElement->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&focusedNode);
|
||||
else if (focusedWindow) {
|
||||
nsCOMPtr<nsIDOMDocument> doc;
|
||||
focusedWindow->GetDocument(getter_AddRefs(doc));
|
||||
if (doc)
|
||||
CallQueryInterface(doc, &focusedNode);
|
||||
}
|
||||
|
||||
return focusedNode;
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
#include "nsIViewManager.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
@ -1469,14 +1470,11 @@ nsAccessible::TakeFocus()
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNSHTMLElement> htmlElement(do_QueryInterface(content));
|
||||
if (htmlElement) {
|
||||
// HTML Elements also set the caret position
|
||||
// in order to affect tabbing order
|
||||
return htmlElement->Focus();
|
||||
}
|
||||
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(content));
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm)
|
||||
fm->SetFocus(element, 0);
|
||||
|
||||
content->SetFocus(GetPresContext());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#include "nsUnicharUtils.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsFocusManager.h"
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsIXULDocument.h"
|
||||
#endif
|
||||
|
@ -350,6 +350,7 @@ nsDocAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
|
|||
|
||||
NS_IMETHODIMP nsDocAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
|
||||
{
|
||||
// XXXndeakin P3 accessibility shouldn't be caching the focus
|
||||
if (!gLastFocusedNode) {
|
||||
*aFocusedChild = nsnull;
|
||||
return NS_OK;
|
||||
|
@ -371,25 +372,18 @@ NS_IMETHODIMP nsDocAccessible::TakeFocus()
|
|||
return NS_ERROR_FAILURE; // Not focusable
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem =
|
||||
nsCoreUtils::GetDocShellTreeItemFor(mDOMNode);
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(treeItem);
|
||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
if (!shell) {
|
||||
NS_WARNING("Was not shutdown properly via InvalidateCacheSubtree()");
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm) {
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
mDOMNode->GetOwnerDocument(getter_AddRefs(domDocument));
|
||||
nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
|
||||
if (document) {
|
||||
// focus the document
|
||||
nsCOMPtr<nsIDOMElement> newFocus;
|
||||
fm->MoveFocus(document->GetWindow(), nsnull, nsIFocusManager::MOVEFOCUS_ROOT, 0,
|
||||
getter_AddRefs(newFocus));
|
||||
}
|
||||
}
|
||||
nsIEventStateManager *esm = shell->GetPresContext()->EventStateManager();
|
||||
NS_ENSURE_TRUE(esm, NS_ERROR_FAILURE);
|
||||
|
||||
// Focus the document
|
||||
nsresult rv = docShell->SetHasFocus(PR_TRUE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Clear out any existing focus state
|
||||
return esm->SetContentState(nsnull, NS_EVENT_STATE_FOCUS);
|
||||
}
|
||||
|
||||
// ------- nsIAccessibleDocument Methods (5) ---------------
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#include "nsIDOMXULPopupElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIMenuFrame.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
|
@ -75,6 +74,7 @@
|
|||
#include "nsRootAccessible.h"
|
||||
#include "nsIDOMNSEventTarget.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsXULTreeAccessible.h"
|
||||
|
@ -234,16 +234,18 @@ nsRootAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
|
||||
nsCOMPtr<nsIDOMWindow> domWin;
|
||||
GetWindow(getter_AddRefs(domWin));
|
||||
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(domWin));
|
||||
if (privateDOMWindow) {
|
||||
nsIFocusController *focusController =
|
||||
privateDOMWindow->GetRootFocusController();
|
||||
if (focusController) {
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (isActive) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> dsti = do_GetInterface(domWin);
|
||||
if (dsti) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
dsti->GetRootTreeItem(getter_AddRefs(root));
|
||||
nsCOMPtr<nsIDOMWindow> rootWindow = do_GetInterface(root);
|
||||
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm && rootWindow) {
|
||||
nsCOMPtr<nsIDOMWindow> activeWindow;
|
||||
fm->GetActiveWindow(getter_AddRefs(activeWindow));
|
||||
if (activeWindow == rootWindow)
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_ACTIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef MOZ_XUL
|
||||
|
|
|
@ -78,7 +78,7 @@ function grid(aTableIdentifier)
|
|||
|
||||
this.handleKeyEvent = function handleKeyEvent(aEvent)
|
||||
{
|
||||
if (aEvent.target.localName != "TD")
|
||||
if (aEvent.target.localName != "td")
|
||||
return;
|
||||
|
||||
var cell = aEvent.target;
|
||||
|
@ -131,7 +131,7 @@ function grid(aTableIdentifier)
|
|||
|
||||
this.handleClickEvent = function handleClickEvent(aEvent)
|
||||
{
|
||||
if (aEvent.target.localName != "TD")
|
||||
if (aEvent.target.localName != "td")
|
||||
return;
|
||||
|
||||
var curCell = this.getCurrentCell();
|
||||
|
|
|
@ -51,9 +51,16 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
|
|||
visibility: collapse;
|
||||
}
|
||||
|
||||
#identity-box > hbox {
|
||||
max-width: 22em;
|
||||
min-width: 1px;
|
||||
#identity-icon-labels {
|
||||
max-width: 18em;
|
||||
}
|
||||
|
||||
#identity-icon-country-label {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity > hbox > #identity-icon-labels > #identity-icon-label {
|
||||
-moz-margin-end: 0.25em !important;
|
||||
}
|
||||
|
||||
/* ::::: Unified Back-/Forward Button ::::: */
|
||||
|
|
|
@ -1237,7 +1237,7 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
focusElement(content);
|
||||
|
||||
if (gURLBar)
|
||||
gURLBar.setAttribute("emptytext", gURLBarEmptyText.value);
|
||||
gURLBar.emptyText = gURLBarEmptyText.value;
|
||||
|
||||
gNavToolbox.customizeDone = BrowserToolboxCustomizeDone;
|
||||
gNavToolbox.customizeChange = BrowserToolboxCustomizeChange;
|
||||
|
@ -6569,6 +6569,10 @@ var gIdentityHandler = {
|
|||
delete this._identityIconLabel;
|
||||
return this._identityIconLabel = document.getElementById("identity-icon-label");
|
||||
},
|
||||
get _identityIconCountryLabel () {
|
||||
delete this._identityIconCountryLabel;
|
||||
return this._identityIconCountryLabel = document.getElementById("identity-icon-country-label");
|
||||
},
|
||||
|
||||
/**
|
||||
* Rebuild cache of the elements that may or may not exist depending
|
||||
|
@ -6577,8 +6581,10 @@ var gIdentityHandler = {
|
|||
_cacheElements : function() {
|
||||
delete this._identityBox;
|
||||
delete this._identityIconLabel;
|
||||
delete this._identityIconCountryLabel;
|
||||
this._identityBox = document.getElementById("identity-box");
|
||||
this._identityIconLabel = document.getElementById("identity-icon-label");
|
||||
this._identityIconCountryLabel = document.getElementById("identity-icon-country-label");
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -6700,6 +6706,8 @@ var gIdentityHandler = {
|
|||
// let's just use that. Check the pref to determine how much of the verified
|
||||
// hostname to show
|
||||
var icon_label = "";
|
||||
var icon_country_label = "";
|
||||
var icon_labels_dir = "ltr";
|
||||
switch (gPrefService.getIntPref("browser.identity.ssl_domain_display")) {
|
||||
case 2 : // Show full domain
|
||||
icon_label = this._lastLocation.hostname;
|
||||
|
@ -6738,20 +6746,34 @@ var gIdentityHandler = {
|
|||
iData = this.getIdentityData();
|
||||
tooltip = this._stringBundle.getFormattedString("identity.identified.verifier",
|
||||
[iData.caOrg]);
|
||||
icon_label = iData.subjectOrg;
|
||||
if (iData.country)
|
||||
icon_label = this._stringBundle.getFormattedString("identity.identified.title_with_country",
|
||||
[iData.subjectOrg, iData.country]);
|
||||
else
|
||||
icon_label = iData.subjectOrg;
|
||||
icon_country_label = "(" + iData.country + ")";
|
||||
// If the organization name starts with an RTL character, then
|
||||
// swap the positions of the organization and country code labels.
|
||||
// The Unicode ranges reflect the definition of the UCS2_CHAR_IS_BIDI
|
||||
// macro in intl/unicharutil/util/nsBidiUtils.h. When bug 218823 gets
|
||||
// fixed, this test should be replaced by one adhering to the
|
||||
// Unicode Bidirectional Algorithm proper (at the paragraph level).
|
||||
icon_labels_dir = /^[\u0590-\u08ff\ufb1d-\ufdff\ufe70-\ufefc]/.test(icon_label) ?
|
||||
"rtl" : "ltr";
|
||||
}
|
||||
else {
|
||||
tooltip = this._stringBundle.getString("identity.unknown.tooltip");
|
||||
icon_label = "";
|
||||
icon_country_label = "";
|
||||
icon_labels_dir = "ltr";
|
||||
}
|
||||
|
||||
// Push the appropriate strings out to the UI
|
||||
this._identityBox.tooltipText = tooltip;
|
||||
this._identityIconLabel.value = icon_label;
|
||||
this._identityIconCountryLabel.value = icon_country_label;
|
||||
// Set cropping and direction
|
||||
this._identityIconLabel.crop = icon_country_label ? "end" : "center";
|
||||
this._identityIconLabel.parentNode.style.direction = icon_labels_dir;
|
||||
// Hide completely if the organization label is empty
|
||||
this._identityIconLabel.parentNode.hidden = icon_label ? false : true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -370,7 +370,7 @@
|
|||
onsearchbegin="LocationBarHelpers._searchBegin();"
|
||||
onsearchcomplete="LocationBarHelpers._searchComplete();"
|
||||
onfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'"
|
||||
onblur="document.getElementById('identity-box').style.MozUserFocus = 'ignore';">
|
||||
onblur="setTimeout(function() document.getElementById('identity-box').style.MozUserFocus = '', 0);">
|
||||
<!-- Use onclick instead of normal popup= syntax since the popup
|
||||
code fires onmousedown, and hence eats our favicon drag events.
|
||||
We only add the identity-box button to the tab order when the location bar
|
||||
|
@ -388,7 +388,10 @@
|
|||
ondraggesture="PageProxyDragGesture(event);"
|
||||
onerror="this.removeAttribute('src');"/>
|
||||
</stack>
|
||||
<label id="identity-icon-label" crop="center" flex="1"/>
|
||||
<hbox id="identity-icon-labels">
|
||||
<label id="identity-icon-label" class="plain" flex="1"/>
|
||||
<label id="identity-icon-country-label" class="plain"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</box>
|
||||
<hbox id="urlbar-icons">
|
||||
|
|
|
@ -222,6 +222,7 @@
|
|||
<li>Robert Accettura</li>
|
||||
<li>Ehsan Akhgari</li>
|
||||
<li>Sean Alamares</li>
|
||||
<li>David Anderson</li>
|
||||
<li>Harvey Anderson</li>
|
||||
<li>Smokey Ardisson</li>
|
||||
<li>Rob Arnold</li>
|
||||
|
@ -230,9 +231,11 @@
|
|||
<li>Mitchell Baker</li>
|
||||
<li>Rhian Baker</li>
|
||||
<li>Jan Bambas</li>
|
||||
<li>Mark Banner</li>
|
||||
<li>Jason Barnabe</li>
|
||||
<li>David Baron</li>
|
||||
<li>Colin Barrett</li>
|
||||
<li>Curtis Bartley</li>
|
||||
<li>Bo Bayles</li>
|
||||
<li>Christopher Beard</li>
|
||||
<li>Glen Beasley</li>
|
||||
|
@ -244,13 +247,17 @@
|
|||
<li>Christian Biesinger</li>
|
||||
<li>Al Billings</li>
|
||||
<li>Seth Bindernagel</li>
|
||||
<li>Jim Blandy</li>
|
||||
<li>Chris Blizzard</li>
|
||||
<li>Jamey Boje</li>
|
||||
<li>David Bolter</li>
|
||||
<li>Nelson Bolyard</li>
|
||||
<li>Marco Bonardo</li>
|
||||
<li>Carsten Book</li>
|
||||
<li>Paul Booker</li>
|
||||
<li>Jennifer Boriss</li>
|
||||
<li>Dan Born</li>
|
||||
<li>Arpad Borsos</li>
|
||||
<li>Ondřej Brablc</li>
|
||||
<li>Catherine Brady</li>
|
||||
<li>Dave Bragsalla</li>
|
||||
|
@ -283,6 +290,8 @@
|
|||
<li>Stephen Donner</li>
|
||||
<li>Asa Dotzler</li>
|
||||
<li>Chris Double</li>
|
||||
<li>Joe Drew</li>
|
||||
<li>Karsten Düsterloh</li>
|
||||
<li>Brendan Eich</li>
|
||||
<li>Kai Engert</li>
|
||||
<li>Steve England</li>
|
||||
|
@ -300,7 +309,9 @@
|
|||
<li>Ryan Flint</li>
|
||||
<li>Alix Franquet</li>
|
||||
<li>Eli Friedman</li>
|
||||
<li>Andreas Gal</li>
|
||||
<li>Steven Garrity</li>
|
||||
<li>Serge Gautherie</li>
|
||||
<li>Kevin Gerich</li>
|
||||
<li>Taras Glek</li>
|
||||
<li>Aravind Gottipati</li>
|
||||
|
@ -323,6 +334,7 @@
|
|||
<li>Chris Hofmann</li>
|
||||
<li>Timothy Hogan</li>
|
||||
<li>Daniel Holbert</li>
|
||||
<li>Bobby Holley</li>
|
||||
<li>Mike Hommey</li>
|
||||
<li>Stephen Horlander</li>
|
||||
<li>David Humphrey</li>
|
||||
|
@ -331,13 +343,16 @@
|
|||
<li>Eri Inoue </li>
|
||||
<li>Joichi Ito</li>
|
||||
<li>Laurent Jouanneau</li>
|
||||
<li>Robert Kaiser</li>
|
||||
<li>Gen Kanai</li>
|
||||
<li>Masanori Kaneko</li>
|
||||
<li>Blake Kaplan</li>
|
||||
<li>Mike Kaplinskiy</li>
|
||||
<li>Michael Kaply</li>
|
||||
<li>Mitch Kapor</li>
|
||||
<li>Kazuyoshi Kato</li>
|
||||
<li>Alfred Kayser</li>
|
||||
<li>Jonathan Kew</li>
|
||||
<li>Paul Kim</li>
|
||||
<li>Masatoshi Kimura</li>
|
||||
<li>Ria Klaassen</li>
|
||||
|
@ -346,6 +361,7 @@
|
|||
<li>Michael Kohler</li>
|
||||
<li>Gary Kwong</li>
|
||||
<li>David Lanham</li>
|
||||
<li>Brad Lassey</li>
|
||||
<li>Edward Lee</li>
|
||||
<li>Raymond Lee</li>
|
||||
<li>Garrett LeSage</li>
|
||||
|
@ -361,11 +377,14 @@
|
|||
<li>Phil Machalski</li>
|
||||
<li>Joel Maher</li>
|
||||
<li>Ere Maijala</li>
|
||||
<li>David Mandelin</li>
|
||||
<li>Gervase Markham</li>
|
||||
<li>Sean Martell</li>
|
||||
<li>Jim Mathies</li>
|
||||
<li>Graeme McCutcheon</li>
|
||||
<li>Patrick McManus</li>
|
||||
<li>Heather Meeker</li>
|
||||
<li>Walter Meinl</li>
|
||||
<li>Myk Melez</li>
|
||||
<li>Federico Mena-Quintero</li>
|
||||
<li>Mark Mentovai</li>
|
||||
|
@ -380,14 +399,18 @@
|
|||
<li>Mike Morgan</li>
|
||||
<li>Dan Mosedale</li>
|
||||
<li>Michael Moy</li>
|
||||
<li>Jeff Muizelaar</li>
|
||||
<li>Masayuki Nakano</li>
|
||||
<li>Marria Nazif</li>
|
||||
<li>Kev Needham</li>
|
||||
<li>Kaori Negoro</li>
|
||||
<li>Ben Newman</li>
|
||||
<li>Johnathan Nightingale</li>
|
||||
<li>Andreas Nilsson</li>
|
||||
<li>Timothy Nikkel</li>
|
||||
<li>Tristan Nitot</li>
|
||||
<li>Alice Nodelman</li>
|
||||
<li>Matthew Noorenberghe </li>
|
||||
<li>Michal Novotny</li>
|
||||
<li>Robert O'Callahan</li>
|
||||
<li>John O'Duinn</li>
|
||||
|
@ -395,6 +418,7 @@
|
|||
<li>Jan Odvárko</li>
|
||||
<li>Tomoyuki Okazaki</li>
|
||||
<li>Jeremy Orem</li>
|
||||
<li>Jason Orendorff</li>
|
||||
<li>Hideo Oshima</li>
|
||||
<li>Mats Palmgren</li>
|
||||
<li>Stuart Parmenter</li>
|
||||
|
@ -423,16 +447,20 @@
|
|||
<li>Julien Rivaud</li>
|
||||
<li>David Rolnitzky</li>
|
||||
<li>Asaf Romano</li>
|
||||
<li>Oleg Romashin</li>
|
||||
<li>Tim Rowley</li>
|
||||
<li>Jesse Ruderman</li>
|
||||
<li>Brian Ryner</li>
|
||||
<li>Alexander Sack</li>
|
||||
<li>Hideo Saito</li>
|
||||
<li>Atsushi Sakai</li>
|
||||
<li>Eiko Sakuma</li>
|
||||
<li>Andrei Saprykin</li>
|
||||
<li>Ken Saunders</li>
|
||||
<li>Robert Sayre</li>
|
||||
<li>Mike Schroepfer</li>
|
||||
<li>Kurt Schultz</li>
|
||||
<li>Keith Schwarz</li>
|
||||
<li>Justin Scott</li>
|
||||
<li>Hiroshi Sekiya</li>
|
||||
<li>Tara Shahian</li>
|
||||
|
@ -451,6 +479,7 @@
|
|||
<li>John Slater</li>
|
||||
<li>Benjamin Smedberg</li>
|
||||
<li>Andrew Smith</li>
|
||||
<li>Edwin Smith</li>
|
||||
<li>Mark Smith</li>
|
||||
<li>Window Snyder</li>
|
||||
<li>Josh Soref</li>
|
||||
|
@ -464,6 +493,7 @@
|
|||
<li>Rob Stradling</li>
|
||||
<li>Robert Strong</li>
|
||||
<li>Vicky Sun</li>
|
||||
<li>Alexander Surkov</li>
|
||||
<li>Clint Talbert</li>
|
||||
<li>David Tenser</li>
|
||||
<li>Chris Thomas</li>
|
||||
|
@ -488,12 +518,15 @@
|
|||
<li>Martijn Wargers</li>
|
||||
<li>Jonathan Watt</li>
|
||||
<li>Peter Weilbacher</li>
|
||||
<li>Zack Weinberg</li>
|
||||
<li>Frédéric Wenzel</li>
|
||||
<li>Steffen Wilberg</li>
|
||||
<li>Drew Willcoxon</li>
|
||||
<li>Shawn Wilsher</li>
|
||||
<li>Dan Witte</li>
|
||||
<li>John Wolfe</li>
|
||||
<li>Steve Won</li>
|
||||
<li>Justin Wood</li>
|
||||
<li>Michael Wu</li>
|
||||
<li>Masahiro Yamada</li>
|
||||
<li>Satoko Takita Yamaguchi (Chibi)</li>
|
||||
|
|
|
@ -1402,5 +1402,11 @@ nsContextMenu.prototype = {
|
|||
var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
|
||||
getService(Ci.nsIClipboardHelper);
|
||||
clipboard.copyString(this.mediaURL);
|
||||
},
|
||||
|
||||
get imageURL() {
|
||||
if (this.onImage)
|
||||
return this.mediaURL;
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
|
|
@ -813,62 +813,18 @@
|
|||
if (this.mCurrentTab != this.selectedTab)
|
||||
this.mCurrentTab.owner = null;
|
||||
|
||||
if (this.mCurrentBrowser) {
|
||||
// Only save the focused element if it is in our content window
|
||||
// or in an ancestor window.
|
||||
var focusedWindow = document.commandDispatcher.focusedWindow;
|
||||
var saveFocus = false;
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
var focusedChromeElement = fm.getFocusedElementForWindow(window, false, {});
|
||||
|
||||
if (focusedWindow && focusedWindow.top == window.content) {
|
||||
saveFocus = true;
|
||||
} else {
|
||||
var contentWindow = window;
|
||||
|
||||
while (contentWindow) {
|
||||
if (contentWindow == focusedWindow) {
|
||||
saveFocus = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (contentWindow.parent == contentWindow) {
|
||||
break;
|
||||
}
|
||||
|
||||
contentWindow = contentWindow.parent;
|
||||
}
|
||||
}
|
||||
|
||||
if (saveFocus) {
|
||||
// Preserve the currently-focused element or DOM window for
|
||||
// this tab.
|
||||
|
||||
this.mCurrentBrowser.focusedWindow = focusedWindow;
|
||||
this.mCurrentBrowser.focusedElement = document.commandDispatcher.focusedElement;
|
||||
}
|
||||
|
||||
if (this.mCurrentBrowser.focusedElement &&
|
||||
this.mCurrentBrowser.focusedElement.parentNode !=
|
||||
this.mCurrentTab.parentNode) {
|
||||
// Clear focus outline before we draw on top of it.
|
||||
// Only blur the focused element if it isn't a tab,
|
||||
// to avoid breaking keyboard tab navigation
|
||||
var elem = this.mCurrentBrowser.focusedElement;
|
||||
if (elem instanceof HTMLElement || elem instanceof XULElement) {
|
||||
elem.blur();
|
||||
}
|
||||
else {
|
||||
var content = elem.ownerDocument.defaultView;
|
||||
if (content instanceof Components.interfaces.nsIInterfaceRequestor)
|
||||
content.getInterface(Components.interfaces.nsIDOMWindowUtils).focus(null);
|
||||
}
|
||||
}
|
||||
this.mCurrentBrowser.setAttribute("type", "content-targetable");
|
||||
}
|
||||
var oldBrowser = this.mCurrentBrowser;
|
||||
if (oldBrowser)
|
||||
oldBrowser.setAttribute("type", "content-targetable");
|
||||
|
||||
var updatePageReport = false;
|
||||
if (!this.mCurrentBrowser ||
|
||||
(this.mCurrentBrowser.pageReport && !newBrowser.pageReport) ||
|
||||
(!this.mCurrentBrowser.pageReport && newBrowser.pageReport))
|
||||
if (!oldBrowser ||
|
||||
(oldBrowser.pageReport && !newBrowser.pageReport) ||
|
||||
(!oldBrowser.pageReport && newBrowser.pageReport))
|
||||
updatePageReport = true;
|
||||
|
||||
newBrowser.setAttribute("type", "content-primary");
|
||||
|
@ -951,64 +907,13 @@
|
|||
event.initEvent("TabSelect", true, false);
|
||||
this.mCurrentTab.dispatchEvent(event);
|
||||
|
||||
if (document.commandDispatcher.focusedElement &&
|
||||
document.commandDispatcher.focusedElement.parentNode ==
|
||||
this.mCurrentTab.parentNode) {
|
||||
// The focus is on a tab in the same tab panel
|
||||
return; // If focus was on a tab, switching tabs focuses the new tab
|
||||
}
|
||||
|
||||
var whatToFocus = window.content;
|
||||
|
||||
// Focus the previously focused element or window, but make sure
|
||||
// the focused element is still part of the document
|
||||
let focusedElem = newBrowser.focusedElement;
|
||||
if (focusedElem && focusedElem.ownerDocument &&
|
||||
!(focusedElem.ownerDocument.compareDocumentPosition(focusedElem) &
|
||||
Node.DOCUMENT_POSITION_DISCONNECTED)) {
|
||||
if (newBrowser.focusedElement.parentNode !=
|
||||
this.mCurrentTab.parentNode) {
|
||||
// Focus the remembered element unless it's in the current tab panel
|
||||
whatToFocus = newBrowser.focusedElement;
|
||||
}
|
||||
}
|
||||
else if (newBrowser.focusedWindow) {
|
||||
whatToFocus = newBrowser.focusedWindow;
|
||||
}
|
||||
|
||||
// Change focus for this window to |whatToFocus|, without
|
||||
// focusing the window itself.
|
||||
var cmdDispatcher = document.commandDispatcher;
|
||||
|
||||
var ww =
|
||||
Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||
.getService(Components.interfaces.nsIWindowWatcher);
|
||||
if (ww.activeWindow == window) {
|
||||
cmdDispatcher.suppressFocusScroll = true;
|
||||
if (whatToFocus instanceof HTMLElement ||
|
||||
whatToFocus instanceof XULElement ||
|
||||
whatToFocus instanceof Window) {
|
||||
whatToFocus.focus();
|
||||
}
|
||||
else if (whatToFocus instanceof Node) {
|
||||
var content = window.content;
|
||||
if (content instanceof Components.interfaces.nsIInterfaceRequestor)
|
||||
content.getInterface(Components.interfaces.nsIDOMWindowUtils).focus(whatToFocus);
|
||||
}
|
||||
cmdDispatcher.suppressFocusScroll = false;
|
||||
}
|
||||
else {
|
||||
// set the element in command dispatcher so focus will restore
|
||||
// properly when the window does become active
|
||||
if (whatToFocus instanceof Window) {
|
||||
cmdDispatcher.focusedWindow = whatToFocus;
|
||||
cmdDispatcher.focusedElement = null;
|
||||
}
|
||||
else {
|
||||
cmdDispatcher.focusedWindow = whatToFocus.ownerDocument.defaultView;
|
||||
cmdDispatcher.focusedElement = whatToFocus;
|
||||
}
|
||||
}
|
||||
// change focus to the new tab if nothing is focused, the old tab
|
||||
// is focused or there is something in the new tab to focus. One
|
||||
// specific case where focus is not changed is when the new tab
|
||||
// has no focused element and a chrome element is focused.
|
||||
if (!focusedChromeElement || focusedChromeElement == oldBrowser ||
|
||||
fm.getFocusedElementForWindow(window.content, true, {}))
|
||||
fm.setFocus(newBrowser, fm.FLAG_NOSCROLL);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -1627,9 +1532,7 @@
|
|||
// destroyed until the document goes away. So we force a
|
||||
// cleanup ourselves.
|
||||
// This has to happen before we remove the child so that the
|
||||
// XBL implementation of nsIObserver still works. But
|
||||
// clearing focusedWindow happens below because it gets
|
||||
// reset by updateCurrentBrowser.
|
||||
// XBL implementation of nsIObserver still works.
|
||||
browser.destroy();
|
||||
|
||||
if (browser == this.mCurrentBrowser)
|
||||
|
@ -1662,10 +1565,6 @@
|
|||
if (this.mTabBox)
|
||||
this.mTabBox.selectedPanel = this.getBrowserForTab(this.mCurrentTab).parentNode;
|
||||
|
||||
// see comment about destroy above
|
||||
browser.focusedWindow = null;
|
||||
browser.focusedElement = null;
|
||||
|
||||
if (aCloseWindow)
|
||||
this._windowIsClosing = closeWindow(true);
|
||||
]]>
|
||||
|
@ -2997,14 +2896,8 @@
|
|||
tooltiptext="&listAllTabs.label;"
|
||||
oncommand="ctrlTab.open(true);"/>
|
||||
</xul:stack>
|
||||
#ifdef XP_MACOSX
|
||||
<xul:hbox anonid="tabstrip-closebutton" class="tabs-closebutton-box" align="center" pack="end" chromedir="&locale.dir;">
|
||||
#endif
|
||||
<xul:toolbarbutton anonid="tabs-closebutton"
|
||||
class="close-button tabs-closebutton" chromedir="&locale.dir;"/>
|
||||
#ifdef XP_MACOSX
|
||||
</xul:hbox>
|
||||
#endif
|
||||
</xul:hbox>
|
||||
</xul:stack>
|
||||
</content>
|
||||
|
@ -3065,11 +2958,7 @@
|
|||
</field>
|
||||
|
||||
<field name="mTabstripClosebutton">
|
||||
#ifdef XP_MACOSX
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "tabstrip-closebutton");
|
||||
#else
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "tabs-closebutton");
|
||||
#endif
|
||||
</field>
|
||||
|
||||
<field name="_prefObserver">({
|
||||
|
|
|
@ -82,7 +82,9 @@ _BROWSER_FILES = browser_sanitize-timespans.js \
|
|||
browser_bug462673.js \
|
||||
browser_bug481560.js \
|
||||
browser_bug477014.js \
|
||||
browser_bug495058.js \
|
||||
browser_discovery.js \
|
||||
browser_tabfocus.js \
|
||||
discovery.html \
|
||||
moz.png \
|
||||
test_bug462673.html \
|
||||
|
|
|
@ -1,19 +1,30 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// focus the url field so that it will can ensure the focus is there when
|
||||
// the window is refocused after the dialog closes
|
||||
gURLBar.focus();
|
||||
|
||||
window.addEventListener("focus", function () {
|
||||
window.removeEventListener("focus", arguments.callee, false);
|
||||
finish();
|
||||
}, false);
|
||||
|
||||
var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
||||
|
||||
win.addEventListener("load", function () {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
win.content.addEventListener("focus", function () {
|
||||
win.content.removeEventListener("focus", arguments.callee, false);
|
||||
|
||||
EventUtils.synthesizeKey("w", { accelKey: true }, win);
|
||||
ok(win.closed, "accel+w closed the window immediately");
|
||||
}, false);
|
||||
|
||||
win.gBrowser.selectedTab.addEventListener("TabClose", function () {
|
||||
ok(false, "shouldn't have gotten the TabClose event for the last tab");
|
||||
}, false);
|
||||
|
||||
EventUtils.synthesizeKey("w", { accelKey: true }, win);
|
||||
|
||||
ok(win.closed, "accel+w closed the window immediately");
|
||||
|
||||
finish();
|
||||
}, false);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
next();
|
||||
}
|
||||
|
||||
var uris = [
|
||||
"about:blank",
|
||||
"about:sessionrestore",
|
||||
"about:privatebrowsing",
|
||||
];
|
||||
|
||||
function next() {
|
||||
var tab = gBrowser.addTab();
|
||||
var uri = uris.shift();
|
||||
|
||||
if (uri == "about:blank") {
|
||||
detach();
|
||||
} else {
|
||||
let browser = tab.linkedBrowser;
|
||||
browser.addEventListener("load", function () {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
detach();
|
||||
}, true);
|
||||
browser.loadURI(uri);
|
||||
}
|
||||
|
||||
function detach() {
|
||||
var win = gBrowser.replaceTabWithWindow(tab);
|
||||
win.addEventListener("load", function () {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
win.gBrowser.addEventListener("pageshow", function() {
|
||||
win.gBrowser.removeEventListener("pageshow", arguments.callee, false);
|
||||
|
||||
// wait for delayedStartup
|
||||
win.setTimeout(function () {
|
||||
is(win.gBrowser.currentURI.spec, uri, uri + ": uri loaded in detached tab");
|
||||
is(win.document.activeElement, win.gBrowser.selectedBrowser, uri + ": browser is focused");
|
||||
is(win.gURLBar.value, "", uri + ": urlbar is empty");
|
||||
ok(win.gURLBar.emptyText, uri + ": emptytext is present");
|
||||
ok(win.gURLBar.hasAttribute("isempty"), uri + ": emptytext is displayed");
|
||||
|
||||
win.close();
|
||||
if (uris.length)
|
||||
next();
|
||||
else
|
||||
executeSoon(finish);
|
||||
}, 100);
|
||||
}, false);
|
||||
}, false);
|
||||
}
|
||||
}
|
|
@ -67,7 +67,7 @@ function test() {
|
|||
pressCtrlTab();
|
||||
document.removeEventListener("keypress", detectKeyEvent, false);
|
||||
ok(eventConsumed, "Ctrl+Tab consumed by the tabbed browser if one tab is open");
|
||||
is(focusedWindow.location, document.commandDispatcher.focusedWindow.location,
|
||||
is(focusedWindow, document.commandDispatcher.focusedWindow,
|
||||
"Ctrl+Tab doesn't change focus if one tab is open");
|
||||
}
|
||||
|
||||
|
|
|
@ -282,11 +282,11 @@ var gAllTests = [
|
|||
},
|
||||
|
||||
/**
|
||||
* Ensures that toggling details persists across dialog openings.
|
||||
* These next two tests together ensure that toggling details persists
|
||||
* across dialog openings.
|
||||
*/
|
||||
function () {
|
||||
let wh = new WindowHelper();
|
||||
|
||||
wh.onload = function () {
|
||||
// Show details
|
||||
this.toggleDetails();
|
||||
|
@ -294,7 +294,9 @@ var gAllTests = [
|
|||
this.cancelDialog();
|
||||
};
|
||||
wh.open();
|
||||
|
||||
},
|
||||
function () {
|
||||
let wh = new WindowHelper();
|
||||
wh.onload = function () {
|
||||
// Details should have remained open
|
||||
this.checkDetails(true);
|
||||
|
|
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
* This test checks that focus is adjusted properly when switching tabs.
|
||||
*/
|
||||
|
||||
let testPage1 = "data:text/html,<html id='tab1'><body><button id='button1'>Tab 1</button></body></html>";
|
||||
let testPage2 = "data:text/html,<html id='tab2'><body><button id='button2'>Tab 2</button></body></html>";
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
var tab1 = gBrowser.addTab();
|
||||
var tab2 = gBrowser.addTab();
|
||||
var browser1 = gBrowser.getBrowserForTab(tab1);
|
||||
var browser2 = gBrowser.getBrowserForTab(tab2);
|
||||
|
||||
gURLBar.focus();
|
||||
|
||||
var loadCount = 0;
|
||||
function check()
|
||||
{
|
||||
// wait for both tabs to load
|
||||
if (++loadCount != 2)
|
||||
return;
|
||||
|
||||
window.focus();
|
||||
|
||||
_browser_tabfocus_test_lastfocus = gURLBar;
|
||||
_browser_tabfocus_test_lastfocuswindow = window;
|
||||
|
||||
window.addEventListener("focus", _browser_tabfocus_test_eventOccured, true);
|
||||
window.addEventListener("blur", _browser_tabfocus_test_eventOccured, true);
|
||||
|
||||
gBrowser.selectedTab = tab2;
|
||||
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
is(fm.focusedWindow, window, "focusedWindow after tab load");
|
||||
is(fm.focusedElement, gURLBar.inputField, "focusedElement after tab load");
|
||||
|
||||
// make sure that the focus initially starts out blank
|
||||
var focusedWindow = {};
|
||||
is(fm.getFocusedElementForWindow(browser1.contentWindow, false, focusedWindow), null, "initial focus in tab 1");
|
||||
is(focusedWindow.value, browser1.contentWindow, "initial frame focus in tab 1");
|
||||
is(fm.getFocusedElementForWindow(browser2.contentWindow, false, focusedWindow), null, "initial focus in tab 2");
|
||||
is(focusedWindow.value, browser2.contentWindow, "initial frame focus in tab 2");
|
||||
|
||||
// switching tabs when the urlbar is focused and nothing in the new tab is focused
|
||||
// should keep focus in the urlbar
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab1,
|
||||
window, gURLBar.inputField, false,
|
||||
"focusedElement after tab change, focus in url field, no focus in new tab");
|
||||
|
||||
// focusing a button in the current tab should focus it
|
||||
var button1 = browser1.contentWindow.document.getElementById("button1");
|
||||
expectFocusShift(function () button1.focus(),
|
||||
browser1.contentWindow, button1, true,
|
||||
"focusedWindow after focus in focused tab");
|
||||
|
||||
// focusing a button in a background tab should not change the actual
|
||||
// focus, but should set the focus that would be in that background tab to
|
||||
// that button.
|
||||
var button2 = browser2.contentWindow.document.getElementById("button2");
|
||||
button2.focus();
|
||||
|
||||
expectFocusShift(function () button2.focus(),
|
||||
browser1.contentWindow, button1, false,
|
||||
"focusedWindow after focus in unfocused tab");
|
||||
is(fm.getFocusedElementForWindow(browser2.contentWindow, false, {}), button2, "focus in unfocused tab");
|
||||
|
||||
// switching tabs should now make the button in the other tab focused
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab2,
|
||||
browser2.contentWindow, button2, true,
|
||||
"focusedWindow after tab change");
|
||||
|
||||
// blurring an element in a background tab should not change the active
|
||||
// focus, but should clear the focus in that tab.
|
||||
expectFocusShift(function () button1.blur(),
|
||||
browser2.contentWindow, button2, false,
|
||||
"focusedWindow after blur in unfocused tab");
|
||||
is(fm.getFocusedElementForWindow(browser1.contentWindow, false, {}), null, "blur in unfocused tab");
|
||||
|
||||
// focusing the url field should switch active focus away from the tab but
|
||||
// not clear what would be the focus in the tab
|
||||
button1.focus();
|
||||
expectFocusShift(function () gURLBar.focus(),
|
||||
window, gURLBar.inputField, true,
|
||||
"focusedWindow after url field focused");
|
||||
is(fm.getFocusedElementForWindow(browser2.contentWindow, false, {}), button2, "url field focused, button in tab");
|
||||
|
||||
// when a chrome element is focused, switching tabs to a tab with a button
|
||||
// with the current focus should focus the button
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab1,
|
||||
browser1.contentWindow, button1, true,
|
||||
"focusedWindow after tab change, focus in url field, button focused in new tab");
|
||||
is(fm.getFocusedElementForWindow(browser2.contentWindow, false, {}), button2, "after switch tab, focus in unfocused tab");
|
||||
|
||||
// blurring an element in the current tab should clear the active focus
|
||||
expectFocusShift(function () button1.blur(),
|
||||
browser1.contentWindow, null, true,
|
||||
"focusedWindow after blur in focused tab");
|
||||
|
||||
// blurring an non-focused url field should have no effect
|
||||
expectFocusShift(function () gURLBar.blur(),
|
||||
browser1.contentWindow, null, false,
|
||||
"focusedWindow after blur in unfocused url field");
|
||||
|
||||
// switch focus to a tab with a currently focused element
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab2,
|
||||
browser2.contentWindow, button2, true,
|
||||
"focusedWindow after switch from unfocused to focused tab");
|
||||
|
||||
// clearing focus on the chrome window should switch the focus to the
|
||||
// chrome window
|
||||
expectFocusShift(function () fm.clearFocus(window),
|
||||
window, null, true,
|
||||
"focusedWindow after switch to chrome with no focused element");
|
||||
|
||||
// switch focus to another tab when neither have an active focus
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab1,
|
||||
browser1.contentWindow, null, true,
|
||||
"focusedWindow after tab switch from no focus to no focus");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
browser1.addEventListener("load", check, true);
|
||||
browser2.addEventListener("load", check, true);
|
||||
browser1.contentWindow.location = testPage1;
|
||||
browser2.contentWindow.location = testPage2;
|
||||
}
|
||||
|
||||
var _browser_tabfocus_test_lastfocus;
|
||||
var _browser_tabfocus_test_lastfocuswindow = null;
|
||||
var _browser_tabfocus_test_events = "";
|
||||
|
||||
function _browser_tabfocus_test_eventOccured(event)
|
||||
{
|
||||
var id;
|
||||
if (event.target instanceof Window)
|
||||
id = event.originalTarget.document.documentElement.id + "-window";
|
||||
else if (event.target instanceof Document)
|
||||
id = event.originalTarget.documentElement.id + "-document";
|
||||
else if (event.target.id == "urlbar" && event.originalTarget.localName == "input")
|
||||
id = "urlbar";
|
||||
else
|
||||
id = event.originalTarget.id;
|
||||
|
||||
if (_browser_tabfocus_test_events)
|
||||
_browser_tabfocus_test_events += " ";
|
||||
_browser_tabfocus_test_events += event.type + ": " + id;
|
||||
}
|
||||
|
||||
function getId(element)
|
||||
{
|
||||
return (element.localName == "input") ? "urlbar" : element.id;
|
||||
}
|
||||
|
||||
function expectFocusShift(callback, expectedWindow, expectedElement, focusChanged, testid)
|
||||
{
|
||||
var expectedEvents = "";
|
||||
if (focusChanged) {
|
||||
if (_browser_tabfocus_test_lastfocus)
|
||||
expectedEvents += "blur: " + getId(_browser_tabfocus_test_lastfocus);
|
||||
|
||||
if (_browser_tabfocus_test_lastfocuswindow &&
|
||||
_browser_tabfocus_test_lastfocuswindow != expectedWindow) {
|
||||
if (expectedEvents)
|
||||
expectedEvents += " ";
|
||||
var windowid = _browser_tabfocus_test_lastfocuswindow.document.documentElement.id;
|
||||
expectedEvents += "blur: " + windowid + "-document " +
|
||||
"blur: " + windowid + "-window";
|
||||
}
|
||||
|
||||
if (expectedWindow && _browser_tabfocus_test_lastfocuswindow != expectedWindow) {
|
||||
if (expectedEvents)
|
||||
expectedEvents += " ";
|
||||
var windowid = expectedWindow.document.documentElement.id;
|
||||
expectedEvents += "focus: " + windowid + "-document " +
|
||||
"focus: " + windowid + "-window";
|
||||
}
|
||||
|
||||
if (expectedElement) {
|
||||
if (expectedEvents)
|
||||
expectedEvents += " ";
|
||||
expectedEvents += "focus: " + getId(expectedElement);
|
||||
}
|
||||
|
||||
_browser_tabfocus_test_lastfocus = expectedElement;
|
||||
_browser_tabfocus_test_lastfocuswindow = expectedWindow;
|
||||
}
|
||||
|
||||
callback();
|
||||
|
||||
is(_browser_tabfocus_test_events, expectedEvents, testid + " events");
|
||||
_browser_tabfocus_test_events = "";
|
||||
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
|
||||
var focusedElement = fm.focusedElement;
|
||||
is(focusedElement ? getId(focusedElement) : "none",
|
||||
expectedElement ? getId(expectedElement) : "none", testid + " focusedElement");
|
||||
is(fm.focusedWindow, expectedWindow, testid + " focusedWindow");
|
||||
var focusedWindow = {};
|
||||
is(fm.getFocusedElementForWindow(expectedWindow, false, focusedWindow),
|
||||
expectedElement, testid + " getFocusedElementForWindow");
|
||||
is(focusedWindow.value, expectedWindow, testid + " getFocusedElementForWindow frame");
|
||||
is(expectedWindow.document.hasFocus(), true, testid + " hasFocus");
|
||||
var expectedActive = expectedElement;
|
||||
if (!expectedActive)
|
||||
expectedActive = expectedWindow.document instanceof XULDocument ?
|
||||
expectedWindow.document.documentElement : expectedWindow.document.body;
|
||||
is(expectedWindow.document.activeElement, expectedActive, testid + " activeElement");
|
||||
}
|
|
@ -93,24 +93,17 @@ function getBoolPref ( prefname, def )
|
|||
|
||||
// Change focus for this browser window to |aElement|, without focusing the
|
||||
// window itself.
|
||||
function focusElement(aElement) {
|
||||
// This is a redo of the fix for jag bug 91884
|
||||
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||
.getService(Components.interfaces.nsIWindowWatcher);
|
||||
if (window == ww.activeWindow)
|
||||
aElement.focus();
|
||||
function focusElement(aElement)
|
||||
{
|
||||
// if a content window, focus the <browser> instead as window.focus()
|
||||
// raises the window
|
||||
if (aElement instanceof Window) {
|
||||
var browser = getBrowserFromContentWindow(aElement);
|
||||
if (browser)
|
||||
browser.focus();
|
||||
}
|
||||
else {
|
||||
// set the element in command dispatcher so focus will restore properly
|
||||
// when the window does become active
|
||||
var cmdDispatcher = document.commandDispatcher;
|
||||
if (aElement instanceof Window) {
|
||||
cmdDispatcher.focusedWindow = aElement;
|
||||
cmdDispatcher.focusedElement = null;
|
||||
}
|
||||
else if (aElement instanceof Element) {
|
||||
cmdDispatcher.focusedWindow = aElement.ownerDocument.defaultView;
|
||||
cmdDispatcher.focusedElement = aElement;
|
||||
}
|
||||
aElement.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,10 +248,11 @@ function openUILinkIn( url, where, allowThirdPartyFixup, postData, referrerUrl )
|
|||
break;
|
||||
}
|
||||
|
||||
// Call focusElement(w.content) instead of w.content.focus() to make sure
|
||||
// that we don't raise the old window, since the URI we just loaded may have
|
||||
// resulted in a new frontmost window (e.g. "javascript:window.open('');").
|
||||
focusElement(w.content);
|
||||
// Focus the content but don't raise the window, since the URI we just loaded
|
||||
// may have resulted in a new frontmost window (e.g. "javascript:window.open('');").
|
||||
var browser = w.getBrowserFromContentWindow(w.content);
|
||||
if (browser)
|
||||
browser.focus();
|
||||
}
|
||||
|
||||
// Used as an onclick handler for UI elements with link-like behavior.
|
||||
|
|
|
@ -127,6 +127,7 @@ PlacesController.prototype = {
|
|||
case "cmd_redo":
|
||||
return PlacesUIUtils.ptm.numberOfRedoItems > 0;
|
||||
case "cmd_cut":
|
||||
case "placesCmd_cut":
|
||||
var nodes = this._view.getSelectionNodes();
|
||||
// If selection includes history nodes there's no reason to allow cut.
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
|
@ -135,6 +136,7 @@ PlacesController.prototype = {
|
|||
}
|
||||
// Otherwise fallback to cmd_delete check.
|
||||
case "cmd_delete":
|
||||
case "placesCmd_delete":
|
||||
return this._hasRemovableSelection(false);
|
||||
case "placesCmd_deleteDataHost":
|
||||
return this._hasRemovableSelection(false) &&
|
||||
|
@ -142,8 +144,10 @@ PlacesController.prototype = {
|
|||
case "placesCmd_moveBookmarks":
|
||||
return this._hasRemovableSelection(true);
|
||||
case "cmd_copy":
|
||||
case "placesCmd_copy":
|
||||
return this._view.hasSelection;
|
||||
case "cmd_paste":
|
||||
case "placesCmd_paste":
|
||||
return this._canInsert(true) && this._isClipboardDataPasteable();
|
||||
case "cmd_selectAll":
|
||||
if (this._view.selType != "single") {
|
||||
|
@ -229,15 +233,19 @@ PlacesController.prototype = {
|
|||
PlacesUIUtils.ptm.redoTransaction();
|
||||
break;
|
||||
case "cmd_cut":
|
||||
case "placesCmd_cut":
|
||||
this.cut();
|
||||
break;
|
||||
case "cmd_copy":
|
||||
case "placesCmd_copy":
|
||||
this.copy();
|
||||
break;
|
||||
case "cmd_paste":
|
||||
case "placesCmd_paste":
|
||||
this.paste();
|
||||
break;
|
||||
case "cmd_delete":
|
||||
case "placesCmd_delete":
|
||||
this.remove("Remove Selection");
|
||||
break;
|
||||
case "placesCmd_deleteDataHost":
|
||||
|
@ -1604,19 +1612,13 @@ var PlacesControllerDragHelper = {
|
|||
};
|
||||
|
||||
function goUpdatePlacesCommands() {
|
||||
var placesController;
|
||||
try {
|
||||
// Or any other command...
|
||||
placesController = top.document.commandDispatcher
|
||||
.getControllerForCommand("placesCmd_open");
|
||||
}
|
||||
catch(ex) { return; }
|
||||
// Get the controller for one of the places commands.
|
||||
var placesController = doGetPlacesControllerForCommand("placesCmd_open");
|
||||
if (!placesController)
|
||||
return;
|
||||
|
||||
function updatePlacesCommand(aCommand) {
|
||||
var enabled = false;
|
||||
if (placesController)
|
||||
enabled = placesController.isCommandEnabled(aCommand);
|
||||
goSetCommandEnabled(aCommand, enabled);
|
||||
goSetCommandEnabled(aCommand, placesController.isCommandEnabled(aCommand));
|
||||
}
|
||||
|
||||
updatePlacesCommand("placesCmd_open");
|
||||
|
@ -1631,4 +1633,39 @@ function goUpdatePlacesCommands() {
|
|||
updatePlacesCommand("placesCmd_reload");
|
||||
updatePlacesCommand("placesCmd_reloadMicrosummary");
|
||||
updatePlacesCommand("placesCmd_sortBy:name");
|
||||
updatePlacesCommand("placesCmd_cut");
|
||||
updatePlacesCommand("placesCmd_copy");
|
||||
updatePlacesCommand("placesCmd_paste");
|
||||
updatePlacesCommand("placesCmd_delete");
|
||||
}
|
||||
|
||||
function doGetPlacesControllerForCommand(aCommand)
|
||||
{
|
||||
var placesController = top.document.commandDispatcher
|
||||
.getControllerForCommand(aCommand);
|
||||
if (!placesController) {
|
||||
// If building commands for a context menu, look for an element in the
|
||||
// current popup.
|
||||
var element = document.popupNode;
|
||||
while (element) {
|
||||
var isContextMenuShown = ("_contextMenuShown" in element) && element._contextMenuShown;
|
||||
// Check for the parent menupopup or the hbox used for toolbars
|
||||
if ((element.localName == "menupopup" || element.localName == "hbox") &&
|
||||
isContextMenuShown) {
|
||||
placesController = element.controllers.getControllerForCommand(aCommand);
|
||||
break;
|
||||
}
|
||||
element = element.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
return placesController;
|
||||
}
|
||||
|
||||
function goDoPlacesCommand(aCommand)
|
||||
{
|
||||
var controller = doGetPlacesControllerForCommand(aCommand);
|
||||
if (controller && controller.isCommandEnabled(aCommand))
|
||||
controller.doCommand(aCommand);
|
||||
}
|
||||
|
||||
|
|
|
@ -1024,11 +1024,7 @@
|
|||
<body><![CDATA[
|
||||
this._ensureInitialized();
|
||||
this._contextMenuShown = true;
|
||||
// Activate the controller
|
||||
this.focus();
|
||||
// The above call may not always fire a consumable event for
|
||||
// commandUpdater, so we force a command update.
|
||||
window.updateCommands("focus");
|
||||
window.updateCommands("places");
|
||||
return this.controller.buildContextMenu(aPopup);
|
||||
]]></body>
|
||||
</method>
|
||||
|
|
|
@ -62,40 +62,50 @@
|
|||
|
||||
<commandset id="placesCommands"
|
||||
commandupdater="true"
|
||||
events="focus,sort"
|
||||
events="focus,sort,places"
|
||||
oncommandupdate="goUpdatePlacesCommands();">
|
||||
<command id="placesCmd_open"
|
||||
oncommand="goDoCommand('placesCmd_open');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_open');"/>
|
||||
<command id="placesCmd_open:window"
|
||||
oncommand="goDoCommand('placesCmd_open:window');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_open:window');"/>
|
||||
<command id="placesCmd_open:tab"
|
||||
oncommand="goDoCommand('placesCmd_open:tab');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_open:tab');"/>
|
||||
|
||||
<command id="placesCmd_new:bookmark"
|
||||
oncommand="goDoCommand('placesCmd_new:bookmark');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_new:bookmark');"/>
|
||||
<command id="placesCmd_new:livemark"
|
||||
oncommand="goDoCommand('placesCmd_new:livemark');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_new:livemark');"/>
|
||||
<command id="placesCmd_new:folder"
|
||||
oncommand="goDoCommand('placesCmd_new:folder');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_new:folder');"/>
|
||||
<command id="placesCmd_new:separator"
|
||||
oncommand="goDoCommand('placesCmd_new:separator');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_new:separator');"/>
|
||||
<command id="placesCmd_show:info"
|
||||
oncommand="goDoCommand('placesCmd_show:info');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_show:info');"/>
|
||||
<command id="placesCmd_rename"
|
||||
oncommand="goDoCommand('placesCmd_show:info');"
|
||||
oncommand="goDoPlacesCommand('placesCmd_show:info');"
|
||||
observes="placesCmd_show:info"/>
|
||||
<command id="placesCmd_reload"
|
||||
oncommand="goDoCommand('placesCmd_reload');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_reload');"/>
|
||||
<command id="placesCmd_reloadMicrosummary"
|
||||
oncommand="goDoCommand('placesCmd_reloadMicrosummary');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_reloadMicrosummary');"/>
|
||||
<command id="placesCmd_sortBy:name"
|
||||
oncommand="goDoCommand('placesCmd_sortBy:name');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_sortBy:name');"/>
|
||||
<command id="placesCmd_moveBookmarks"
|
||||
oncommand="goDoCommand('placesCmd_moveBookmarks');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_moveBookmarks');"/>
|
||||
<command id="placesCmd_deleteDataHost"
|
||||
oncommand="goDoCommand('placesCmd_deleteDataHost');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_deleteDataHost');"/>
|
||||
<command id="placesCmd_createBookmark"
|
||||
oncommand="goDoCommand('placesCmd_createBookmark');"/>
|
||||
oncommand="goDoPlacesCommand('placesCmd_createBookmark');"/>
|
||||
|
||||
<!-- Special versions of cut/copy/paste/delete which check for an open context menu. -->
|
||||
<command id="placesCmd_cut"
|
||||
oncommand="goDoPlacesCommand('placesCmd_cut');"/>
|
||||
<command id="placesCmd_copy"
|
||||
oncommand="goDoPlacesCommand('placesCmd_copy');"/>
|
||||
<command id="placesCmd_paste"
|
||||
oncommand="goDoPlacesCommand('placesCmd_paste');"/>
|
||||
<command id="placesCmd_delete"
|
||||
oncommand="goDoPlacesCommand('placesCmd_delete');"/>
|
||||
</commandset>
|
||||
|
||||
<popup id="placesContext"
|
||||
|
@ -165,20 +175,20 @@
|
|||
selection="link"
|
||||
forcehideselection="bookmark|tagChild"/>
|
||||
<menuitem id="placesContext_cut"
|
||||
command="cmd_cut"
|
||||
command="placesCmd_cut"
|
||||
label="&cutCmd.label;"
|
||||
accesskey="&cutCmd.accesskey;"
|
||||
closemenu="single"
|
||||
selection="bookmark|folder|separator|query"
|
||||
forcehideselection="tagChild|livemarkChild"/>
|
||||
<menuitem id="placesContext_copy"
|
||||
command="cmd_copy"
|
||||
command="placesCmd_copy"
|
||||
label="©Cmd.label;"
|
||||
closemenu="single"
|
||||
accesskey="©Cmd.accesskey;"
|
||||
selection="any"/>
|
||||
<menuitem id="placesContext_paste"
|
||||
command="cmd_paste"
|
||||
command="placesCmd_paste"
|
||||
label="&pasteCmd.label;"
|
||||
closemenu="single"
|
||||
accesskey="&pasteCmd.accesskey;"
|
||||
|
@ -186,13 +196,13 @@
|
|||
hideifnoinsertionpoint="true"/>
|
||||
<menuseparator id="placesContext_editSeparator"/>
|
||||
<menuitem id="placesContext_delete"
|
||||
command="cmd_delete"
|
||||
command="placesCmd_delete"
|
||||
label="&deleteCmd.label;"
|
||||
accesskey="&deleteCmd.accesskey;"
|
||||
closemenu="single"
|
||||
selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
|
||||
<menuitem id="placesContext_delete_history"
|
||||
command="cmd_delete"
|
||||
command="placesCmd_delete"
|
||||
label="&cmd.delete.label;"
|
||||
accesskey="&cmd.delete.accesskey;"
|
||||
closemenu="single"
|
||||
|
|
|
@ -725,11 +725,7 @@
|
|||
<parameter name="aPopup"/>
|
||||
<body><![CDATA[
|
||||
this._contextMenuShown = true;
|
||||
// Activate the controller
|
||||
this.focus();
|
||||
// The above call may not always fire a consumable event for
|
||||
// commandUpdater, so we force a command update.
|
||||
window.updateCommands("focus");
|
||||
window.updateCommands("places");
|
||||
return this.controller.buildContextMenu(aPopup);
|
||||
]]></body>
|
||||
</method>
|
||||
|
|
|
@ -78,21 +78,23 @@
|
|||
showcommentcolumn="true"
|
||||
tabscrolling="true"
|
||||
xbl:inherits="disabled,disableautocomplete,searchengine,src,newlines">
|
||||
<xul:button class="searchbar-engine-button"
|
||||
type="menu"
|
||||
anonid="searchbar-engine-button"
|
||||
chromedir="&locale.dir;">
|
||||
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
|
||||
<xul:image class="searchbar-dropmarker-image"/>
|
||||
<xul:menupopup class="searchbar-popup"
|
||||
anonid="searchbar-popup">
|
||||
<xul:menuseparator/>
|
||||
<xul:menuitem class="open-engine-manager"
|
||||
anonid="open-engine-manager"
|
||||
label="&cmd_engineManager.label;"
|
||||
oncommand="openManager(event);"/>
|
||||
</xul:menupopup>
|
||||
</xul:button>
|
||||
<xul:box>
|
||||
<xul:button class="searchbar-engine-button"
|
||||
type="menu"
|
||||
anonid="searchbar-engine-button"
|
||||
chromedir="&locale.dir;">
|
||||
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
|
||||
<xul:image class="searchbar-dropmarker-image"/>
|
||||
<xul:menupopup class="searchbar-popup"
|
||||
anonid="searchbar-popup">
|
||||
<xul:menuseparator/>
|
||||
<xul:menuitem class="open-engine-manager"
|
||||
anonid="open-engine-manager"
|
||||
label="&cmd_engineManager.label;"
|
||||
oncommand="openManager(event);"/>
|
||||
</xul:menupopup>
|
||||
</xul:button>
|
||||
</xul:box>
|
||||
<xul:hbox class="search-go-container" chromedir="&locale.dir;">
|
||||
<xul:image class="search-go-button"
|
||||
anonid="search-go-button"
|
||||
|
|
|
@ -141,7 +141,6 @@ offlineApps.manageUsageAccessKey=S
|
|||
identity.identified.verifier=Verified by: %S
|
||||
identity.identified.verified_by_you=You have added a security exception for this site
|
||||
identity.identified.state_and_country=%S, %S
|
||||
identity.identified.title_with_country=%S (%S)
|
||||
|
||||
identity.encrypted=Your connection to this web site is encrypted to prevent eavesdropping.
|
||||
identity.unencrypted=Your connection to this web site is not encrypted.
|
||||
|
|
|
@ -892,13 +892,8 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
|
|||
background-color: rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
#identity-icon-label {
|
||||
#identity-icon-labels {
|
||||
padding: 0 2px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#identity-icon-label[value=""] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#identity-box.verifiedDomain {
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
background-color: -moz-field;
|
||||
}
|
||||
|
||||
.autocomplete-textbox-container {
|
||||
-moz-box-align: stretch;
|
||||
}
|
||||
|
||||
.textbox-input-box {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
Двоичные данные
browser/themes/pinstripe/browser/Geo.png
До Ширина: | Высота: | Размер: 771 B После Ширина: | Высота: | Размер: 723 B |
|
@ -779,48 +779,131 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
/* ::::: nav-bar-inner ::::: */
|
||||
|
||||
#urlbar {
|
||||
-moz-appearance: none;
|
||||
direction: ltr !important;
|
||||
border: none;
|
||||
background: url("chrome://browser/skin/urlbar/endcap.png") transparent right center no-repeat;
|
||||
margin: 0 3px 1px;
|
||||
-moz-padding-end: 11px;
|
||||
font: icon !important;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.searchbar-textbox,
|
||||
#urlbar {
|
||||
font: icon;
|
||||
width: 7em;
|
||||
min-width: 7em;
|
||||
height: 28px;
|
||||
-moz-appearance: none;
|
||||
-moz-background-clip: padding;
|
||||
-moz-border-radius: 100%;
|
||||
border: 1px solid;
|
||||
-moz-border-top-colors: #666;
|
||||
-moz-border-right-colors: #777;
|
||||
-moz-border-bottom-colors: #888;
|
||||
-moz-border-left-colors: #777;
|
||||
-moz-box-shadow: 0 1px 1px rgba(0,0,0,.3) inset,
|
||||
0 1px 0 rgba(255,255,255,.3);
|
||||
margin-top: 0;
|
||||
margin-bottom: 1px;
|
||||
-moz-padding-end: 6px;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"],
|
||||
#urlbar[focused="true"] {
|
||||
background: url("chrome://browser/skin/urlbar/endcap-focused.png") transparent right center no-repeat;
|
||||
-moz-border-top-colors: rgba(0,0,0,.3);
|
||||
-moz-border-right-colors: rgba(0,0,0,.2);
|
||||
-moz-border-bottom-colors: rgba(0,0,0,.15);
|
||||
-moz-border-left-colors: rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 0 1px 1px rgba(0,0,0,.3) inset,
|
||||
0 0 1px -moz-mac-focusring inset,
|
||||
0 0 4px 1px -moz-mac-focusring,
|
||||
0 0 2px 1px -moz-mac-focusring;
|
||||
}
|
||||
|
||||
#urlbar[focused="true"]:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite.png");
|
||||
.searchbar-engine-button,
|
||||
#identity-box {
|
||||
background: #fff url(navbar-textbox-button.png) bottom repeat-x;
|
||||
-moz-background-clip: padding;
|
||||
color: black;
|
||||
-moz-padding-start: 6px;
|
||||
-moz-padding-end: 16px;
|
||||
-moz-border-radius: 100%;
|
||||
border-top: 1px solid rgba(0,0,0,.35);
|
||||
-moz-border-start: 1px solid rgba(0,0,0,.25);
|
||||
border-bottom: 1px solid rgba(0,0,0,.2);
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
-moz-margin-start: -1px;
|
||||
-moz-margin-end: 0;
|
||||
}
|
||||
|
||||
#urlbar .textbox-input-box,
|
||||
#urlbar-icons {
|
||||
margin: 0;
|
||||
background: url("chrome://browser/skin/urlbar/textfield-mid.png") transparent left center repeat-x;
|
||||
#identity-box:focus:not(:active):not([open="true"]) #page-proxy-stack {
|
||||
-moz-border-radius: 4px;
|
||||
-moz-box-shadow: 0 0 3px 1px -moz-mac-focusring inset,
|
||||
0 0 3px 2px -moz-mac-focusring;
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] .textbox-input-box,
|
||||
#urlbar[focused="true"] #urlbar-icons {
|
||||
background-image: url("chrome://browser/skin/urlbar/textfield-mid-focused.png");
|
||||
.searchbar-textbox[focused="true"] .searchbar-engine-button,
|
||||
#urlbar[focused="true"] > #identity-box {
|
||||
-moz-box-shadow: 0 0 1px -moz-mac-focusring inset;
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] .textbox-input-box:-moz-system-metric(mac-graphite-theme),
|
||||
#urlbar[focused="true"] #urlbar-icons:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/textfield-mid-focused-graphite.png");
|
||||
}
|
||||
|
||||
#urlbar .textbox-input-box {
|
||||
.searchbar-engine-button[open="true"],
|
||||
.searchbar-engine-button:hover:active,
|
||||
#identity-box[open="true"],
|
||||
#identity-box:hover:active {
|
||||
border-style: none;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
-moz-padding-start: 7px;
|
||||
-moz-box-shadow: 0 0 50px rgba(0,0,0,.3) inset,
|
||||
0 3px 3px rgba(0,0,0,.6) inset,
|
||||
2px 0 2px rgba(0,0,0,.3) inset,
|
||||
0 -2px 2px rgba(0,0,0,.1) inset !important;
|
||||
}
|
||||
|
||||
.autocomplete-textbox {
|
||||
background-image: inherit !important;
|
||||
#identity-box.verifiedDomain {
|
||||
background-image: url(navbar-textbox-button-verifiedDomain.png);
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity {
|
||||
background-image: url(navbar-textbox-button-verifiedIdentity.png);
|
||||
}
|
||||
|
||||
#identity-icon-labels {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box,
|
||||
#urlbar > .autocomplete-textbox-container > .textbox-input-box {
|
||||
-moz-margin-end: 0;
|
||||
-moz-margin-start: -16px;
|
||||
background-color: -moz-field;
|
||||
-moz-padding-start: 10px;
|
||||
}
|
||||
|
||||
.searchbar-textbox[chromedir="ltr"] > .autocomplete-textbox-container > .textbox-input-box,
|
||||
#urlbar > .autocomplete-textbox-container > .textbox-input-box {
|
||||
-moz-border-radius-topleft: 100%;
|
||||
-moz-border-radius-bottomleft: 100%;
|
||||
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,.3) inset,
|
||||
1px 0 0 rgba(0,0,0,.2) inset;
|
||||
}
|
||||
|
||||
.searchbar-textbox[chromedir="rtl"] > .autocomplete-textbox-container > .textbox-input-box {
|
||||
-moz-border-radius-topright: 100%;
|
||||
-moz-border-radius-bottomright: 100%;
|
||||
-moz-box-shadow: -1px 1px 1px rgba(0,0,0,.3) inset,
|
||||
-1px 0 0 rgba(0,0,0,.2) inset;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"][chromedir="ltr"] > .autocomplete-textbox-container > .textbox-input-box,
|
||||
#urlbar[focused="true"] > .autocomplete-textbox-container > .textbox-input-box {
|
||||
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,.3) inset,
|
||||
1px 0 0 rgba(0,0,0,.2) inset,
|
||||
2px 0 0 -moz-field inset,
|
||||
1px 0 1px -moz-mac-focusring inset;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"][chromedir="rtl"] > .autocomplete-textbox-container > .textbox-input-box {
|
||||
-moz-box-shadow: -1px 1px 1px rgba(0,0,0,.3) inset,
|
||||
-1px 0 0 rgba(0,0,0,.2) inset,
|
||||
-2px 0 0 -moz-field inset,
|
||||
-1px 0 1px -moz-mac-focusring inset;
|
||||
}
|
||||
|
||||
#urlbar-icons {
|
||||
|
@ -828,13 +911,10 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
}
|
||||
|
||||
#urlbar-search-splitter {
|
||||
/* This is a bit of a mess, because the location bar and the search bar are bigger
|
||||
than they look. For example, -moz-margin-start: -6px should really be -4px.
|
||||
Bug 482086 and bug 482105 will solve this. */
|
||||
min-width: 8px;
|
||||
width: 8px;
|
||||
background-image: none;
|
||||
-moz-margin-start: -6px;
|
||||
-moz-margin-start: -4px;
|
||||
}
|
||||
|
||||
#urlbar-search-splitter + #urlbar-container > #urlbar,
|
||||
|
@ -842,34 +922,6 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
-moz-margin-start: 0;
|
||||
}
|
||||
|
||||
#wrapper-urlbar-container #urlbar,
|
||||
#urlbar[readonly="true"] {
|
||||
-moz-padding-end: 12px;
|
||||
}
|
||||
|
||||
#wrapper-urlbar-container[place="palette"] {
|
||||
max-width: 20em;
|
||||
}
|
||||
|
||||
#wrapper-urlbar-container > #urlbar-container > #urlbar > #identity-box > hbox > #identity-icon-label,
|
||||
#wrapper-urlbar-container #urlbar > .autocomplete-history-dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#wrapper-urlbar-container > #urlbar-container > #urlbar > #identity-box.verifiedIdentity > hbox > #identity-icon-label,
|
||||
#wrapper-urlbar-container > #urlbar-container > #urlbar > #identity-box.verifiedDomain > hbox > #identity-icon-label {
|
||||
display: -moz-box;
|
||||
}
|
||||
|
||||
/* Keep the URL bar LTR */
|
||||
|
||||
#PopupAutoCompleteRichResult {
|
||||
direction: ltr !important;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
/* ----- PAGE PROXY ICON ----- */
|
||||
|
||||
#page-proxy-favicon,
|
||||
#urlbar-throbber {
|
||||
width: 16px;
|
||||
|
@ -879,11 +931,14 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
}
|
||||
|
||||
#page-proxy-stack {
|
||||
-moz-margin-start: 10px;
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
padding: 2px 4px;
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity > hbox > #page-proxy-stack,
|
||||
#identity-box.verifiedDomain > hbox > #page-proxy-stack {
|
||||
background: url(urlbar-favicon-glow.png) center center no-repeat;
|
||||
}
|
||||
|
||||
#page-proxy-favicon:not([src]) {
|
||||
|
@ -898,6 +953,19 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
list-style-image: url("chrome://browser/skin/places/searching_16.png");
|
||||
}
|
||||
|
||||
#wrapper-urlbar-container[place="palette"] {
|
||||
max-width: 20em;
|
||||
}
|
||||
|
||||
#wrapper-urlbar-container #identity-icon-labels,
|
||||
#wrapper-urlbar-container .autocomplete-history-dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#PopupAutoCompleteRichResult {
|
||||
direction: ltr !important;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
statusbarpanel#statusbar-display {
|
||||
-moz-padding-start: 0;
|
||||
|
@ -1763,19 +1831,13 @@ tabbrowser > tabbox > tabpanels {
|
|||
}
|
||||
|
||||
.tabs-closebutton {
|
||||
padding-right: 4px;
|
||||
list-style-image: url("chrome://global/skin/icons/closetab.png") !important;
|
||||
list-style-image: none;
|
||||
-moz-padding-end: 4px;
|
||||
list-style-image: url("chrome://global/skin/icons/closetab.png");
|
||||
border: none;
|
||||
-moz-box-align: stretch;
|
||||
}
|
||||
|
||||
.tabs-closebutton:hover > .toolbarbutton-icon {
|
||||
background-image: none !important;
|
||||
}
|
||||
|
||||
.tabs-closebutton:hover:active {
|
||||
list-style-image: url("chrome://global/skin/icons/closetab-active.png") !important;
|
||||
list-style-image: url("chrome://global/skin/icons/closetab-active.png");
|
||||
}
|
||||
|
||||
tabpanels.plain {
|
||||
|
@ -1833,179 +1895,6 @@ tabpanels.plain {
|
|||
-moz-border-left-colors: ThreeDLightShadow ThreeDHighlight !important;
|
||||
}
|
||||
|
||||
/* ::::: Identity Indicator Styling ::::: */
|
||||
/* Location bar visuals*/
|
||||
|
||||
#identity-box {
|
||||
background: url("chrome://browser/skin/urlbar/startcap.png") left center no-repeat;
|
||||
min-width: 45px;
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite.png");
|
||||
}
|
||||
|
||||
#identity-box:focus > hbox > #page-proxy-deck {
|
||||
outline: 2px solid #4F8EC9;
|
||||
-moz-outline-radius: 2px;
|
||||
}
|
||||
|
||||
#identity-box:hover:active,
|
||||
#identity-box[open="true"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active.png");
|
||||
}
|
||||
|
||||
#identity-icon-label {
|
||||
margin: 0;
|
||||
color: black;
|
||||
padding: 4px 6px 3px;
|
||||
-moz-padding-end: 14px;
|
||||
}
|
||||
|
||||
#identity-box.unknownIdentity > hbox > #identity-icon-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* Verified domain */
|
||||
/* - Normal state */
|
||||
#identity-box.verifiedDomain {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-start.png");
|
||||
-moz-padding-start: 13px;
|
||||
}
|
||||
|
||||
#identity-box.verifiedDomain > hbox {
|
||||
padding: 0;
|
||||
background: url("chrome://browser/skin/urlbar/startcap-secure-mid.png") repeat-x center center;
|
||||
-moz-box-pack: center;
|
||||
}
|
||||
|
||||
#identity-box.verifiedDomain > hbox > #identity-icon-label {
|
||||
background: url("chrome://browser/skin/urlbar/startcap-secure-end.png") no-repeat center right;
|
||||
}
|
||||
|
||||
/* - Active state */
|
||||
#identity-box.verifiedDomain[open="true"],
|
||||
#identity-box.verifiedDomain:hover:active {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-active.png");
|
||||
}
|
||||
|
||||
#identity-box.verifiedDomain[open="true"] > hbox,
|
||||
#identity-box.verifiedDomain:hover:active > hbox {
|
||||
padding: 0;
|
||||
background: url("chrome://browser/skin/urlbar/startcap-secure-mid-active.png") repeat-x center center;
|
||||
-moz-box-pack: center;
|
||||
}
|
||||
|
||||
#identity-box.verifiedDomain[open="true"] > hbox > #identity-icon-label,
|
||||
#identity-box.verifiedDomain:hover:active > hbox > #identity-icon-label {
|
||||
background: url("chrome://browser/skin/urlbar/startcap-secure-end-active.png") no-repeat center right;
|
||||
}
|
||||
|
||||
/* - Focus state */
|
||||
#urlbar[focused="true"] > #identity-box.verifiedDomain {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-mid-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox > #identity-icon-label {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-end-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedDomain:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-focused-graphite.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-mid-focused-graphite.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox > #identity-icon-label:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-secure-end-focused-graphite.png");
|
||||
}
|
||||
|
||||
#identity-box.verifiedDomain > hbox > #identity-icon-label[value=""] {
|
||||
-moz-padding-start: 3px !important;
|
||||
-moz-padding-end: 8px !important;
|
||||
}
|
||||
|
||||
|
||||
/* Verified Identity */
|
||||
/* - Normal state */
|
||||
#identity-box.verifiedIdentity {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-start.png");
|
||||
-moz-padding-start: 13px;
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity > hbox {
|
||||
padding: 0;
|
||||
background: url("chrome://browser/skin/urlbar/startcap-verified-mid.png") repeat-x center center;
|
||||
-moz-box-pack: center;
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity > hbox > #identity-icon-label {
|
||||
background: url("chrome://browser/skin/urlbar/startcap-verified-end.png") no-repeat center right;
|
||||
}
|
||||
|
||||
/* - Active state */
|
||||
#identity-box.verifiedIdentity[open="true"],
|
||||
#identity-box.verifiedIdentity:hover:active {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-active.png");
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity[open="true"] > hbox,
|
||||
#identity-box.verifiedIdentity:hover:active > hbox {
|
||||
background: url("chrome://browser/skin/urlbar/startcap-verified-mid-active.png") repeat-x center center;
|
||||
}
|
||||
|
||||
#identity-box.verifiedIdentity[open="true"] > hbox > #identity-icon-label,
|
||||
#identity-box.verifiedIdentity:hover:active > hbox > #identity-icon-label {
|
||||
background: url("chrome://browser/skin/urlbar/startcap-verified-end-active.png") no-repeat center right;
|
||||
}
|
||||
|
||||
/* - Focus state */
|
||||
#urlbar[focused="true"] > #identity-box.verifiedIdentity {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-mid-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox > #identity-icon-label {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-end-focused.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedIdentity:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-focused-graphite.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-mid-focused-graphite.png");
|
||||
}
|
||||
|
||||
#urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox > #identity-icon-label:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-verified-end-focused-graphite.png");
|
||||
}
|
||||
|
||||
/* Favicon Glow */
|
||||
#identity-box.verifiedIdentity > hbox > #page-proxy-stack,
|
||||
#identity-box.verifiedDomain > hbox > #page-proxy-stack {
|
||||
-moz-margin-start: -3px;
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
padding: 2px 4px;
|
||||
background: url("chrome://browser/skin/urlbar/urlbar-favicon-glow.png") center center no-repeat;
|
||||
}
|
||||
|
||||
|
||||
/* Popup Icons */
|
||||
#identity-popup-icon {
|
||||
height: 64px;
|
||||
|
@ -2075,7 +1964,7 @@ tabpanels.plain {
|
|||
-moz-window-shadow: none;
|
||||
background-color: transparent;
|
||||
margin-top: -4px;
|
||||
margin-left: -13px;
|
||||
margin-left: -15px;
|
||||
min-width: 280px;
|
||||
-moz-border-image: url(chrome://browser/skin/hud-panel.png) 26 18 22 50 / 26px 18px 22px 50px repeat;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ classic.jar:
|
|||
skin/classic/browser/KUI-background.png
|
||||
skin/classic/browser/menu-back.png
|
||||
skin/classic/browser/menu-forward.png
|
||||
skin/classic/browser/navbar-textbox-button.png
|
||||
skin/classic/browser/navbar-textbox-button-verifiedDomain.png
|
||||
skin/classic/browser/navbar-textbox-button-verifiedIdentity.png
|
||||
skin/classic/browser/page-livemarks.png
|
||||
skin/classic/browser/livemark-item.png
|
||||
skin/classic/browser/pageInfo.css
|
||||
|
@ -50,6 +53,7 @@ classic.jar:
|
|||
skin/classic/browser/Secure-background.gif
|
||||
skin/classic/browser/Toolbar.png
|
||||
skin/classic/browser/Toolbar-rtl.png
|
||||
skin/classic/browser/urlbar-favicon-glow.png
|
||||
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
|
||||
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
|
||||
|
@ -121,53 +125,5 @@ classic.jar:
|
|||
skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)
|
||||
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
|
||||
skin/classic/browser/tabbrowser/tab-bkgnd.png (tabbrowser/tab-bkgnd.png)
|
||||
skin/classic/browser/urlbar/endcap.png (urlbar/endcap.png)
|
||||
skin/classic/browser/urlbar/endcap-rtl.png (urlbar/endcap-rtl.png)
|
||||
skin/classic/browser/urlbar/endcap-focused.png (urlbar/endcap-focused.png)
|
||||
skin/classic/browser/urlbar/endcap-focused-graphite.png (urlbar/endcap-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/endcap-focused-graphite-rtl.png (urlbar/endcap-focused-graphite-rtl.png)
|
||||
skin/classic/browser/urlbar/endcap-focused-rtl.png (urlbar/endcap-focused-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap.png (urlbar/startcap.png)
|
||||
skin/classic/browser/urlbar/startcap-rtl.png (urlbar/startcap-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap-focused.png (urlbar/startcap-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-focused-graphite.png (urlbar/startcap-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-focused-graphite-rtl.png (urlbar/startcap-focused-graphite-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap-focused-rtl.png (urlbar/startcap-focused-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-start.png (urlbar/startcap-secure-start.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-mid.png (urlbar/startcap-secure-mid.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-end.png (urlbar/startcap-secure-end.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-start-active.png (urlbar/startcap-secure-start-active.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-mid-active.png (urlbar/startcap-secure-mid-active.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-end-active.png (urlbar/startcap-secure-end-active.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-start-focused.png (urlbar/startcap-secure-start-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-start-focused-graphite.png (urlbar/startcap-secure-start-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-mid-focused.png (urlbar/startcap-secure-mid-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-mid-focused-graphite.png (urlbar/startcap-secure-mid-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-end-focused.png (urlbar/startcap-secure-end-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-end-focused-graphite.png (urlbar/startcap-secure-end-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-start.png (urlbar/startcap-verified-start.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-mid.png (urlbar/startcap-verified-mid.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-end.png (urlbar/startcap-verified-end.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-start-active.png (urlbar/startcap-verified-start-active.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-mid-active.png (urlbar/startcap-verified-mid-active.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-end-active.png (urlbar/startcap-verified-end-active.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-start-focused.png (urlbar/startcap-verified-start-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-start-focused-graphite.png (urlbar/startcap-verified-start-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-mid-focused.png (urlbar/startcap-verified-mid-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-mid-focused-graphite.png (urlbar/startcap-verified-mid-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-end-focused.png (urlbar/startcap-verified-end-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-verified-end-focused-graphite.png (urlbar/startcap-verified-end-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-secure.png (urlbar/startcap-secure.png)
|
||||
skin/classic/browser/urlbar/startcap-active.png (urlbar/startcap-active.png)
|
||||
skin/classic/browser/urlbar/startcap-active-rtl.png (urlbar/startcap-active-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap-active-focused.png (urlbar/startcap-active-focused.png)
|
||||
skin/classic/browser/urlbar/startcap-active-focused-graphite.png (urlbar/startcap-active-focused-graphite.png)
|
||||
skin/classic/browser/urlbar/startcap-active-focused-graphite-rtl.png (urlbar/startcap-active-focused-graphite-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap-active-focused-rtl.png (urlbar/startcap-active-focused-rtl.png)
|
||||
skin/classic/browser/urlbar/startcap-secure-active.png (urlbar/startcap-secure-active.png)
|
||||
skin/classic/browser/urlbar/urlbar-favicon-glow.png (urlbar/urlbar-favicon-glow.png)
|
||||
skin/classic/browser/urlbar/textfield-mid.png (urlbar/textfield-mid.png)
|
||||
skin/classic/browser/urlbar/textfield-mid-focused.png (urlbar/textfield-mid-focused.png)
|
||||
skin/classic/browser/urlbar/textfield-mid-focused-graphite.png (urlbar/textfield-mid-focused-graphite.png)
|
||||
icon.png
|
||||
preview.png
|
||||
|
|
Двоичные данные
browser/themes/pinstripe/browser/navbar-textbox-button-verifiedDomain.png
Executable file
После Ширина: | Высота: | Размер: 207 B |
Двоичные данные
browser/themes/pinstripe/browser/navbar-textbox-button-verifiedIdentity.png
Executable file
После Ширина: | Высота: | Размер: 208 B |
После Ширина: | Высота: | Размер: 217 B |
|
@ -1,31 +1,3 @@
|
|||
/* *** pinstripe *** */
|
||||
|
||||
.searchbar-textbox {
|
||||
-moz-appearance: none;
|
||||
font: icon;
|
||||
height: 28px;
|
||||
width: 5em;
|
||||
margin: 0 3px 1px;
|
||||
min-width: 5em;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box {
|
||||
background: url("chrome://browser/skin/urlbar/textfield-mid.png") repeat-x;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
-moz-margin-start: 45px;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .autocomplete-textbox-container > .textbox-input-box {
|
||||
background-image: url("chrome://browser/skin/urlbar/textfield-mid-focused.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .autocomplete-textbox-container > .textbox-input-box:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/textfield-mid-focused-graphite.png");
|
||||
}
|
||||
|
||||
.searchbar-engine-image {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
@ -34,65 +6,8 @@
|
|||
}
|
||||
|
||||
.searchbar-engine-button {
|
||||
background: url("chrome://browser/skin/urlbar/startcap.png") center center no-repeat;
|
||||
-moz-appearance: none;
|
||||
height: 28px;
|
||||
min-width: 45px;
|
||||
border: 0;
|
||||
-moz-box-align: center;
|
||||
margin: 0;
|
||||
-moz-margin-start: -45px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.searchbar-engine-button[chromedir="rtl"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-rtl.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-rtl.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite-rtl.png");
|
||||
}
|
||||
|
||||
.searchbar-engine-button:hover:active,
|
||||
.searchbar-engine-button[open="true"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-engine-button:hover:active[chromedir="rtl"],
|
||||
.searchbar-engine-button[open="true"][chromedir="rtl"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-rtl.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:active,
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:active,
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"][chromedir="rtl"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-rtl.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:active:-moz-system-metric(mac-graphite-theme),
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"]:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-graphite.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:active:-moz-system-metric(mac-graphite-theme),
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"][chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-graphite-rtl.png") !important;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.searchbar-engine-button > .button-box {
|
||||
|
@ -103,7 +18,11 @@
|
|||
}
|
||||
|
||||
.searchbar-engine-button[addengines="true"] > .button-box {
|
||||
background: transparent url(chrome://browser/skin/Search-addengines.png) no-repeat 25px 50%;
|
||||
background: transparent url(chrome://browser/skin/Search-addengines.png) no-repeat right center;
|
||||
}
|
||||
|
||||
.searchbar-textbox[chromedir="rtl"] .searchbar-engine-button[addengines="true"] > .button-box {
|
||||
background-position: left center;
|
||||
}
|
||||
|
||||
.searchbar-dropmarker-image {
|
||||
|
@ -114,36 +33,10 @@
|
|||
|
||||
.search-go-container {
|
||||
-moz-box-align: center;
|
||||
background: url("chrome://browser/skin/urlbar/endcap.png") no-repeat right top;
|
||||
-moz-padding-end: 5px;
|
||||
}
|
||||
|
||||
.search-go-container[chromedir="rtl"] {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-rtl.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .search-go-container {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-focused.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .search-go-container[chromedir="rtl"] {
|
||||
background: url("chrome://browser/skin/urlbar/endcap-focused-rtl.png") no-repeat left top;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .search-go-container:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .search-go-container[chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite-rtl.png");
|
||||
}
|
||||
|
||||
.search-go-button {
|
||||
padding: 1px;
|
||||
list-style-image: url("chrome://browser/skin/Search.png");
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-moz-padding-end: 6px;
|
||||
}
|
||||
|
||||
.searchbar-engine-menuitem[selected="true"] > .menu-iconic-text {
|
||||
|
|
До Ширина: | Высота: | Размер: 504 B После Ширина: | Высота: | Размер: 504 B |
До Ширина: | Высота: | Размер: 941 B |
До Ширина: | Высота: | Размер: 1.0 KiB |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/endcap-focused-rtl.png
До Ширина: | Высота: | Размер: 827 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/endcap-focused.png
До Ширина: | Высота: | Размер: 894 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/endcap-rtl.png
До Ширина: | Высота: | Размер: 629 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/endcap-secure.png
До Ширина: | Высота: | Размер: 611 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/endcap.png
До Ширина: | Высота: | Размер: 671 B |
До Ширина: | Высота: | Размер: 1.7 KiB |
До Ширина: | Высота: | Размер: 1.6 KiB |
До Ширина: | Высота: | Размер: 1.5 KiB |
До Ширина: | Высота: | Размер: 1.5 KiB |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-active-rtl.png
До Ширина: | Высота: | Размер: 1.3 KiB |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-active.png
До Ширина: | Высота: | Размер: 1.3 KiB |
До Ширина: | Высота: | Размер: 1.7 KiB |
До Ширина: | Высота: | Размер: 1.6 KiB |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-focused-rtl.png
До Ширина: | Высота: | Размер: 1.5 KiB |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-focused.png
До Ширина: | Высота: | Размер: 1.5 KiB |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-rtl.png
До Ширина: | Высота: | Размер: 1.3 KiB |
До Ширина: | Высота: | Размер: 1.3 KiB |
До Ширина: | Высота: | Размер: 550 B |
До Ширина: | Высота: | Размер: 585 B |
До Ширина: | Высота: | Размер: 583 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-secure-end.png
До Ширина: | Высота: | Размер: 553 B |
До Ширина: | Высота: | Размер: 228 B |
До Ширина: | Высота: | Размер: 246 B |
До Ширина: | Высота: | Размер: 239 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-secure-mid.png
До Ширина: | Высота: | Размер: 216 B |
До Ширина: | Высота: | Размер: 741 B |
До Ширина: | Высота: | Размер: 897 B |
До Ширина: | Высота: | Размер: 755 B |
До Ширина: | Высота: | Размер: 596 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap-secure.png
До Ширина: | Высота: | Размер: 1.3 KiB |
До Ширина: | Высота: | Размер: 548 B |
До Ширина: | Высота: | Размер: 584 B |
До Ширина: | Высота: | Размер: 580 B |
До Ширина: | Высота: | Размер: 465 B |
До Ширина: | Высота: | Размер: 552 B |
До Ширина: | Высота: | Размер: 228 B |
До Ширина: | Высота: | Размер: 248 B |
До Ширина: | Высота: | Размер: 237 B |
До Ширина: | Высота: | Размер: 219 B |
До Ширина: | Высота: | Размер: 741 B |
До Ширина: | Высота: | Размер: 908 B |
До Ширина: | Высота: | Размер: 782 B |
До Ширина: | Высота: | Размер: 588 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/startcap.png
До Ширина: | Высота: | Размер: 1.3 KiB |
До Ширина: | Высота: | Размер: 204 B |
До Ширина: | Высота: | Размер: 193 B |
До Ширина: | Высота: | Размер: 146 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/textfield-mid-secure.png
До Ширина: | Высота: | Размер: 141 B |
Двоичные данные
browser/themes/pinstripe/browser/urlbar/textfield-mid.png
До Ширина: | Высота: | Размер: 160 B |
|
@ -1551,7 +1551,6 @@ tabpanels {
|
|||
}
|
||||
|
||||
.tabs-newtab-button {
|
||||
opacity: .8;
|
||||
list-style-image: url(chrome://browser/skin/tabbrowser/newtab.png);
|
||||
-moz-image-region: rect(0, 18px, 18px, 0);
|
||||
}
|
||||
|
@ -1868,13 +1867,8 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
outline: 1px dotted white;
|
||||
}
|
||||
|
||||
#identity-icon-label {
|
||||
#identity-icon-labels {
|
||||
padding: 0 2px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#identity-icon-label[value=""] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Popup Icons */
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
min-width: 6em;
|
||||
}
|
||||
|
||||
.autocomplete-textbox-container {
|
||||
-moz-box-align: stretch;
|
||||
}
|
||||
|
||||
.searchbar-textbox:-moz-system-metric(windows-default-theme) {
|
||||
-moz-appearance: none;
|
||||
border-width: 1px;
|
||||
|
@ -33,8 +37,6 @@
|
|||
margin: 0;
|
||||
-moz-margin-end: 3px;
|
||||
padding: 0;
|
||||
height: 1.23em;
|
||||
min-height: 20px;
|
||||
-moz-box-align: center;
|
||||
background: -moz-dialog url(navbar-textbox-buttons.png) repeat-x;
|
||||
border: 0 solid;
|
||||
|
|
|
@ -257,6 +257,7 @@ user_pref("svg.smil.enabled", true); // Needed for SMIL mochitests until bug 482
|
|||
user_pref("media.cache_size", 100);
|
||||
user_pref("security.warn_viewing_mixed", false);
|
||||
|
||||
user_pref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
|
||||
user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
|
||||
"""
|
||||
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
#include "nsCaseTreatment.h"
|
||||
#include "nsChangeHint.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIDocument.h" // for IsInHTMLDocument
|
||||
|
||||
// Forward declarations
|
||||
class nsIAtom;
|
||||
class nsIDocument;
|
||||
class nsPresContext;
|
||||
class nsIDOMEvent;
|
||||
class nsIContent;
|
||||
|
@ -63,8 +63,8 @@ class nsISMILAttr;
|
|||
|
||||
// IID for the nsIContent interface
|
||||
#define NS_ICONTENT_IID \
|
||||
{ 0x3ca5afbe, 0x1052, 0x4682, \
|
||||
{ 0x9f, 0xa0, 0x0e, 0x39, 0xe4, 0xf8, 0xef, 0x9d } }
|
||||
{ 0x08dadcc4, 0x057a, 0x4b8d, \
|
||||
{ 0x89, 0x43, 0x30, 0x0e, 0x61, 0xc6, 0x9d, 0x36 } }
|
||||
|
||||
/**
|
||||
* A node of content in a document's content model. This interface
|
||||
|
@ -202,6 +202,17 @@ public:
|
|||
return IsInNativeAnonymousSubtree() || GetBindingParent() != nsnull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true iff this node is in an HTML document (in the HTML5 sense of
|
||||
* the term, i.e. not in an XHTML/XML document).
|
||||
*/
|
||||
inline PRBool IsInHTMLDocument() const
|
||||
{
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
return doc && // XXX clean up after bug 335998 lands
|
||||
!doc->IsCaseSensitive();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the namespace that this element's tag is defined in
|
||||
* @return the namespace
|
||||
|
@ -456,36 +467,6 @@ public:
|
|||
*/
|
||||
virtual void AppendTextTo(nsAString& aResult) = 0;
|
||||
|
||||
/**
|
||||
* Set the focus on this content. This is generally something for the event
|
||||
* state manager to do, not ordinary people. Ordinary people should do
|
||||
* something like nsGenericHTMLElement::SetElementFocus(). This method is
|
||||
* the end result, the point where the content finds out it has been focused.
|
||||
*
|
||||
* All content elements are potentially focusable.
|
||||
*
|
||||
* @param aPresContext the pres context
|
||||
* @see nsGenericHTMLElement::SetElementFocus()
|
||||
*/
|
||||
virtual void SetFocus(nsPresContext* aPresContext)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the focus on this content. This is generally something for the
|
||||
* event state manager to do, not ordinary people. Ordinary people should do
|
||||
* something like nsGenericHTMLElement::SetElementFocus(). This method is
|
||||
* the end result, the point where the content finds out it has been focused.
|
||||
*
|
||||
* All content elements are potentially focusable.
|
||||
*
|
||||
* @param aPresContext the pres context
|
||||
* @see nsGenericHTMLElement::SetElementFocus()
|
||||
*/
|
||||
virtual void RemoveFocus(nsPresContext* aPresContext)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this content is focusable and in the current tab order.
|
||||
* Note: most callers should use nsIFrame::IsFocusable() instead as it
|
||||
|
|
|
@ -115,6 +115,7 @@
|
|||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
// for radio group stuff
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
|
@ -2493,28 +2494,15 @@ nsDocument::HasFocus(PRBool* aResult)
|
|||
{
|
||||
*aResult = PR_FALSE;
|
||||
|
||||
nsPIDOMWindow* window = GetWindow();
|
||||
nsIFocusController* focusController = window ?
|
||||
window->GetRootFocusController() : nsnull;
|
||||
if (!focusController) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Does the top-level window have focus?
|
||||
PRBool active;
|
||||
nsresult rv = focusController->GetActive(&active);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!active){
|
||||
return NS_OK;
|
||||
}
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (!fm)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
// Is there a focused DOMWindow?
|
||||
nsCOMPtr<nsIDOMWindowInternal> focusedWindow;
|
||||
rv = focusController->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!focusedWindow) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsCOMPtr<nsIDOMWindow> focusedWindow;
|
||||
fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
||||
if (!focusedWindow)
|
||||
return NS_OK;
|
||||
|
||||
// Are we an ancestor of the focused DOMWindow?
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
|
@ -2546,56 +2534,29 @@ nsDocument::GetActiveElement(nsIDOMElement **aElement)
|
|||
*aElement = nsnull;
|
||||
|
||||
// Get the focused element.
|
||||
nsPIDOMWindow* window = GetWindow();
|
||||
nsCOMPtr<nsPIDOMWindow> window = GetWindow();
|
||||
if (!window) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsIFocusController* focusController = window->GetRootFocusController();
|
||||
if (!focusController) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (!fm)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> focusedElement;
|
||||
focusController->GetFocusedElement(getter_AddRefs(focusedElement));
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(focusedElement);
|
||||
if (content) {
|
||||
// Found a focused element. See if it's in this document.
|
||||
nsIDocument* currentDoc = content->GetCurrentDoc();
|
||||
if (currentDoc == this) {
|
||||
focusedElement.swap(*aElement);
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsPIDOMWindow> focusedWindow;
|
||||
nsIContent* focusedContent =
|
||||
nsFocusManager::GetFocusedDescendant(window, PR_FALSE, getter_AddRefs(focusedWindow));
|
||||
|
||||
// an element in this document is focused, so return it
|
||||
if (focusedContent) {
|
||||
// be safe and make sure the element is from this document
|
||||
if (focusedContent->GetOwnerDoc() != this) {
|
||||
NS_WARNING("Focused element found from another document");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Not in this document. If it's in a child document, return the iframe in
|
||||
// this document that's an ancestor of the child.
|
||||
if (currentDoc) {
|
||||
*aElement = CheckAncestryAndGetFrame(currentDoc).get();
|
||||
if (*aElement) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Couldn't find a focused element. Check if something like an IFRAME is
|
||||
// focused, which will give us a focused window rather than a focused
|
||||
// element.
|
||||
nsCOMPtr<nsIDOMWindowInternal> focusedWindow;
|
||||
focusController->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
||||
if (focusedWindow) {
|
||||
// Found a focused window. See if it's in a child of this document. (If
|
||||
// the window's document is this, then we should just fall through to
|
||||
// returning the BODY below).
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
focusedWindow->GetDocument(getter_AddRefs(domDocument));
|
||||
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDocument);
|
||||
|
||||
if (document && (document != this)) {
|
||||
*aElement = CheckAncestryAndGetFrame(document).get();
|
||||
if (*aElement) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
CallQueryInterface(focusedContent, aElement);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// No focused element anywhere in this document. Try to get the BODY.
|
||||
|
@ -7502,8 +7463,13 @@ static void
|
|||
FireOrClearDelayedEvents(nsTArray<nsCOMPtr<nsIDocument> >& aDocuments,
|
||||
PRBool aFireEvents)
|
||||
{
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (!fm)
|
||||
return;
|
||||
|
||||
for (PRUint32 i = 0; i < aDocuments.Length(); ++i) {
|
||||
if (!aDocuments[i]->EventHandlingSuppressed()) {
|
||||
fm->FireDelayedEvents(aDocuments[i]);
|
||||
nsPresShellIterator iter(aDocuments[i]);
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
while ((shell = iter.GetNextShell())) {
|
||||
|
|
|
@ -817,9 +817,7 @@ nsFrameLoader::EnsureDocShell()
|
|||
nsAutoString frameName;
|
||||
|
||||
PRInt32 namespaceID = mOwnerContent->GetNameSpaceID();
|
||||
if (namespaceID == kNameSpaceID_XHTML
|
||||
&& mOwnerContent->GetOwnerDoc() // clean up after bug 335998
|
||||
&& mOwnerContent->GetOwnerDoc()->IsCaseSensitive()) {
|
||||
if (namespaceID == kNameSpaceID_XHTML && !mOwnerContent->IsInHTMLDocument()) {
|
||||
mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::id, frameName);
|
||||
} else {
|
||||
mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, frameName);
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
#include "nsIDOMText.h"
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIURL.h"
|
||||
|
@ -124,7 +124,6 @@
|
|||
#include "nsIEditorDocShell.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsIView.h"
|
||||
|
@ -3072,84 +3071,29 @@ nsGenericElement::IsLink(nsIURI** aURI) const
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericElement::SetFocus(nsPresContext* aPresContext)
|
||||
{
|
||||
// Traditionally focusable elements can take focus as long as they don't set
|
||||
// the disabled attribute
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = aPresContext->PresShell();
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
|
||||
if (frame && frame->IsFocusable() &&
|
||||
aPresContext->EventStateManager()->SetContentState(this,
|
||||
NS_EVENT_STATE_FOCUS)) {
|
||||
presShell->ScrollContentIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,
|
||||
NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
PRBool
|
||||
nsGenericElement::ShouldFocus(nsIContent *aContent)
|
||||
{
|
||||
// Default to false, since if the document is not attached to a window,
|
||||
// we should not focus any of its content.
|
||||
PRBool visible = PR_FALSE;
|
||||
|
||||
// Figure out if we're focusing an element in an inactive (hidden)
|
||||
// tab (whose docshell is not visible), if so, drop this focus
|
||||
// request on the floor
|
||||
|
||||
nsIDocument *document = aContent->GetDocument();
|
||||
|
||||
if (document) {
|
||||
nsIScriptGlobalObject *sgo = document->GetScriptGlobalObject();
|
||||
|
||||
if (sgo) {
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(sgo));
|
||||
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(webNav));
|
||||
|
||||
if (baseWin) {
|
||||
baseWin->GetVisibility(&visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return visible;
|
||||
}
|
||||
|
||||
// static
|
||||
PRBool
|
||||
nsGenericElement::ShouldBlur(nsIContent *aContent)
|
||||
{
|
||||
// Determine if the current element is focused, if it is not focused
|
||||
// then we should not try to blur
|
||||
PRBool isFocused = PR_FALSE;
|
||||
|
||||
nsIDocument *document = aContent->GetDocument();
|
||||
if (!document)
|
||||
return PR_FALSE;
|
||||
|
||||
if (document) {
|
||||
nsPIDOMWindow *win = document->GetWindow();
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(document->GetWindow());
|
||||
if (!window)
|
||||
return PR_FALSE;
|
||||
|
||||
if (win) {
|
||||
nsCOMPtr<nsIFocusController> focusController =
|
||||
win->GetRootFocusController();
|
||||
nsCOMPtr<nsPIDOMWindow> focusedFrame;
|
||||
nsIContent* contentToBlur =
|
||||
nsFocusManager::GetFocusedDescendant(window, PR_FALSE, getter_AddRefs(focusedFrame));
|
||||
if (contentToBlur == aContent)
|
||||
return PR_TRUE;
|
||||
|
||||
if (focusController) {
|
||||
nsCOMPtr<nsIDOMElement> focusedElement;
|
||||
focusController->GetFocusedElement(getter_AddRefs(focusedElement));
|
||||
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(aContent);
|
||||
//when the element is the same as the focused element, blur it
|
||||
if (domElement == focusedElement)
|
||||
isFocused = PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isFocused;
|
||||
// if focus on this element would get redirected, then check the redirected
|
||||
// content as well when blurring.
|
||||
return (contentToBlur && nsFocusManager::GetRedirectedFocus(aContent) == contentToBlur);
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
|
@ -4999,28 +4943,15 @@ nsGenericElement::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
|
|||
// don't make the link grab the focus if there is no link handler
|
||||
nsILinkHandler *handler = aVisitor.mPresContext->GetLinkHandler();
|
||||
nsIDocument *document = GetCurrentDoc();
|
||||
if (handler && document && ShouldFocus(this)) {
|
||||
// If the window is not active, do not allow the focus to bring the
|
||||
// window to the front. We update the focus controller, but do nothing
|
||||
// else.
|
||||
nsPIDOMWindow *win = document->GetWindow();
|
||||
if (win) {
|
||||
nsIFocusController *focusController =
|
||||
win->GetRootFocusController();
|
||||
if (focusController) {
|
||||
PRBool isActive = PR_FALSE;
|
||||
focusController->GetActive(&isActive);
|
||||
if (!isActive) {
|
||||
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
|
||||
if(domElement)
|
||||
focusController->SetFocusedElement(domElement);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (handler && document) {
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm) {
|
||||
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(this);
|
||||
fm->SetFocus(elem, nsIFocusManager::FLAG_BYMOUSE);
|
||||
}
|
||||
|
||||
|
||||
aVisitor.mPresContext->EventStateManager()->
|
||||
SetContentState(this, NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS);
|
||||
SetContentState(this, NS_EVENT_STATE_ACTIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -417,7 +417,6 @@ public:
|
|||
PRBool aNotify);
|
||||
virtual PRBool TextIsOnlyWhitespace();
|
||||
virtual void AppendTextTo(nsAString& aResult);
|
||||
virtual void SetFocus(nsPresContext* aContext);
|
||||
virtual nsIContent *GetBindingParent() const;
|
||||
virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
|
||||
virtual already_AddRefed<nsIURI> GetBaseURI() const;
|
||||
|
@ -584,8 +583,6 @@ public:
|
|||
static already_AddRefed<nsIDOMNSFeatureFactory>
|
||||
GetDOMFeatureFactory(const nsAString& aFeature, const nsAString& aVersion);
|
||||
|
||||
static PRBool ShouldFocus(nsIContent *aContent);
|
||||
|
||||
static PRBool ShouldBlur(nsIContent *aContent);
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsISupports.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsIDocument;
|
||||
class nsPresContext;
|
||||
class nsIDOMEvent;
|
||||
class nsIFrame;
|
||||
|
@ -52,24 +53,16 @@ class imgIContainer;
|
|||
/*
|
||||
* Event state manager interface.
|
||||
*/
|
||||
// {fb7516ff-2f01-4893-84e8-e4b282813023}
|
||||
// {C224A806-A99F-4056-85C2-3B1970F94DB2}
|
||||
#define NS_IEVENTSTATEMANAGER_IID \
|
||||
{ 0x522d12ec, 0xde51, 0x4635, \
|
||||
{ 0xb0, 0x10, 0x4, 0x2a, 0x6d, 0x5, 0xa0, 0x3e } }
|
||||
{ 0xc224a806, 0xa99f, 0x4056, \
|
||||
{ 0x85, 0xc2, 0x3b, 0x19, 0x70, 0xf9, 0x4d, 0xb2 } }
|
||||
|
||||
#define NS_EVENT_NEEDS_FRAME(event) (!NS_IS_FOCUS_EVENT(event))
|
||||
|
||||
class nsIEventStateManager : public nsISupports {
|
||||
|
||||
public:
|
||||
enum EFocusedWithType {
|
||||
eEventFocusedByUnknown, // focus gained via unknown method
|
||||
eEventFocusedByMouse, // focus gained via mouse
|
||||
eEventFocusedByKey, // focus gained via key press (like tab)
|
||||
eEventFocusedByContextMenu, // focus gained via context menu
|
||||
eEventFocusedByApplication // focus gained via Application (like script)
|
||||
};
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEVENTSTATEMANAGER_IID)
|
||||
|
||||
NS_IMETHOD Init() = 0;
|
||||
|
@ -108,29 +101,9 @@ public:
|
|||
*/
|
||||
virtual PRBool SetContentState(nsIContent *aContent, PRInt32 aState) = 0;
|
||||
|
||||
NS_IMETHOD GetFocusedContent(nsIContent **aContent) = 0;
|
||||
NS_IMETHOD SetFocusedContent(nsIContent* aContent) = 0;
|
||||
|
||||
// Get the previously-focused content node for this document
|
||||
NS_IMETHOD GetLastFocusedContent(nsIContent **aContent) = 0;
|
||||
|
||||
NS_IMETHOD GetFocusedFrame(nsIFrame **aFrame) = 0;
|
||||
|
||||
NS_IMETHOD ContentRemoved(nsIContent* aContent) = 0;
|
||||
NS_IMETHOD ContentRemoved(nsIDocument* aDocument, nsIContent* aContent) = 0;
|
||||
NS_IMETHOD EventStatusOK(nsGUIEvent* aEvent, PRBool *aOK) = 0;
|
||||
|
||||
// Return whether browse with caret is enabled or not
|
||||
virtual PRBool GetBrowseWithCaret() = 0;
|
||||
|
||||
// This is called after find text or when a cursor movement key is pressed
|
||||
// If aCanFocusDoc == PR_TRUE, the current document will be focused if caret is not on a focusable element
|
||||
NS_IMETHOD MoveFocusToCaret(PRBool aCanFocusDoc, PRBool *aIsSelectionWithFocus) = 0;
|
||||
NS_IMETHOD MoveCaretToFocus() = 0;
|
||||
|
||||
// Set focus on any element that can receive focus, or on document via aFocusContent == nsnull
|
||||
// Must supply method that focus is being set with
|
||||
NS_IMETHOD ChangeFocusWith(nsIContent *aFocusContent, EFocusedWithType aFocusedWith) = 0;
|
||||
|
||||
// Access Key Registration
|
||||
|
||||
/**
|
||||
|
@ -163,9 +136,6 @@ public:
|
|||
PRBool aHaveHotspot, float aHotspotX, float aHotspotY,
|
||||
nsIWidget* aWidget, PRBool aLockCursor) = 0;
|
||||
|
||||
// Method for moving the focus forward/back.
|
||||
NS_IMETHOD ShiftFocus(PRBool aDirection, nsIContent* aStart)=0;
|
||||
|
||||
NS_IMETHOD NotifyDestroyPresContext(nsPresContext* aPresContext) = 0;
|
||||
|
||||
/**
|
||||
|
|
|
@ -928,14 +928,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
|||
newEvent = new nsFormEvent(PR_FALSE, msg);
|
||||
break;
|
||||
}
|
||||
case NS_FOCUS_EVENT:
|
||||
{
|
||||
newEvent = new nsFocusEvent(PR_FALSE, msg, nsnull);
|
||||
NS_ENSURE_TRUE(newEvent, NS_ERROR_OUT_OF_MEMORY);
|
||||
static_cast<nsFocusEvent*>(newEvent)->isMozWindowTakingFocus =
|
||||
static_cast<nsFocusEvent*>(mEvent)->isMozWindowTakingFocus;
|
||||
break;
|
||||
}
|
||||
case NS_POPUP_EVENT:
|
||||
{
|
||||
newEvent = new nsInputEvent(PR_FALSE, msg, nsnull);
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
#include "nsIXPConnect.h"
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsIScriptObjectOwner.h" // for nsIScriptEventHandlerOwner
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
|
|
@ -121,11 +121,7 @@ public:
|
|||
|
||||
NS_IMETHOD GetContentState(nsIContent *aContent, PRInt32& aState);
|
||||
virtual PRBool SetContentState(nsIContent *aContent, PRInt32 aState);
|
||||
NS_IMETHOD GetFocusedContent(nsIContent **aContent);
|
||||
NS_IMETHOD SetFocusedContent(nsIContent* aContent);
|
||||
NS_IMETHOD GetLastFocusedContent(nsIContent **aContent);
|
||||
NS_IMETHOD GetFocusedFrame(nsIFrame **aFrame);
|
||||
NS_IMETHOD ContentRemoved(nsIContent* aContent);
|
||||
NS_IMETHOD ContentRemoved(nsIDocument* aDocument, nsIContent* aContent);
|
||||
NS_IMETHOD EventStatusOK(nsGUIEvent* aEvent, PRBool *aOK);
|
||||
|
||||
// Access Key Registration
|
||||
|
@ -137,15 +133,6 @@ public:
|
|||
PRBool aHaveHotspot, float aHotspotX, float aHotspotY,
|
||||
nsIWidget* aWidget, PRBool aLockCursor);
|
||||
|
||||
NS_IMETHOD ShiftFocus(PRBool aForward, nsIContent* aStart=nsnull);
|
||||
|
||||
virtual PRBool GetBrowseWithCaret();
|
||||
void ResetBrowseWithCaret();
|
||||
|
||||
NS_IMETHOD MoveFocusToCaret(PRBool aCanFocusDoc, PRBool *aIsSelectionWithFocus);
|
||||
NS_IMETHOD MoveCaretToFocus();
|
||||
NS_IMETHOD ChangeFocusWith(nsIContent* aFocus, EFocusedWithType aFocusedWith);
|
||||
|
||||
static void StartHandlingUserInput()
|
||||
{
|
||||
++sUserInputEventDepth;
|
||||
|
@ -167,14 +154,6 @@ public:
|
|||
nsIEventStateManager)
|
||||
|
||||
protected:
|
||||
/**
|
||||
* In certain situations the focus controller's concept of focus gets out of
|
||||
* whack with mCurrentFocus. This is used in known cases to reset the focus
|
||||
* controller's focus. At some point we should probably move to a single
|
||||
* focus storage mechanism because tracking it in several places is error-prone.
|
||||
*/
|
||||
void EnsureFocusSynchronization();
|
||||
|
||||
void UpdateCursor(nsPresContext* aPresContext, nsEvent* aEvent, nsIFrame* aTargetFrame, nsEventStatus* aStatus);
|
||||
/**
|
||||
* Turn a GUI mouse event into a mouse event targeted at the specified
|
||||
|
@ -221,20 +200,8 @@ protected:
|
|||
nsWeakFrame& aTargetFrame);
|
||||
nsresult SetClickCount(nsPresContext* aPresContext, nsMouseEvent *aEvent, nsEventStatus* aStatus);
|
||||
nsresult CheckForAndDispatchClick(nsPresContext* aPresContext, nsMouseEvent *aEvent, nsEventStatus* aStatus);
|
||||
nsresult GetNextTabbableContent(nsIContent* aRootContent,
|
||||
nsIContent* aStartContent,
|
||||
nsIFrame* aStartFrame,
|
||||
PRBool forward, PRBool ignoreTabIndex,
|
||||
nsIContent** aResultNode,
|
||||
nsIFrame** aResultFrame);
|
||||
nsIContent *GetNextTabbableMapArea(PRBool aForward, nsIContent *imageContent);
|
||||
|
||||
PRInt32 GetNextTabIndex(nsIContent* aParent, PRBool foward);
|
||||
nsresult SendFocusBlur(nsPresContext* aPresContext, nsIContent *aContent, PRBool aEnsureWindowHasFocus);
|
||||
void EnsureDocument(nsIPresShell* aPresShell);
|
||||
void EnsureDocument(nsPresContext* aPresContext);
|
||||
void FlushPendingEvents(nsPresContext* aPresContext);
|
||||
nsIFocusController* GetFocusControllerForDocument(nsIDocument* aDocument);
|
||||
|
||||
/**
|
||||
* The phases of HandleAccessKey processing. See below.
|
||||
|
@ -278,18 +245,8 @@ protected:
|
|||
// DocShell Focus Traversal Methods
|
||||
//---------------------------------------------
|
||||
|
||||
nsresult ShiftFocusInternal(PRBool aForward, nsIContent* aStart = nsnull);
|
||||
void TabIntoDocument(nsIDocShell* aDocShell, PRBool aForward);
|
||||
void ShiftFocusByDoc(PRBool forward);
|
||||
PRBool IsFrameSetDoc(nsIDocShell* aDocShell);
|
||||
PRBool IsIFrameDoc(nsIDocShell* aDocShell);
|
||||
nsIContent* GetFocusedContent();
|
||||
PRBool IsShellVisible(nsIDocShell* aShell);
|
||||
void GetLastChildDocShell(nsIDocShellTreeItem* aItem,
|
||||
nsIDocShellTreeItem** aResult);
|
||||
void GetNextDocShell(nsIDocShellTreeNode* aNode,
|
||||
nsIDocShellTreeItem** aResult);
|
||||
void GetPrevDocShell(nsIDocShellTreeNode* aNode,
|
||||
nsIDocShellTreeItem** aResult);
|
||||
|
||||
// These functions are for mousewheel and pixel scrolling
|
||||
nsresult GetParentScrollingView(nsInputEvent* aEvent,
|
||||
|
@ -369,16 +326,6 @@ protected:
|
|||
*/
|
||||
void FillInEventFromGestureDown(nsMouseEvent* aEvent);
|
||||
|
||||
PRBool mSuppressFocusChange; // Used only for Ender text fields to suppress a focus firing on mouse down
|
||||
|
||||
nsresult SetCaretEnabled(nsIPresShell *aPresShell, PRBool aVisibility);
|
||||
nsresult SetContentCaretVisible(nsIPresShell* aPresShell, nsIContent *aContent, PRBool aVisible);
|
||||
void FocusElementButNotDocument(nsIContent *aElement);
|
||||
|
||||
// Return the location of the caret
|
||||
nsresult GetDocSelectionLocation(nsIContent **start, nsIContent **end,
|
||||
nsIFrame **startFrame, PRUint32 *startOffset);
|
||||
|
||||
PRInt32 mLockCursor;
|
||||
|
||||
nsWeakFrame mCurrentTarget;
|
||||
|
@ -409,20 +356,6 @@ protected:
|
|||
nsCOMPtr<nsIContent> mHoverContent;
|
||||
nsCOMPtr<nsIContent> mDragOverContent;
|
||||
nsCOMPtr<nsIContent> mURLTargetContent;
|
||||
nsCOMPtr<nsIContent> mCurrentFocus;
|
||||
nsCOMPtr<nsIContent> mLastFocus;
|
||||
nsWeakFrame mCurrentFocusFrame;
|
||||
PRInt32 mCurrentTabIndex;
|
||||
EFocusedWithType mLastFocusedWith;
|
||||
|
||||
// DocShell Traversal Data Memebers
|
||||
nsCOMPtr<nsIContent> mLastContentFocus;
|
||||
|
||||
//Anti-recursive stack controls
|
||||
|
||||
nsCOMPtr<nsIContent> mFirstBlurEvent;
|
||||
nsCOMPtr<nsIDocument> mFirstDocumentBlurEvent;
|
||||
nsCOMPtr<nsIContent> mFirstFocusEvent;
|
||||
|
||||
// The last element on which we fired a mouseover event, or null if
|
||||
// the last mouseover event we fired has finished processing.
|
||||
|
@ -443,17 +376,9 @@ protected:
|
|||
|
||||
PRPackedBool m_haveShutdown;
|
||||
|
||||
// So we don't have to keep checking accessibility.browsewithcaret pref
|
||||
PRPackedBool mBrowseWithCaret;
|
||||
|
||||
// Recursion guard for tabbing
|
||||
PRPackedBool mTabbedThroughDocument;
|
||||
|
||||
// Array for accesskey support
|
||||
nsCOMArray<nsIContent> mAccessKeys;
|
||||
|
||||
nsCOMArray<nsIDocShell> mTabbingFromDocShells;
|
||||
|
||||
// Unlocks pixel scrolling
|
||||
PRPackedBool mLastLineScrollConsumedX;
|
||||
PRPackedBool mLastLineScrollConsumedY;
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsINode.h"
|
||||
|
@ -71,7 +70,6 @@
|
|||
|
||||
nsIContent* nsIMEStateManager::sContent = nsnull;
|
||||
nsPresContext* nsIMEStateManager::sPresContext = nsnull;
|
||||
nsPIDOMWindow* nsIMEStateManager::sActiveWindow = nsnull;
|
||||
PRBool nsIMEStateManager::sInstalledMenuKeyboardListener = PR_FALSE;
|
||||
|
||||
nsTextStateManager* nsIMEStateManager::sTextStateObserver = nsnull;
|
||||
|
@ -118,11 +116,6 @@ nsIMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aPresContext);
|
||||
|
||||
if (!IsActive(aPresContext)) {
|
||||
// The actual focus isn't changing, because this presContext isn't active.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget(aPresContext);
|
||||
if (!widget) {
|
||||
return NS_OK;
|
||||
|
@ -171,29 +164,6 @@ nsIMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsIMEStateManager::OnActivate(nsPresContext* aPresContext)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPresContext);
|
||||
sActiveWindow = aPresContext->Document()->GetWindow();
|
||||
NS_ENSURE_TRUE(sActiveWindow, NS_ERROR_FAILURE);
|
||||
sActiveWindow = sActiveWindow->GetPrivateRoot();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsIMEStateManager::OnDeactivate(nsPresContext* aPresContext)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPresContext);
|
||||
NS_ENSURE_TRUE(aPresContext->Document()->GetWindow(), NS_ERROR_FAILURE);
|
||||
if (sActiveWindow !=
|
||||
aPresContext->Document()->GetWindow()->GetPrivateRoot())
|
||||
return NS_OK;
|
||||
|
||||
sActiveWindow = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsIMEStateManager::OnInstalledMenuKeyboardListener(PRBool aInstalling)
|
||||
{
|
||||
|
@ -201,37 +171,6 @@ nsIMEStateManager::OnInstalledMenuKeyboardListener(PRBool aInstalling)
|
|||
OnChangeFocus(sPresContext, sContent);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsIMEStateManager::IsActive(nsPresContext* aPresContext)
|
||||
{
|
||||
NS_ENSURE_TRUE(aPresContext, PR_FALSE);
|
||||
nsPIDOMWindow* window = aPresContext->Document()->GetWindow();
|
||||
NS_ENSURE_TRUE(window, PR_FALSE);
|
||||
if (!sActiveWindow || sActiveWindow != window->GetPrivateRoot()) {
|
||||
// This root window is not active.
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
NS_ENSURE_TRUE(shell, PR_FALSE);
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
NS_ENSURE_TRUE(vm, PR_FALSE);
|
||||
nsCOMPtr<nsIViewObserver> observer;
|
||||
vm->GetViewObserver(*getter_AddRefs(observer));
|
||||
NS_ENSURE_TRUE(observer, PR_FALSE);
|
||||
return observer->IsVisible();
|
||||
}
|
||||
|
||||
nsIFocusController*
|
||||
nsIMEStateManager::GetFocusController(nsPresContext* aPresContext)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container =
|
||||
aPresContext->Document()->GetContainer();
|
||||
nsCOMPtr<nsPIDOMWindow> windowPrivate = do_GetInterface(container);
|
||||
|
||||
return windowPrivate ? windowPrivate->GetRootFocusController() : nsnull;
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsIMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
|
||||
nsIContent* aContent)
|
||||
|
|
|
@ -61,8 +61,6 @@ public:
|
|||
nsIContent* aContent);
|
||||
static nsresult OnChangeFocus(nsPresContext* aPresContext,
|
||||
nsIContent* aContent);
|
||||
static nsresult OnActivate(nsPresContext* aPresContext);
|
||||
static nsresult OnDeactivate(nsPresContext* aPresContext);
|
||||
static void OnInstalledMenuKeyboardListener(PRBool aInstalling);
|
||||
|
||||
// These two methods manage focus and selection/text observers.
|
||||
|
@ -90,14 +88,10 @@ protected:
|
|||
static PRUint32 GetNewIMEState(nsPresContext* aPresContext,
|
||||
nsIContent* aContent);
|
||||
|
||||
static PRBool IsActive(nsPresContext* aPresContext);
|
||||
|
||||
static nsIFocusController* GetFocusController(nsPresContext* aPresContext);
|
||||
static nsIWidget* GetWidget(nsPresContext* aPresContext);
|
||||
|
||||
static nsIContent* sContent;
|
||||
static nsPresContext* sPresContext;
|
||||
static nsPIDOMWindow* sActiveWindow;
|
||||
static PRBool sInstalledMenuKeyboardListener;
|
||||
|
||||
static nsTextStateManager* sTextStateObserver;
|
||||
|
|