This commit is contained in:
Brian Hackett 2011-12-01 11:51:09 -08:00
Родитель 71bdcbc4f5 68ca39e9d4
Коммит ab03878cea
157 изменённых файлов: 2996 добавлений и 1184 удалений

Просмотреть файл

@ -57,19 +57,16 @@ CPPSRCS = nsAccessibilityFactory.cpp
LOCAL_INCLUDES = -I$(srcdir)/../src
SHARED_LIBRARY_LIBS = \
../src/base/$(LIB_PREFIX)accessibility_base_s.$(LIB_SUFFIX) \
../src/html/$(LIB_PREFIX)accessibility_html_s.$(LIB_SUFFIX) \
../src/xpcom/$(LIB_PREFIX)accessibility_xpcom_s.$(LIB_SUFFIX) \
../src/$(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX) \
$(NULL)
../src/base/$(LIB_PREFIX)accessibility_base_s.$(LIB_SUFFIX) \
../src/html/$(LIB_PREFIX)accessibility_html_s.$(LIB_SUFFIX) \
../src/xpcom/$(LIB_PREFIX)accessibility_xpcom_s.$(LIB_SUFFIX) \
../src/$(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX) \
../src/xforms/$(LIB_PREFIX)accessibility_xforms_s.$(LIB_SUFFIX) \
$(NULL)
ifdef MOZ_XUL
SHARED_LIBRARY_LIBS += ../src/xul/$(LIB_PREFIX)accessibility_xul_s.$(LIB_SUFFIX)
endif
ifndef DISABLE_XFORMS_HOOKS
SHARED_LIBRARY_LIBS += ../src/xforms/$(LIB_PREFIX)accessibility_xforms_s.$(LIB_SUFFIX)
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -54,7 +54,7 @@ interface nsIDOMCSSPrimitiveValue;
* If the DOM node for this access node is "accessible",
* then a QueryInterface to nsIAccessible will succeed.
*/
[scriptable, uuid(bbbd5a68-bad2-48c1-ab09-beb6c34f03d9)]
[scriptable, uuid(08bb2c50-1b30-11e1-bddb-0800200c9a66)]
interface nsIAccessNode : nsISupports
{
/**
@ -99,12 +99,6 @@ interface nsIAccessNode : nsISupports
*/
void scrollToPoint(in unsigned long aCoordinateType, in long aX, in long aY);
/**
* A unique ID calculated for this DOM node, for the
* purposes of caching and referencing this object.
*/
[noscript] readonly attribute voidPtr uniqueID;
/**
* Retrieve the computed style value for this DOM node, if it is a DOM element.
* Note: the meanings of width, height and other size measurements depend

Просмотреть файл

@ -63,14 +63,11 @@ DIRS += \
base \
html \
xpcom \
xforms \
$(null)
ifdef MOZ_XUL
DIRS += xul
endif
ifndef DISABLE_XFORMS_HOOKS
DIRS += xforms
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -106,12 +106,9 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../xul \
-I$(srcdir)/../../../layout/generic \
-I$(srcdir)/../../../layout/xul/base/src \
-I$(srcdir)/../xforms \
$(NULL)
ifndef DISABLE_XFORMS_HOOKS
LOCAL_INCLUDES += -I$(srcdir)/../xforms
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
LOCAL_INCLUDES += \
-I$(srcdir)/../atk \

Просмотреть файл

@ -122,13 +122,7 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
mDocument->FireDelayedAccessibleEvent(textInsertEvent);
}
// Fire value change event.
if (mHyperText->Role() == nsIAccessibleRole::ROLE_ENTRY) {
nsRefPtr<AccEvent> valueChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, mHyperText,
eAutoDetect, AccEvent::eRemoveDupes);
mDocument->FireDelayedAccessibleEvent(valueChangeEvent);
}
mDocument->MaybeNotifyOfValueChange(mHyperText);
// Update the text.
mTextLeaf->SetText(aNewText);
@ -173,12 +167,7 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
for (PRInt32 idx = events.Length() - 1; idx >= 0; idx--)
mDocument->FireDelayedAccessibleEvent(events[idx]);
if (mHyperText->Role() == nsIAccessibleRole::ROLE_ENTRY) {
nsRefPtr<AccEvent> valueChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, mHyperText,
eAutoDetect, AccEvent::eRemoveDupes);
mDocument->FireDelayedAccessibleEvent(valueChangeEvent);
}
mDocument->MaybeNotifyOfValueChange(mHyperText);
// Update the text.
mTextLeaf->SetText(aNewText);

Просмотреть файл

@ -347,6 +347,20 @@ struct nsARIAMap
*/
static nsAttributeCharacteristics gWAIUnivAttrMap[];
static PRUint32 gWAIUnivAttrMapLength;
/**
* Return accessible state from ARIA universal states applied to the given
* element.
*/
static PRUint64 UniversalStatesFor(nsIContent* aContent)
{
PRUint64 state = 0;
PRUint32 index = 0;
while (nsStateMapEntry::MapToStates(aContent, &state, gWAIUnivStateMap[index]))
index++;
return state;
}
};
#endif

Просмотреть файл

@ -149,16 +149,6 @@ nsAccessNode::Shutdown()
mWeakShell = nsnull;
}
// nsIAccessNode
NS_IMETHODIMP
nsAccessNode::GetUniqueID(void **aUniqueID)
{
NS_ENSURE_ARG_POINTER(aUniqueID);
*aUniqueID = UniqueID();
return NS_OK;
}
nsApplicationAccessible*
nsAccessNode::GetApplicationAccessible()
{

Просмотреть файл

@ -106,10 +106,8 @@
#include "AtkSocketAccessible.h"
#endif
#ifndef DISABLE_XFORMS_HOOKS
#include "nsXFormsFormControlsAccessible.h"
#include "nsXFormsWidgetsAccessible.h"
#endif
#include "mozilla/FunctionTimer.h"
#include "mozilla/dom/Element.h"
@ -286,6 +284,16 @@ nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent,
return accessible;
}
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLFileInputAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLFileInputAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
@ -1506,7 +1514,6 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
#endif // MOZ_XUL
#ifndef DISABLE_XFORMS_HOOKS
// XForms elements
case nsIAccessibleProvider::XFormsContainer:
accessible = new nsXFormsContainerAccessible(aContent, aWeakShell);
@ -1584,8 +1591,6 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
accessible = new nsXFormsComboboxPopupWidgetAccessible(aContent, aWeakShell);
break;
#endif
default:
return nsnull;
}

Просмотреть файл

@ -91,6 +91,8 @@ public:
CreateHTMLCheckboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
virtual already_AddRefed<nsAccessible>
CreateHTMLComboboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
already_AddRefed<nsAccessible>
CreateHTMLFileInputAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
virtual already_AddRefed<nsAccessible>
CreateHTMLGroupboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
virtual already_AddRefed<nsAccessible>

Просмотреть файл

@ -1601,11 +1601,7 @@ void
nsAccessible::ApplyARIAState(PRUint64* aState)
{
// Test for universal states first
PRUint32 index = 0;
while (nsStateMapEntry::MapToStates(mContent, aState,
nsARIAMap::gWAIUnivStateMap[index])) {
++ index;
}
*aState |= nsARIAMap::UniversalStatesFor(mContent);
if (mRoleMapEntry) {

Просмотреть файл

@ -424,6 +424,8 @@ public:
inline bool IsHyperText() const { return mFlags & eHyperTextAccessible; }
nsHyperTextAccessible* AsHyperText();
inline bool IsHTMLFileInput() const { return mFlags & eHTMLFileInputAccessible; }
inline bool IsHTMLListItem() const { return mFlags & eHTMLListItemAccessible; }
nsHTMLLIAccessible* AsHTMLListItem();
@ -645,12 +647,13 @@ protected:
eComboboxAccessible = 1 << 5,
eDocAccessible = 1 << 6,
eHyperTextAccessible = 1 << 7,
eHTMLListItemAccessible = 1 << 8,
eListControlAccessible = 1 << 9,
eMenuButtonAccessible = 1 << 10,
eMenuPopupAccessible = 1 << 11,
eRootAccessible = 1 << 12,
eTextLeafAccessible = 1 << 13
eHTMLFileInputAccessible = 1 << 8,
eHTMLListItemAccessible = 1 << 9,
eListControlAccessible = 1 << 10,
eMenuButtonAccessible = 1 << 11,
eMenuPopupAccessible = 1 << 12,
eRootAccessible = 1 << 13,
eTextLeafAccessible = 1 << 14
};
//////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -1851,11 +1851,7 @@ nsDocAccessible::UpdateTree(nsAccessible* aContainer, nsIContent* aChildNode,
}
}
// Fire value change event.
if (aContainer->Role() == nsIAccessibleRole::ROLE_ENTRY) {
FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
aContainer->GetNode());
}
MaybeNotifyOfValueChange(aContainer);
// Fire reorder event so the MSAA clients know the children have changed. Also
// the event is used internally by MSAA layer.

Просмотреть файл

@ -204,6 +204,21 @@ public:
*/
nsresult FireDelayedAccessibleEvent(AccEvent* aEvent);
/**
* Fire value change event on the given accessible if applicable.
*/
inline void MaybeNotifyOfValueChange(nsAccessible* aAccessible)
{
PRUint32 role = aAccessible->Role();
if (role == nsIAccessibleRole::ROLE_ENTRY ||
role == nsIAccessibleRole::ROLE_COMBOBOX) {
nsRefPtr<AccEvent> valueChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aAccessible,
eAutoDetect, AccEvent::eRemoveDupes);
FireDelayedAccessibleEvent(valueChangeEvent);
}
}
/**
* Get/set the anchor jump.
*/

Просмотреть файл

@ -272,6 +272,25 @@ nsHTMLButtonAccessible::DoAction(PRUint8 aIndex)
return NS_OK;
}
PRUint64
nsHTMLButtonAccessible::State()
{
PRUint64 state = nsHyperTextAccessibleWrap::State();
if (state == states::DEFUNCT)
return state;
// Inherit states from input@type="file" suitable for the button. Note,
// no special processing for unavailable state since inheritance is supplied
// other code paths.
if (mParent && mParent->IsHTMLFileInput()) {
PRUint64 parentState = mParent->State();
state |= parentState & (states::BUSY | states::REQUIRED |
states::HASPOPUP | states::INVALID);
}
return state;
}
PRUint64
nsHTMLButtonAccessible::NativeState()
{
@ -477,7 +496,25 @@ nsHTMLTextFieldAccessible::ApplyARIAState(PRUint64* aState)
nsHyperTextAccessibleWrap::ApplyARIAState(aState);
nsStateMapEntry::MapToStates(mContent, aState, eARIAAutoComplete);
}
PRUint64
nsHTMLTextFieldAccessible::State()
{
PRUint64 state = nsHyperTextAccessibleWrap::State();
if (state & states::DEFUNCT)
return state;
// Inherit states from input@type="file" suitable for the button. Note,
// no special processing for unavailable state since inheritance is supplied
// by other code paths.
if (mParent && mParent->IsHTMLFileInput()) {
PRUint64 parentState = mParent->State();
state |= parentState & (states::BUSY | states::REQUIRED |
states::HASPOPUP | states::INVALID);
}
return state;
}
PRUint64
@ -612,6 +649,61 @@ nsHTMLTextFieldAccessible::ContainerWidget() const
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLGroupboxAccessible
////////////////////////////////////////////////////////////////////////////////
nsHTMLFileInputAccessible::
nsHTMLFileInputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
mFlags |= eHTMLFileInputAccessible;
}
PRUint32
nsHTMLFileInputAccessible::NativeRole()
{
// JAWS wants a text container, others don't mind. No specific role in
// AT APIs.
return nsIAccessibleRole::ROLE_TEXT_CONTAINER;
}
nsresult
nsHTMLFileInputAccessible::HandleAccEvent(AccEvent* aEvent)
{
nsresult rv = nsHyperTextAccessibleWrap::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
// Redirect state change events for inherited states to child controls. Note,
// unavailable state is not redirected. That's a standard for unavailable
// state handling.
AccStateChangeEvent* event = downcast_accEvent(aEvent);
if (event &&
(event->GetState() == states::BUSY ||
event->GetState() == states::REQUIRED ||
event->GetState() == states::HASPOPUP ||
event->GetState() == states::INVALID)) {
nsAccessible* input = GetChildAt(0);
if (input && input->Role() == nsIAccessibleRole::ROLE_ENTRY) {
nsRefPtr<AccStateChangeEvent> childEvent =
new AccStateChangeEvent(input, event->GetState(),
event->IsStateEnabled(),
(event->IsFromUserInput() ? eFromUserInput : eNoUserInput));
nsEventShell::FireEvent(childEvent);
}
nsAccessible* button = GetChildAt(1);
if (button && button->Role() == nsIAccessibleRole::ROLE_PUSHBUTTON) {
nsRefPtr<AccStateChangeEvent> childEvent =
new AccStateChangeEvent(button, event->GetState(),
event->IsStateEnabled(),
(event->IsFromUserInput() ? eFromUserInput : eNoUserInput));
nsEventShell::FireEvent(childEvent);
}
}
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLGroupboxAccessible
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -109,6 +109,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint32 NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();
// ActionAccessible
@ -171,6 +172,7 @@ public:
virtual void ApplyARIAState(PRUint64* aState);
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint32 NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();
// ActionAccessible
@ -182,6 +184,19 @@ public:
};
/**
* Accessible for input@type="file" element.
*/
class nsHTMLFileInputAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFileInputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
// nsAccessible
virtual PRUint32 NativeRole();
virtual nsresult HandleAccEvent(AccEvent* aAccEvent);
};
/**
* Accessible for HTML fieldset element.
*/

Просмотреть файл

@ -160,12 +160,8 @@ nsHyperTextAccessible::NativeRole()
// Treat block frames as paragraphs
nsIFrame *frame = GetFrame();
if (frame && frame->GetType() == nsGkAtoms::blockFrame &&
frame->GetContent()->Tag() != nsGkAtoms::input) {
// An html:input @type="file" is the only input that is exposed as a
// blockframe. It must be exposed as ROLE_TEXT_CONTAINER for JAWS.
if (frame && frame->GetType() == nsGkAtoms::blockFrame)
return nsIAccessibleRole::ROLE_PARAGRAPH;
}
return nsIAccessibleRole::ROLE_TEXT_CONTAINER; // In ATK this works
}

Просмотреть файл

@ -312,22 +312,25 @@ STDMETHODIMP nsAccessibleWrap::get_accValue(
{
__try {
*pszValue = NULL;
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (xpAccessible) {
nsAutoString value;
if (NS_FAILED(xpAccessible->GetValue(value)))
return E_FAIL;
// see bug 438784: Need to expose URL on doc's value attribute.
// For this, reverting part of fix for bug 425693 to make this MSAA method
// behave IAccessible2-style.
if (value.IsEmpty())
return S_FALSE;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible || xpAccessible->IsDefunct())
return E_FAIL;
nsAutoString value;
if (NS_FAILED(xpAccessible->GetValue(value)))
return E_FAIL;
// See bug 438784: need to expose URL on doc's value attribute. For this,
// reverting part of fix for bug 425693 to make this MSAA method behave
// IAccessible2-style.
if (value.IsEmpty())
return S_FALSE;
*pszValue = ::SysAllocStringLen(value.get(), value.Length());
if (!*pszValue)
return E_OUTOFMEMORY;
*pszValue = ::SysAllocStringLen(value.get(), value.Length());
if (!*pszValue)
return E_OUTOFMEMORY;
}
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
}

Просмотреть файл

@ -1355,9 +1355,10 @@ function stateChangeChecker(aState, aIsExtraState, aIsEnabled,
if (!event)
return;
is(event.state, aState, "Wrong state of the statechange event.");
is(event.isExtraState(), aIsExtraState,
"Wrong extra state bit of the statechange event.");
isState(event.state, aState, aIsExtraState,
"Wrong state of the statechange event.");
is(event.isEnabled(), aIsEnabled,
"Wrong state of statechange event state");

Просмотреть файл

@ -70,12 +70,38 @@
};
}
function stateChangeOnFileInput(aID, aAttr, aValue,
aState, aIsExtraState, aIsEnabled)
{
this.fileControlNode = getNode(aID);
this.fileControl = getAccessible(this.fileControlNode);
this.textEntry = this.fileControl.firstChild;
this.browseButton = this.fileControl.lastChild;
this.invoke = function stateChangeOnFileInput_invoke()
{
this.fileControlNode.setAttribute(aAttr, aValue);
}
this.eventSeq = [
new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.fileControl),
new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.textEntry),
new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.browseButton)
];
this.getID = function stateChangeOnFileInput_getID()
{
return "inherited state change on file input on attribute '" + aAttr + "' change";
}
}
////////////////////////////////////////////////////////////////////////////
// Do tests
var gQueue = null;
// var gA11yEventDumpID = "eventdump"; // debug stuff
//gA11yEventDumpToConsole = true; // debug stuff
function doTests()
{
@ -88,6 +114,14 @@
// invalid state change
gQueue.push(new invalidInput("email"));
// file input inherited state changes
gQueue.push(new stateChangeOnFileInput("file", "aria-busy", "true",
STATE_BUSY, false, true));
gQueue.push(new stateChangeOnFileInput("file", "aria-required", "true",
STATE_REQUIRED, false, true));
gQueue.push(new stateChangeOnFileInput("file", "aria-invalid", "true",
STATE_INVALID, false, true));
gQueue.invoke(); // Will call SimpleTest.finish();
}
@ -108,6 +142,11 @@
title="Fire a11y event based on HTML5 constraint validation">
Mozilla Bug 555728
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=699017"
title="File input control should be propogate states to descendants">
Mozilla Bug 699017
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
@ -120,6 +159,8 @@
<input id="email" type='email'>
<input id="file" type="file">
<div id="eventdump"></div>
</body>
</html>

Просмотреть файл

@ -58,6 +58,27 @@
}
}
function changeInputValue(aID, aValue)
{
this.DOMNode = getNode(aID);
this.invoke = function changeInputValue_invoke()
{
this.DOMNode.value = aValue;
}
this.check = function changeInputValue_check()
{
var acc = getAccessible(this.DOMNode);
is(acc.value, aValue, "Wrong value for " + prettyName(aID));
}
this.getID = function changeInputValue_getID()
{
return prettyName(aID) + " value changed";
}
}
function doTests()
{
// Test initial values
@ -74,6 +95,8 @@
gQueue.push(new changeValue("slider_vnvt", "3", "sweet"));
gQueue.push(new changeValue("scrollbar", "6", undefined));
gQueue.push(new changeInputValue("combobox", "hello"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
@ -94,6 +117,11 @@
title="We dont expose new aria role 'scrollbar' and property aria-orientation">
Mozilla Bug 529289
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=703202"
title="ARIA comboboxes don't fire value change events">
Mozilla Bug 703202
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
@ -114,5 +142,8 @@
<!-- ARIA scrollbar -->
<div id="scrollbar" role="scrollbar" aria-valuenow="5"
aria-valuemin="0" aria-valuemax="1000">slider</div>
<!-- ARIA combobox -->
<input id="combobox" role="combobox" aria-autocomplete="inline">
</body>
</html>

Просмотреть файл

@ -97,6 +97,14 @@
// disabled, too. See bug 429285.
testAriaDisabledTree("group");
// universal ARIA properties inherited from file input control
var fileTextField = getAccessible("fileinput").firstChild;
testStates(fileTextField,
STATE_BUSY | STATE_UNAVAILABLE | STATE_REQUIRED | STATE_HASPOPUP | STATE_INVALID);
var fileBrowseButton = getAccessible("fileinput").lastChild;
testStates(fileBrowseButton,
STATE_BUSY | STATE_UNAVAILABLE | STATE_REQUIRED | STATE_HASPOPUP | STATE_INVALID);
// offscreen test
testStates("aria_offscreen_textbox", STATE_OFFSCREEN);
@ -171,6 +179,11 @@
title="aria-orientation should be applied to separator and slider roles">
Mozilla Bug 681674
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=699017"
title="File input control should be propogate states to descendants">
Mozilla Bug 699017
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -215,7 +228,15 @@
</div>
<div role="slider" tabindex="0">A slider</div>
</div>
<!-- universal ARIA properties should be inherited by text field of file input -->
<input type="file" id="fileinput"
aria-busy="true"
aria-disabled="true"
aria-required="true"
aria-haspopup="true"
aria-invalid="true">
<div id="offscreen_log" role="log" class="offscreen">
<div id="aria_offscreen_textbox" role="textbox" aria-readonly="true">This text should be offscreen</div>
</div>

Просмотреть файл

@ -36,6 +36,12 @@
testStates("f_input", STATE_UNAVAILABLE);
testStates("f_input_disabled", STATE_UNAVAILABLE);
// inherited from file control
var fileTextField = getAccessible("file").firstChild;
testStates(fileTextField, STATE_UNAVAILABLE | STATE_REQUIRED);
var fileBrowseButton = getAccessible("file").lastChild;
testStates(fileBrowseButton, STATE_UNAVAILABLE | STATE_REQUIRED);
/**
* maxlength doesn't make the element invalid until bug 613016 and bug 613019
* are fixed. Commenting out related lines and adding a todo to make sure
@ -110,6 +116,11 @@
title="Add accessibility support for @list on HTML input and for HTML datalist">
Mozilla Bug 559766
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=699017"
title="File input control should be propogate states to descendants">
Mozilla Bug 699017
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -146,6 +157,9 @@
<input id="f_input_disabled" disabled>
</fieldset>
<!-- inherited from input@type="file" -->
<input id="file" type="file" required disabled>
<!-- invalid/valid -->
<input id="maxlength" maxlength="1">
<input id="maxlength2" maxlength="100" value="foo">

Просмотреть файл

@ -41,6 +41,9 @@
# There is no need to rerun autoconf after adding makefiles.
# You only need to run configure.
# Turn on exit on error
set -o errexit
MAKEFILES=""
# add_makefiles - Shell function to add makefiles to MAKEFILES
@ -52,21 +55,15 @@ if [ "$srcdir" = "" ]; then
srcdir=.
fi
#
# Common makefiles used by everyone
#
add_makefiles "
Makefile
build/Makefile
build/pgo/Makefile
build/pgo/blueprint/Makefile
build/pgo/js-input/Makefile
build/unix/Makefile
build/win32/Makefile
build/win32/crashinjectdll/Makefile
config/Makefile
config/autoconf.mk
config/mkdepend/Makefile
config/nspr/Makefile
config/doxygen.cfg
config/expandlibs_config.py
@ -75,34 +72,88 @@ probes/Makefile
extensions/Makefile
"
if [ "$MOZ_MEMORY" -a "$LIBXUL_SDK" = "" ]; then
if [ ! "$LIBXUL_SDK" ]; then
add_makefiles "
memory/jemalloc/Makefile
memory/Makefile
memory/mozalloc/Makefile
memory/mozutils/Makefile
"
if [ "$MOZ_MEMORY" ]; then
add_makefiles "
memory/jemalloc/Makefile
"
fi
if [ "$MOZ_WIDGET_TOOLKIT" = "android" ]; then
add_makefiles "
other-licenses/android/Makefile
"
fi
fi
if [ "$OS_ARCH" = "WINNT" ]; then
add_makefiles "
build/win32/Makefile
build/win32/crashinjectdll/Makefile
"
fi
#
if [ "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" ]; then
add_makefiles "
build/unix/Makefile
"
if [ "$USE_ELF_HACK" ]; then
add_makefiles "
build/unix/elfhack/Makefile
"
fi
fi
if [ "$COMPILER_DEPEND" = "" -a "$MOZ_NATIVE_MAKEDEPEND" = "" ]; then
add_makefiles "
config/mkdepend/Makefile
"
fi
if [ "$ENABLE_TESTS" ]; then
if [ "$_MSC_VER" -a "$OS_TEST" != "x86_64" ]; then
add_makefiles "
build/win32/vmwarerecordinghelper/Makefile
"
fi
if [ "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" ]; then
add_makefiles "
build/unix/test/Makefile
"
fi
if [ "$MOZ_WIDGET_TOOLKIT" = "android" ]; then
add_makefiles "
build/mobile/sutagent/android/Makefile
build/mobile/sutagent/android/fencp/Makefile
build/mobile/sutagent/android/ffxcp/Makefile
build/mobile/sutagent/android/watcher/Makefile
"
fi
fi
# Application-specific makefiles
#
if test -f "${srcdir}/${MOZ_BUILD_APP}/makefiles.sh"; then
if [ -f "${srcdir}/${MOZ_BUILD_APP}/makefiles.sh" ]; then
. "${srcdir}/${MOZ_BUILD_APP}/makefiles.sh"
fi
#
# Extension makefiles
#
for extension in $MOZ_EXTENSIONS; do
if [ -f "${srcdir}/extensions/${extension}/makefiles.sh" ]; then
. "${srcdir}/extensions/${extension}/makefiles.sh"
fi
done
#
# Toolkit makefiles
#
if test -z "$LIBXUL_SDK"; then
if [ ! "$LIBXUL_SDK" ]; then
. "${srcdir}/toolkit/toolkit-makefiles.sh"
fi
# Services makefiles
. "${srcdir}/services/makefiles.sh"
# Turn off exit on error, since it breaks the rest of configure
set +o errexit

Просмотреть файл

@ -1646,25 +1646,13 @@ SessionStoreService.prototype = {
// Inspect extData for Panorama identifiers. If found, then we want to
// inspect further. If there is a single group, then we can use this
// window. If there are multiple groups then we won't use this window.
let data = this.getWindowValue(aWindow, "tabview-group");
if (data) {
data = JSON.parse(data);
let groupsData = this.getWindowValue(aWindow, "tabview-groups");
if (groupsData) {
groupsData = JSON.parse(groupsData);
// Multiple keys means multiple groups, which means we don't want to use this window.
if (Object.keys(data).length > 1) {
// If there are multiple groups, we don't want to use this window.
if (groupsData.totalNumber > 1)
return [false, false];
}
else {
// If there is only one group, then we want to ensure that its group id
// is 0. This is how Panorama forces group merging when new tabs are opened.
//XXXzpao This is a hack and the proper fix really belongs in Panorama.
let groupKey = Object.keys(data)[0];
if (groupKey !== "0") {
data["0"] = data[groupKey];
delete data[groupKey];
this.setWindowValue(aWindow, "tabview-groups", JSON.stringify(data));
}
}
}
// Step 2 of processing:

Просмотреть файл

@ -2233,12 +2233,26 @@ let GroupItems = {
// All remaining children in to-be-closed groups are re-used by
// session restore. Reconnect them so that they're put into their
// right groups.
groupItem.getChildren().forEach(function (tabItem) {
let children = groupItem.getChildren().concat();
children.forEach(function (tabItem) {
if (tabItem.parent && tabItem.parent.hidden)
iQ(tabItem.container).show();
// sanity check the tab's groupID
let tabData = Storage.getTabData(tabItem.tab);
let parentGroup = GroupItems.groupItem(tabData.groupID);
// correct the tab's groupID if necessary
if (!parentGroup || -1 < toClose.indexOf(parentGroup)) {
tabData.groupID = activeGroupId || Object.keys(groupItemData)[0];
Storage.saveTab(tabItem.tab, tabData);
}
tabItem._reconnected = false;
tabItem._reconnect();
});
groupItem.close({immediately: true});
});
}

Просмотреть файл

@ -43,9 +43,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
ifneq (mobile,$(MOZ_BUILD_APP))
DIRS += test
endif
DIRS += test
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -44,10 +44,8 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
ifneq (mobile,$(MOZ_BUILD_APP))
DIRS += test/browser
endif
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -57,9 +57,7 @@ EXTRA_PP_JS_MODULES = \
$(NULL)
ifdef ENABLE_TESTS
ifneq (mobile,$(MOZ_BUILD_APP))
DIRS += test/browser
endif
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -701,9 +701,39 @@
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0027-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0027-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0028-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0028-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0029-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0029-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0030-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0030-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0031-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0031-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0032-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0032-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0001-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0001-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0002-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0002-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0003-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0003-ABCDEFFEDCBA}"
${EndIf}
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0004-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0004-ABCDEFFEDCBA}"
${EndIf}
!macroend
!define RemoveDeprecatedFiles "!insertmacro RemoveDeprecatedFiles"

Просмотреть файл

@ -35,12 +35,16 @@
#
# ***** END LICENSE BLOCK *****
# Deliberately excluded, since the braces cause some versions of sed to choke,
# causing the build to fail (see bug 696498 comment 13):
# browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile
add_makefiles "
browser/Makefile
browser/app/Makefile
browser/app/profile/extensions/Makefile
browser/base/Makefile
browser/components/Makefile
browser/components/about/Makefile
browser/components/build/Makefile
browser/components/certerror/Makefile
browser/components/dirprovider/Makefile
@ -55,7 +59,6 @@ browser/components/places/src/Makefile
browser/components/preferences/Makefile
browser/components/privatebrowsing/Makefile
browser/components/privatebrowsing/src/Makefile
browser/components/safebrowsing/Makefile
browser/components/search/Makefile
browser/components/sessionstore/Makefile
browser/components/sessionstore/src/Makefile
@ -63,29 +66,63 @@ browser/components/sidebar/src/Makefile
browser/components/shell/Makefile
browser/components/shell/public/Makefile
browser/components/shell/src/Makefile
browser/components/wintaskbar/Makefile
browser/components/tabview/Makefile
browser/devtools/Makefile
browser/devtools/highlighter/Makefile
browser/devtools/shared/Makefile
browser/devtools/sourceeditor/Makefile
browser/devtools/styleinspector/Makefile
browser/devtools/webconsole/Makefile
browser/fuel/Makefile
browser/fuel/public/Makefile
browser/fuel/src/Makefile
browser/installer/Makefile
browser/installer/windows/Makefile
browser/locales/Makefile
browser/themes/Makefile
browser/themes/pinstripe/browser/Makefile
browser/themes/pinstripe/communicator/Makefile
browser/themes/pinstripe/Makefile
browser/themes/winstripe/browser/Makefile
browser/themes/winstripe/communicator/Makefile
browser/themes/winstripe/Makefile
$MOZ_BRANDING_DIRECTORY/Makefile
$MOZ_BRANDING_DIRECTORY/content/Makefile
$MOZ_BRANDING_DIRECTORY/locales/Makefile
"
if [ "$MOZ_SAFE_BROWSING" ]; then
add_makefiles "
browser/components/safebrowsing/Makefile
"
fi
if [ "$MOZ_WIDGET_TOOLKIT" = "windows" ]; then
add_makefiles "
browser/components/wintaskbar/Makefile
"
if [ "$MOZ_INSTALLER" ]; then
add_makefiles "
browser/installer/windows/Makefile
"
fi
fi
if [ "$MOZ_WIDGET_TOOLKIT" = "gtk2" -o "$MOZ_WIDGET_TOOLKIT" = "qt" ]; then
add_makefiles "
browser/themes/gnomestripe/Makefile
browser/themes/gnomestripe/communicator/Makefile
"
elif [ "$MOZ_WIDGET_TOOLKIT" = "cocoa" ]; then
add_makefiles "
browser/themes/pinstripe/Makefile
browser/themes/pinstripe/communicator/Makefile
"
else
add_makefiles "
browser/themes/winstripe/Makefile
browser/themes/winstripe/communicator/Makefile
"
fi
if [ "$ENABLE_TESTS" ]; then
add_makefiles "
browser/base/content/test/Makefile
browser/components/certerror/test/Makefile
browser/components/dirprovider/tests/Makefile
browser/components/preferences/tests/Makefile
browser/components/search/test/Makefile
browser/components/sessionstore/test/browser/Makefile
@ -97,8 +134,24 @@ if [ "$ENABLE_TESTS" ]; then
browser/components/places/tests/browser/Makefile
browser/components/privatebrowsing/test/Makefile
browser/components/privatebrowsing/test/browser/Makefile
browser/components/safebrowsing/content/test/Makefile
browser/components/wintaskbar/test/Makefile
browser/components/tabview/test/Makefile
browser/components/test/browser/Makefile
browser/devtools/highlighter/test/Makefile
browser/devtools/scratchpad/test/Makefile
browser/devtools/shared/test/Makefile
browser/devtools/sourceeditor/test/Makefile
browser/devtools/styleinspector/test/browser/Makefile
browser/devtools/webconsole/test/browser/Makefile
browser/fuel/test/Makefile
"
if [ "$MOZ_SAFE_BROWSING" ]; then
add_makefiles "
browser/components/safebrowsing/content/test/Makefile
"
fi
if [ "$MOZ_WIDGET_TOOLKIT" = "windows" ]; then
add_makefiles "
browser/components/wintaskbar/test/Makefile
"
fi
fi

Просмотреть файл

@ -2646,7 +2646,7 @@ panel[dimmed="true"] {
#addonbar-closebutton {
padding: 0;
margin: 0 4px;
margin: 0 6px;
list-style-image: url("chrome://global/skin/icons/close.png");
border: none;
-moz-image-region: rect(0, 16px, 16px, 0);

Просмотреть файл

@ -39,11 +39,9 @@ mk_add_options MOZ_UNIFY_BDATE=1
mk_add_options MOZ_POSTFLIGHT_ALL+=build/macosx/universal/flight.mk
# Note, the version (10) is used by libffi's configure.
ac_add_app_options ppc --target=powerpc-apple-darwin10
ac_add_app_options i386 --target=i386-apple-darwin10
ac_add_app_options x86_64 --target=x86_64-apple-darwin10
ac_add_app_options ppc --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
ac_add_app_options i386 --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
ac_add_app_options x86_64 --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
@ -51,7 +49,7 @@ ac_add_app_options x86_64 --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
# problem, because the variables it affects only need to be set for
# configure.
if test -n "$MOZ_BUILD_APP" ; then
if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "ppc" -o "$MOZ_BUILD_APP" = "x86_64"; then
if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "x86_64"; then
TARGET_CPU=$MOZ_BUILD_APP
if test -z "$CC" ; then
@ -68,9 +66,6 @@ if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "ppc" -o "$MOZ_BUILD_AP
HOST_CXX=$CXX
NATIVE_CPU=`$topsrcdir/build/autoconf/config.guess | cut -f1 -d-`
if test "$NATIVE_CPU" = "powerpc" ; then
NATIVE_CPU=ppc
fi
# It's not strictly necessary to specify -arch during native builds, but it
# makes the merged about:buildconfig easier to follow, and it reduces

Просмотреть файл

@ -266,6 +266,10 @@ class DeviceManagerSUT(DeviceManager):
destname = destname.replace('\\', '/')
if (self.debug >= 3): print "in push file with: " + localname + ", and: " + destname
if (self.dirExists(destname)):
if (not destname.endswith('/')):
destname = destname + '/'
destname = destname + os.path.basename(localname)
if (self.validateFile(destname, localname) == True):
if (self.debug >= 3): print "files are validated"
return True
@ -352,7 +356,10 @@ class DeviceManagerSUT(DeviceManager):
parts = root.split(localDir)
for file in files:
remoteRoot = remoteDir + '/' + parts[1]
remoteName = remoteRoot + '/' + file
if (remoteRoot.endswith('/')):
remoteName = remoteRoot + file
else:
remoteName = remoteRoot + '/' + file
if (parts[1] == ""): remoteRoot = remoteDir
if (self.pushFile(os.path.join(root, file), remoteName) == False):
# retry once

Просмотреть файл

@ -51,11 +51,7 @@ ifdef USE_ELF_HACK
DIRS = elfhack
endif
ifdef ENABLE_TESTS
ifeq (,$(filter WINNT OS2,$(OS_ARCH)))
DIRS += test
endif # WIN
endif # ENABLE_TESTS
TEST_DIRS = test
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -2671,8 +2671,8 @@ ia64*-hpux*)
fi
if test -n "$GNU_CC"; then
CFLAGS="$CFLAGS -mstackrealign"
CXXFLAGS="$CXXFLAGS -mstackrealign"
CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
else
AC_DEFINE(HAVE_STDCALL)
fi

Просмотреть файл

@ -80,6 +80,7 @@ nsReferencedElement.h \
nsTreeSanitizer.h \
nsXMLNameSpaceMap.h \
nsDOMEventTargetWrapperCache.h \
nsIXFormsUtilityService.h \
$(NULL)
EXPORTS_NAMESPACES = mozilla/dom
@ -89,10 +90,6 @@ EXPORTS_mozilla/dom = \
FromParser.h \
$(NULL)
ifndef DISABLE_XFORMS_HOOKS
EXPORTS += nsIXFormsUtilityService.h
endif
SDK_XPIDLSRCS = \
nsISelection.idl \
$(NULL)

Просмотреть файл

@ -704,7 +704,6 @@ GK_ATOM(onmouseover, "onmouseover")
GK_ATOM(onMozMouseHittest, "onMozMouseHittest")
GK_ATOM(onmouseup, "onmouseup")
GK_ATOM(onMozAfterPaint, "onMozAfterPaint")
GK_ATOM(onMozBeforePaint, "onMozBeforePaint")
GK_ATOM(onmozfullscreenchange, "onmozfullscreenchange")
GK_ATOM(onmozfullscreenerror, "onmozfullscreenerror")
GK_ATOM(onMozMousePixelScroll, "onMozMousePixelScroll")
@ -1672,8 +1671,6 @@ GK_ATOM(veryverythinmathspace_, "veryverythinmathspace")
GK_ATOM(voffset_, "voffset")
GK_ATOM(xref_, "xref")
GK_ATOM(math, "math") // the only one without an underscore
#ifndef DISABLE_XFORMS_HOOKS
GK_ATOM(avg, "avg")
GK_ATOM(booleanFromString, "boolean-from-string")
GK_ATOM(countNonEmpty, "count-non-empty")
@ -1684,7 +1681,6 @@ GK_ATOM(months, "months")
GK_ATOM(now, "now")
GK_ATOM(seconds, "seconds")
GK_ATOM(secondsFromDateTime, "seconds-from-dateTime")
#endif
// Simple gestures support
GK_ATOM(onMozSwipeGesture, "onMozSwipeGesture")

Просмотреть файл

@ -681,10 +681,6 @@ NON_IDL_EVENT(MozAfterPaint,
NS_AFTERPAINT,
EventNameType_None,
NS_EVENT)
NON_IDL_EVENT(MozBeforePaint,
NS_BEFOREPAINT,
EventNameType_None,
NS_EVENT_NULL)
NON_IDL_EVENT(MozScrolledAreaChanged,
NS_SCROLLEDAREACHANGED,

Просмотреть файл

@ -93,7 +93,6 @@ static const char* const sEventNames[] = {
"durationchange", "volumechange", "MozAudioAvailable",
#endif // MOZ_MEDIA
"MozAfterPaint",
"MozBeforePaint",
"MozBeforeResize",
"mozfullscreenchange",
"mozfullscreenerror",
@ -1343,8 +1342,6 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
#endif
case NS_AFTERPAINT:
return sEventNames[eDOMEvents_afterpaint];
case NS_BEFOREPAINT:
return sEventNames[eDOMEvents_beforepaint];
case NS_BEFORERESIZE_EVENT:
return sEventNames[eDOMEvents_beforeresize];
case NS_SIMPLE_GESTURE_SWIPE:

Просмотреть файл

@ -176,7 +176,6 @@ public:
eDOMEvents_mozaudioavailable,
#endif
eDOMEvents_afterpaint,
eDOMEvents_beforepaint,
eDOMEvents_beforeresize,
eDOMEvents_mozfullscreenchange,
eDOMEvents_mozfullscreenerror,

Просмотреть файл

@ -1971,6 +1971,10 @@ nsresult nsHTMLMediaElement::FinishDecoderSetup(nsMediaDecoder* aDecoder)
{
NS_ASSERTION(mLoadingSrc, "mLoadingSrc set up");
nsCAutoString src;
GetCurrentSpec(src);
printf("*** nsHTMLElement::FinishDecoderSetup() mDecoder=%p src=%s\n",
aDecoder, src.get());
mDecoder = aDecoder;
AddMediaElementToURITable();
@ -2064,10 +2068,6 @@ void nsHTMLMediaElement::MetadataLoaded(PRUint32 aChannels, PRUint32 aRate)
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA);
DispatchAsyncEvent(NS_LITERAL_STRING("durationchange"));
DispatchAsyncEvent(NS_LITERAL_STRING("loadedmetadata"));
if (!mBegun) {
// Something ended our downloaded. We're probably done with downloading already.
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA);
}
if (mDecoder && mDecoder->IsSeekable()) {
ProcessMediaFragmentURI();
mDecoder->SetEndTime(mFragmentEnd);

Просмотреть файл

@ -748,7 +748,11 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
if (loadAsHtml5) {
mParser = nsHtml5Module::NewHtml5Parser();
if (plainText) {
mParser->MarkAsNotScriptCreated("plain-text");
if (viewSource) {
mParser->MarkAsNotScriptCreated("view-source-plain");
} else {
mParser->MarkAsNotScriptCreated("plain-text");
}
} else if (viewSource && !contentType.EqualsLiteral("text/html")) {
mParser->MarkAsNotScriptCreated("view-source-xml");
} else {

Просмотреть файл

@ -451,6 +451,9 @@ void nsBuiltinDecoder::MetadataLoaded(PRUint32 aChannels,
mElement->FirstFrameLoaded(resourceIsLoaded);
}
// This can run cache callbacks.
mStream->EnsureCacheUpToDate();
// The element can run javascript via events
// before reaching here, so only change the
// state if we're still set to the original
@ -467,6 +470,10 @@ void nsBuiltinDecoder::MetadataLoaded(PRUint32 aChannels,
if (resourceIsLoaded) {
ResourceLoaded();
}
// Run NotifySuspendedStatusChanged now to give us a chance to notice
// that autoplay should run.
NotifySuspendedStatusChanged();
}
void nsBuiltinDecoder::ResourceLoaded()
@ -637,7 +644,9 @@ void nsBuiltinDecoder::NotifySuspendedStatusChanged()
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
if (!mStream)
return;
if (mStream->IsSuspendedByCache() && mElement) {
bool suspended = mStream->IsSuspendedByCache();
printf("*** nsBuiltinDecoder::NotifySuspendedStatusChanged(%p), suspended=%d\n", this, suspended);
if (suspended && mElement) {
// if this is an autoplay element, we need to kick off its autoplaying
// now so we consume data and hopefully free up cache space
mElement->NotifyAutoplayDataReady();

Просмотреть файл

@ -1351,6 +1351,7 @@ nsMediaCache::Update()
rv = stream->mClient->CacheClientSeek(stream->mChannelOffset,
stream->mCacheSuspended);
stream->mCacheSuspended = false;
stream->mChannelEnded = false;
break;
case RESUME:
@ -1369,6 +1370,8 @@ nsMediaCache::Update()
break;
}
stream->mHasHadUpdate = true;
if (NS_FAILED(rv)) {
// Close the streams that failed due to error. This will cause all
// client Read and Seek operations on those streams to fail. Blocked
@ -1852,6 +1855,8 @@ nsMediaCacheStream::NotifyDataEnded(nsresult aStatus)
stream->mClient->CacheClientNotifyDataEnded(aStatus);
}
}
mChannelEnded = true;
}
nsMediaCacheStream::~nsMediaCacheStream()
@ -1885,6 +1890,18 @@ nsMediaCacheStream::IsSeekable()
return mIsSeekable;
}
bool
nsMediaCacheStream::AreAllStreamsForResourceSuspended()
{
ReentrantMonitorAutoEnter mon(gMediaCache->GetReentrantMonitor());
nsMediaCache::ResourceStreamIterator iter(mResourceID);
while (nsMediaCacheStream* stream = iter.Next()) {
if (!stream->mCacheSuspended && !stream->mChannelEnded)
return false;
}
return true;
}
void
nsMediaCacheStream::Close()
{
@ -1898,6 +1915,14 @@ nsMediaCacheStream::Close()
gMediaCache->QueueUpdate();
}
void
nsMediaCacheStream::EnsureCacheUpdate()
{
if (mHasHadUpdate)
return;
gMediaCache->Update();
}
void
nsMediaCacheStream::CloseInternal(ReentrantMonitorAutoEnter& aReentrantMonitor)
{
@ -2290,6 +2315,7 @@ nsMediaCacheStream::InitAsClone(nsMediaCacheStream* aOriginal)
// Cloned streams are initially suspended, since there is no channel open
// initially for a clone.
mCacheSuspended = true;
mChannelEnded = true;
if (aOriginal->mDidNotifyDataEnded) {
mNotifyDataEndedStatus = aOriginal->mNotifyDataEndedStatus;

Просмотреть файл

@ -227,8 +227,9 @@ public:
// data for this stream.
nsMediaCacheStream(nsMediaChannelStream* aClient)
: mClient(aClient), mResourceID(0), mInitialized(false),
mHasHadUpdate(false),
mIsSeekable(false), mCacheSuspended(false),
mDidNotifyDataEnded(false),
mChannelEnded(false), mDidNotifyDataEnded(false),
mUsingNullPrincipal(false),
mChannelOffset(0), mStreamLength(-1),
mStreamOffset(0), mPlaybackBytesPerSecond(10000),
@ -263,6 +264,11 @@ public:
bool IsClosed() const { return mClosed; }
// Get the principal for this stream.
nsIPrincipal* GetCurrentPrincipal() { return mPrincipal; }
// Ensure a global media cache update has run with this stream present.
// This ensures the cache has had a chance to suspend or unsuspend this stream.
// Called only on main thread. This can change the state of streams, fire
// notifications, etc.
void EnsureCacheUpdate();
// These callbacks are called on the main thread by the client
// when data has been received via the channel.
@ -346,6 +352,10 @@ public:
// Returns the last set value of SetSeekable.
bool IsSeekable();
// Returns true when all streams for this resource are suspended or their
// channel has ended.
bool AreAllStreamsForResourceSuspended();
// These methods must be called on a different thread from the main
// thread. They should always be called on the same thread for a given
// stream.
@ -447,6 +457,9 @@ private:
PRInt64 mResourceID;
// Set to true when Init or InitAsClone has been called
bool mInitialized;
// Set to true when nsMediaCache::Update() has finished while this stream
// was present.
bool mHasHadUpdate;
// The following fields are protected by the cache's monitor but are
// only written on the main thread.
@ -457,6 +470,8 @@ private:
// full and the priority of the data that would be received is lower
// than the priority of the data already in the cache
bool mCacheSuspended;
// True if the channel ended and we haven't seeked it again.
bool mChannelEnded;
// True if CacheClientNotifyDataEnded has been called for this stream.
bool mDidNotifyDataEnded;
// True if mPrincipal is a null principal because we saw data from

Просмотреть файл

@ -74,7 +74,6 @@ nsMediaChannelStream::nsMediaChannelStream(nsMediaDecoder* aDecoder,
mReopenOnError(false), mIgnoreClose(false),
mCacheStream(this),
mLock("nsMediaChannelStream.mLock"),
mCacheSuspendCount(0),
mIgnoreResume(false)
{
}
@ -547,8 +546,9 @@ nsMediaStream* nsMediaChannelStream::CloneData(nsMediaDecoder* aDecoder)
// is already in the cache we don't create an unneccesary HTTP channel
// and perform a useless HTTP transaction.
stream->mSuspendCount = 1;
stream->mCacheSuspendCount = 1;
stream->mCacheStream.InitAsClone(&mCacheStream);
stream->mChannelStatistics = mChannelStatistics;
stream->mChannelStatistics.Stop(TimeStamp::Now());
}
return stream;
}
@ -751,6 +751,8 @@ private:
void
nsMediaChannelStream::CacheClientNotifyDataEnded(nsresult aStatus)
{
printf("*** nsMediaChannelStream::CacheClientNotifyDataEnded() mDecoder=%p\n", mDecoder);
NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");
// NOTE: this can be called with the media cache lock held, so don't
// block or do anything which might try to acquire a lock!
@ -764,17 +766,14 @@ nsMediaChannelStream::CacheClientSeek(PRInt64 aOffset, bool aResume)
{
NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");
printf("*** nsMediaChannelStream::CacheClientSeek() mDecoder=%p\n", mDecoder);
CloseChannel();
if (aResume) {
NS_ASSERTION(mSuspendCount > 0, "Too many resumes!");
// No need to mess with the channel, since we're making a new one
--mSuspendCount;
{
MutexAutoLock lock(mLock);
NS_ASSERTION(mCacheSuspendCount > 0, "CacheClientSeek(aResume=true) without previous CacheClientSuspend!");
--mCacheSuspendCount;
}
}
nsresult rv = RecreateChannel();
@ -788,10 +787,8 @@ nsMediaChannelStream::CacheClientSeek(PRInt64 aOffset, bool aResume)
nsresult
nsMediaChannelStream::CacheClientSuspend()
{
{
MutexAutoLock lock(mLock);
++mCacheSuspendCount;
}
printf("*** nsMediaChannelStream::CacheClientSuspend() mDecoder=%p\n", mDecoder);
Suspend(false);
mDecoder->NotifySuspendedStatusChanged();
@ -801,12 +798,9 @@ nsMediaChannelStream::CacheClientSuspend()
nsresult
nsMediaChannelStream::CacheClientResume()
{
printf("*** nsMediaChannelStream::CacheClientResume() mDecoder=%p\n", mDecoder);
Resume();
{
MutexAutoLock lock(mLock);
NS_ASSERTION(mCacheSuspendCount > 0, "CacheClientResume without previous CacheClientSuspend!");
--mCacheSuspendCount;
}
mDecoder->NotifySuspendedStatusChanged();
return NS_OK;
@ -830,11 +824,16 @@ nsMediaChannelStream::IsDataCachedToEndOfStream(PRInt64 aOffset)
return mCacheStream.IsDataCachedToEndOfStream(aOffset);
}
void
nsMediaChannelStream::EnsureCacheUpToDate()
{
mCacheStream.EnsureCacheUpdate();
}
bool
nsMediaChannelStream::IsSuspendedByCache()
{
MutexAutoLock lock(mLock);
return mCacheSuspendCount > 0;
return mCacheStream.AreAllStreamsForResourceSuspended();
}
bool

Просмотреть файл

@ -236,6 +236,9 @@ public:
// block the load event. Any new loads initiated (for example to seek)
// will also be in the background.
void MoveLoadsToBackground();
// Ensures that the value returned by IsSuspendedByCache below is up to date
// (i.e. the cache has examined this stream at least once).
virtual void EnsureCacheUpToDate() {}
// These can be called on any thread.
// Cached blocks associated with this stream will not be evicted
@ -267,6 +270,8 @@ public:
// data, otherwise we may not be able to make progress.
// nsMediaDecoder::NotifySuspendedStatusChanged is called when this
// changes.
// For resources using the media cache, this returns true only when all
// streams for the same resource are all suspended.
virtual bool IsSuspendedByCache() = 0;
// Returns true if this stream has been suspended.
virtual bool IsSuspended() = 0;
@ -382,6 +387,7 @@ public:
bool IsClosed() const { return mCacheStream.IsClosed(); }
virtual nsMediaStream* CloneData(nsMediaDecoder* aDecoder);
virtual nsresult ReadFromCache(char* aBuffer, PRInt64 aOffset, PRUint32 aCount);
virtual void EnsureCacheUpToDate();
// Other thread
virtual void SetReadMode(nsMediaCacheStream::ReadMode aMode);
@ -475,10 +481,9 @@ protected:
// Any thread access
nsMediaCacheStream mCacheStream;
// This lock protects mChannelStatistics and mCacheSuspendCount
// This lock protects mChannelStatistics
Mutex mLock;
nsChannelStatistics mChannelStatistics;
PRUint32 mCacheSuspendCount;
// True if we couldn't suspend the stream and we therefore don't want
// to resume later. This is usually due to the channel not being in the

Просмотреть файл

@ -257,7 +257,8 @@ ParseOptionalOffset(const nsAString& aSpec, nsSMILTimeValueSpecParams& aResult)
if (aSpec.First() != '+' && aSpec.First() != '-')
return NS_ERROR_FAILURE;
return nsSMILParserUtils::ParseClockValue(aSpec, &aResult.mOffset, true);
return nsSMILParserUtils::ParseClockValue(aSpec, &aResult.mOffset,
nsSMILParserUtils::kClockValueAllowSign);
}
nsresult
@ -686,7 +687,8 @@ nsSMILParserUtils::ParseTimeValueSpecParams(const nsAString& aSpec,
// offset type
if (*start == '+' || *start == '-' || NS_IsAsciiDigit(*start)) {
rv = ParseClockValue(spec, &aResult.mOffset, true);
rv = ParseClockValue(spec, &aResult.mOffset,
nsSMILParserUtils::kClockValueAllowSign);
if (NS_SUCCEEDED(rv)) {
aResult.mType = nsSMILTimeValueSpecParams::OFFSET;
}
@ -729,6 +731,8 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
PRInt8 sign = 0;
PRUint8 colonCount = 0;
// Indicates we have started parsing a clock-value (not including the optional
// +/- that precedes the clock-value) or keyword ("media", "indefinite")
bool started = false;
PRInt32 metricMultiplicand = MSEC_PER_SEC;
@ -749,25 +753,17 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
while (start != end) {
if (IsSpace(*start)) {
++start;
if (started) {
++start;
break;
}
// else, we haven't started yet, ignore initial whitespace
++start;
} else if ((aFlags & kClockValueAllowSign)
&& (*start == '+' || *start == '-')) {
// check sign has not already been set
} else if (!started && (aFlags & kClockValueAllowSign) &&
(*start == '+' || *start == '-')) {
// check sign has not already been set (e.g. ++10s)
if (sign != 0) {
return NS_ERROR_FAILURE;
}
// check sign is not in middle of string
if (started) {
return NS_ERROR_FAILURE;
}
sign = (*start == '+') ? 1 : -1;
++start;
// The NS_IS_DIGIT etc. macros are not locale-specific
@ -775,11 +771,11 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
prevNumCouldBeMin = numCouldBeMin;
if (!ParseClockComponent(start, end, component, numIsReal, numCouldBeMin,
numCouldBeSec))
numCouldBeSec)) {
return NS_ERROR_FAILURE;
}
started = true;
} else if (*start == ':') {
} else if (started && *start == ':') {
++colonCount;
// Neither minutes nor hours can be reals
@ -787,11 +783,6 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
return NS_ERROR_FAILURE;
}
// Clock value can't start with a ':'
if (!started) {
return NS_ERROR_FAILURE;
}
// Can't have more than two colons
if (colonCount > 2) {
return NS_ERROR_FAILURE;
@ -807,8 +798,8 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
return NS_ERROR_FAILURE;
}
if ((aFlags & kClockValueAllowIndefinite)
&& ConsumeSubstring(start, end, "indefinite")) {
if (!started && (aFlags & kClockValueAllowIndefinite) &&
ConsumeSubstring(start, end, "indefinite")) {
// We set a separate flag because we don't know what the state of the
// passed in time value is and we shouldn't change it in the case of a
// bad input string (so we can't initialise it to 0ms for example).
@ -816,8 +807,11 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
if (aResult) {
aResult->SetIndefinite();
}
} else if (aIsMedia && ConsumeSubstring(start, end, "media")) {
started = true;
} else if (!started && aIsMedia &&
ConsumeSubstring(start, end, "media")) {
*aIsMedia = true;
started = true;
} else if (!ParseMetricMultiplicand(start, end, metricMultiplicand)) {
return NS_ERROR_FAILURE;
}
@ -829,6 +823,7 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
}
}
// Whitespace/empty string
if (!started) {
return NS_ERROR_FAILURE;
}
@ -855,7 +850,7 @@ nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
// Tack on the last component
if (colonCount > 0) {
offset = offset * 60 * 1000;
offset *= 60 * 1000;
component *= 1000;
// rounding
component = (component >= 0) ? component + 0.5 : component - 0.5;

Просмотреть файл

@ -20,7 +20,7 @@ function afterOpen() {
gBrowser.contentDocument.getElementById("testinput").value = enteredText2;
/* Force the page encoding to Shift_JIS */
SetForcedCharset("Shift_JIS");
BrowserSetForcedCharacterSet("Shift_JIS");
}
function afterChangeCharset() {

Просмотреть файл

@ -22,7 +22,7 @@ function afterOpen() {
testContent(wrongText);
/* Force the page encoding to Shift_JIS */
SetForcedCharset("Shift_JIS");
BrowserSetForcedCharacterSet("Shift_JIS");
}
function afterChangeCharset() {

Просмотреть файл

@ -85,10 +85,6 @@ DIRS += \
ifdef ENABLE_TESTS
DIRS += tests
# These subdirs rely on GTK libraries and header files, it is not
# buildable on other non-GTK unix builds
ifneq (,$(filter gtk2 cocoa windows android qt os2,$(MOZ_WIDGET_TOOLKIT)))
DIRS += plugins/test
endif

Просмотреть файл

@ -90,28 +90,16 @@ Navigator::Init()
false);
}
Navigator::Navigator(nsIDocShell* aDocShell)
: mDocShell(aDocShell)
Navigator::Navigator(nsPIDOMWindow* aWindow)
: mWindow(do_GetWeakReference(aWindow))
{
NS_ASSERTION(aWindow->IsInnerWindow(),
"Navigator must get an inner window!");
}
Navigator::~Navigator()
{
if (mMimeTypes) {
mMimeTypes->Invalidate();
}
if (mPlugins) {
mPlugins->Invalidate();
}
if (mBatteryManager) {
mBatteryManager->Shutdown();
}
if (mSmsManager) {
mSmsManager->Shutdown();
}
Invalidate();
}
NS_INTERFACE_MAP_BEGIN(Navigator)
@ -129,12 +117,13 @@ NS_IMPL_ADDREF(Navigator)
NS_IMPL_RELEASE(Navigator)
void
Navigator::SetDocShell(nsIDocShell* aDocShell)
Navigator::Invalidate()
{
mDocShell = aDocShell;
mWindow = nsnull;
if (mPlugins) {
mPlugins->SetDocShell(aDocShell);
mPlugins->Invalidate();
mPlugins = nsnull;
}
// If there is a page transition, make sure delete the geolocation object.
@ -159,6 +148,15 @@ Navigator::SetDocShell(nsIDocShell* aDocShell)
}
}
nsPIDOMWindow *
Navigator::GetWindow()
{
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
return win;
}
//*****************************************************************************
// Navigator::nsIDOMNavigator
//*****************************************************************************
@ -366,7 +364,9 @@ NS_IMETHODIMP
Navigator::GetPlugins(nsIDOMPluginArray** aPlugins)
{
if (!mPlugins) {
mPlugins = new nsPluginArray(this, mDocShell);
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
mPlugins = new nsPluginArray(this, win ? win->GetDocShell() : nsnull);
}
NS_ADDREF(*aPlugins = mPlugins);
@ -388,7 +388,13 @@ Navigator::GetCookieEnabled(bool* aCookieEnabled)
// Check whether an exception overrides the global cookie behavior
// Note that the code for getting the URI here matches that in
// nsHTMLDocument::SetCookie.
nsCOMPtr<nsIDocument> doc = do_GetInterface(mDocShell);
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
if (!win || !win->GetDocShell()) {
return NS_OK;
}
nsCOMPtr<nsIDocument> doc = do_QueryInterface(win->GetExtantDocument());
if (!doc) {
return NS_OK;
}
@ -508,50 +514,11 @@ Navigator::JavaEnabled(bool* aReturn)
}
void
Navigator::LoadingNewDocument()
{
// Release these so that they will be recreated for the
// new document (if requested). The plugins or mime types
// arrays may have changed. See bug 150087.
if (mMimeTypes) {
mMimeTypes->Invalidate();
mMimeTypes = nsnull;
}
if (mPlugins) {
mPlugins->Invalidate();
mPlugins = nsnull;
}
if (mGeolocation) {
mGeolocation->Shutdown();
mGeolocation = nsnull;
}
if (mNotification) {
mNotification->Shutdown();
mNotification = nsnull;
}
if (mBatteryManager) {
mBatteryManager->Shutdown();
mBatteryManager = nsnull;
}
if (mSmsManager) {
mSmsManager->Shutdown();
mSmsManager = nsnull;
}
}
nsresult
Navigator::RefreshMIMEArray()
{
if (mMimeTypes) {
return mMimeTypes->Refresh();
mMimeTypes->Refresh();
}
return NS_OK;
}
bool
@ -569,7 +536,9 @@ Navigator::RegisterContentHandler(const nsAString& aMIMEType,
const nsAString& aURI,
const nsAString& aTitle)
{
if (!mDocShell) {
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
if (!win || !win->GetOuterWindow() || !win->GetDocShell()) {
return NS_OK;
}
@ -579,13 +548,8 @@ Navigator::RegisterContentHandler(const nsAString& aMIMEType,
return NS_OK;
}
nsCOMPtr<nsIDOMWindow> contentDOMWindow = do_GetInterface(mDocShell);
if (!contentDOMWindow) {
return NS_OK;
}
return registrar->RegisterContentHandler(aMIMEType, aURI, aTitle,
contentDOMWindow);
win->GetOuterWindow());
}
NS_IMETHODIMP
@ -593,7 +557,9 @@ Navigator::RegisterProtocolHandler(const nsAString& aProtocol,
const nsAString& aURI,
const nsAString& aTitle)
{
if (!mDocShell) {
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
if (!win || !win->GetOuterWindow() || !win->GetDocShell()) {
return NS_OK;
}
@ -603,13 +569,8 @@ Navigator::RegisterProtocolHandler(const nsAString& aProtocol,
return NS_OK;
}
nsCOMPtr<nsIDOMWindow> contentDOMWindow = do_GetInterface(mDocShell);
if (!contentDOMWindow) {
return NS_OK;
}
return registrar->RegisterProtocolHandler(aProtocol, aURI, aTitle,
contentDOMWindow);
win->GetOuterWindow());
}
NS_IMETHODIMP
@ -702,12 +663,9 @@ NS_IMETHODIMP Navigator::GetGeolocation(nsIDOMGeoGeolocation** _retval)
return NS_OK;
}
if (!mDocShell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
nsCOMPtr<nsIDOMWindow> contentDOMWindow = do_GetInterface(mDocShell);
if (!contentDOMWindow) {
if (!win || !win->GetOuterWindow() || !win->GetDocShell()) {
return NS_ERROR_FAILURE;
}
@ -716,7 +674,7 @@ NS_IMETHODIMP Navigator::GetGeolocation(nsIDOMGeoGeolocation** _retval)
return NS_ERROR_FAILURE;
}
if (NS_FAILED(mGeolocation->Init(contentDOMWindow))) {
if (NS_FAILED(mGeolocation->Init(win->GetOuterWindow()))) {
mGeolocation = nsnull;
return NS_ERROR_FAILURE;
}
@ -739,20 +697,14 @@ NS_IMETHODIMP Navigator::GetMozNotification(nsIDOMDesktopNotificationCenter** aR
return NS_OK;
}
nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mDocShell);
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> document = do_GetInterface(mDocShell);
NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
nsIScriptGlobalObject* sgo = document->GetScopeObject();
NS_ENSURE_TRUE(sgo, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(win));
NS_ENSURE_TRUE(sgo && win->GetDocShell(), NS_ERROR_FAILURE);
nsIScriptContext* scx = sgo->GetContext();
NS_ENSURE_TRUE(scx, NS_ERROR_FAILURE);
mNotification = new nsDesktopNotificationCenter(window->GetCurrentInnerWindow(),
scx);
mNotification = new nsDesktopNotificationCenter(win, scx);
NS_ADDREF(*aRetVal = mNotification);
return NS_OK;
@ -768,20 +720,15 @@ Navigator::GetMozBattery(nsIDOMMozBatteryManager** aBattery)
if (!mBatteryManager) {
*aBattery = nsnull;
nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mDocShell);
NS_ENSURE_TRUE(window, NS_OK);
nsCOMPtr<nsIDocument> document = do_GetInterface(mDocShell);
NS_ENSURE_TRUE(document, NS_OK);
nsIScriptGlobalObject* sgo = document->GetScopeObject();
NS_ENSURE_TRUE(sgo, NS_OK);
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(win));
NS_ENSURE_TRUE(sgo && win->GetDocShell(), NS_OK);
nsIScriptContext* scx = sgo->GetContext();
NS_ENSURE_TRUE(scx, NS_OK);
mBatteryManager = new battery::BatteryManager();
mBatteryManager->Init(window->GetCurrentInnerWindow(), scx);
mBatteryManager->Init(win, scx);
}
NS_ADDREF(*aBattery = mBatteryManager);
@ -809,7 +756,13 @@ Navigator::IsSmsAllowed() const
// For local files, "file://" must be listed.
// For data-urls: "moz-nullprincipal:".
// Chrome files also have to be whitelisted for the moment.
nsCOMPtr<nsIDocument> doc = do_GetInterface(mDocShell);
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
if (!win || !win->GetDocShell()) {
return defaultSmsPermission;
}
nsCOMPtr<nsIDocument> doc = do_QueryInterface(win->GetExtantDocument());
if (!doc) {
return defaultSmsPermission;
}
@ -864,20 +817,17 @@ Navigator::GetMozSms(nsIDOMMozSmsManager** aSmsManager)
return NS_OK;
}
nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mDocShell);
NS_ENSURE_TRUE(window, NS_OK);
nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
NS_ENSURE_TRUE(window && window->GetDocShell(), NS_OK);
nsCOMPtr<nsIDocument> document = do_GetInterface(mDocShell);
NS_ENSURE_TRUE(document, NS_OK);
nsIScriptGlobalObject* sgo = document->GetScopeObject();
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(window);
NS_ENSURE_TRUE(sgo, NS_OK);
nsIScriptContext* scx = sgo->GetContext();
NS_ENSURE_TRUE(scx, NS_OK);
mSmsManager = new sms::SmsManager();
mSmsManager->Init(window->GetCurrentInnerWindow(), scx);
mSmsManager->Init(window, scx);
}
NS_ADDREF(*aSmsManager = mSmsManager);

Просмотреть файл

@ -50,12 +50,13 @@
#include "nsIDOMNavigatorBattery.h"
#include "nsIDOMNavigatorSms.h"
#include "nsAutoPtr.h"
#include "nsWeakReference.h"
class nsPluginArray;
class nsMimeTypeArray;
class nsGeolocation;
class nsDesktopNotificationCenter;
class nsIDocShell;
class nsPIDOMWindow;
//*****************************************************************************
// Navigator: Script "navigator" object
@ -80,7 +81,7 @@ class Navigator : public nsIDOMNavigator,
public nsIDOMMozNavigatorSms
{
public:
Navigator(nsIDocShell *aDocShell);
Navigator(nsPIDOMWindow *aInnerWindow);
virtual ~Navigator();
NS_DECL_ISUPPORTS
@ -93,14 +94,10 @@ public:
static void Init();
void SetDocShell(nsIDocShell *aDocShell);
nsIDocShell *GetDocShell()
{
return mDocShell;
}
void Invalidate();
nsPIDOMWindow *GetWindow();
void LoadingNewDocument();
nsresult RefreshMIMEArray();
void RefreshMIMEArray();
static bool HasDesktopNotificationSupport();
@ -118,7 +115,7 @@ private:
nsRefPtr<nsDesktopNotificationCenter> mNotification;
nsRefPtr<battery::BatteryManager> mBatteryManager;
nsRefPtr<sms::SmsManager> mSmsManager;
nsIDocShell* mDocShell; // weak reference
nsWeakPtr mWindow;
};
} // namespace dom

Просмотреть файл

@ -6822,6 +6822,8 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
&v, getter_AddRefs(holder));
NS_ENSURE_SUCCESS(rv, rv);
// Hold on to the navigator object as a global property so we
// don't need to worry about losing expando properties etc.
if (!::JS_DefinePropertyById(cx, obj, id, v, nsnull, nsnull,
JSPROP_READONLY | JSPROP_PERMANENT |
JSPROP_ENUMERATE)) {
@ -7154,11 +7156,9 @@ nsresult
nsNavigatorSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj)
{
// window.navigator is persisted across document transitions if
// we're loading a page from the same origin. Because of that we
// need to parent the navigator wrapper at the outer window to avoid
// holding on to the inner window where the navigator was initially
// created too long.
// window.navigator can hold expandos and thus we need to only ever
// create one wrapper per navigator object so that expandos are
// visible independently of who's looking it up.
*parentObj = globalObj;
nsCOMPtr<nsIDOMNavigator> safeNav(do_QueryInterface(nativeObj));
@ -7170,20 +7170,17 @@ nsNavigatorSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
}
Navigator *nav = static_cast<Navigator*>(safeNav.get());
nsIDocShell *ds = nav->GetDocShell();
if (!ds) {
nsGlobalWindow *win = static_cast<nsGlobalWindow*>(nav->GetWindow());
if (!win) {
NS_WARNING("Refusing to create a navigator in the wrong scope");
return NS_ERROR_UNEXPECTED;
}
nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds);
JSObject *global = win->GetGlobalJSObject();
if (sgo) {
JSObject *global = sgo->GetGlobalJSObject();
if (global) {
*parentObj = global;
}
if (global) {
*parentObj = global;
}
return NS_OK;

Просмотреть файл

@ -1272,6 +1272,11 @@ nsGlobalWindow::FreeInnerObjects(bool aClearScope)
{
NS_ASSERTION(IsInnerWindow(), "Don't free inner objects on an outer window");
// Make sure that this is called before we null out the document and
// other members that the window destroyed observers could
// re-create.
NotifyDOMWindowDestroyed(this);
// Kill all of the workers for this window.
nsIScriptContext *scx = GetContextInternal();
JSContext *cx = scx ? scx->GetNativeContext() : nsnull;
@ -1296,6 +1301,11 @@ nsGlobalWindow::FreeInnerObjects(bool aClearScope)
mLocation = nsnull;
mHistory = nsnull;
if (mNavigator) {
mNavigator->Invalidate();
mNavigator = nsnull;
}
if (mDocument) {
NS_ASSERTION(mDoc, "Why is mDoc null?");
@ -1308,9 +1318,6 @@ nsGlobalWindow::FreeInnerObjects(bool aClearScope)
nsCycleCollector_DEBUG_shouldBeFreed(nsCOMPtr<nsISupports>(do_QueryInterface(mDocument)));
#endif
// Make sure that this is called before we null out the document.
NotifyDOMWindowDestroyed(this);
// Remove our reference to the document and the document principal.
mDocument = nsnull;
mDoc = nsnull;
@ -1733,7 +1740,6 @@ public:
WindowStateHolder(nsGlobalWindow *aWindow,
nsIXPConnectJSObjectHolder *aHolder,
Navigator *aNavigator,
nsIXPConnectJSObjectHolder *aOuterProto,
nsIXPConnectJSObjectHolder *aOuterRealProto);
@ -1741,7 +1747,6 @@ public:
nsIXPConnectJSObjectHolder *GetInnerWindowHolder()
{ return mInnerWindowHolder; }
Navigator* GetNavigator() { return mNavigator; }
nsIXPConnectJSObjectHolder* GetOuterProto() { return mOuterProto; }
nsIXPConnectJSObjectHolder* GetOuterRealProto() { return mOuterRealProto; }
@ -1750,7 +1755,6 @@ public:
mInnerWindow = nsnull;
mInnerWindowHolder = nsnull;
mNavigator = nsnull;
mOuterProto = nsnull;
mOuterRealProto = nsnull;
}
@ -1762,7 +1766,6 @@ protected:
// We hold onto this to make sure the inner window doesn't go away. The outer
// window ends up recalculating it anyway.
nsCOMPtr<nsIXPConnectJSObjectHolder> mInnerWindowHolder;
nsRefPtr<Navigator> mNavigator;
nsCOMPtr<nsIXPConnectJSObjectHolder> mOuterProto;
nsCOMPtr<nsIXPConnectJSObjectHolder> mOuterRealProto;
};
@ -1771,11 +1774,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(WindowStateHolder, WINDOWSTATEHOLDER_IID)
WindowStateHolder::WindowStateHolder(nsGlobalWindow *aWindow,
nsIXPConnectJSObjectHolder *aHolder,
Navigator *aNavigator,
nsIXPConnectJSObjectHolder *aOuterProto,
nsIXPConnectJSObjectHolder *aOuterRealProto)
: mInnerWindow(aWindow),
mNavigator(aNavigator),
mOuterProto(aOuterProto),
mOuterRealProto(aOuterRealProto)
{
@ -1930,32 +1931,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
nsresult rv = NS_OK;
// Drop our reference to the navigator object unless we're reusing
// the existing inner window or the new document is from the same
// origin as the old document.
if (!reUseInnerWindow && mNavigator && oldPrincipal) {
bool equal;
rv = oldPrincipal->Equals(aDocument->NodePrincipal(), &equal);
if (NS_FAILED(rv) || !equal) {
// Different origins. Release the navigator object so it gets
// recreated for the new document. The plugins or mime types
// arrays may have changed. See bug 150087.
mNavigator->SetDocShell(nsnull);
mNavigator = nsnull;
}
}
if (mNavigator && aDocument != oldDoc) {
// We didn't drop our reference to our old navigator object and
// we're loading a new document. Notify the navigator object about
// the new document load so that it can make sure it is ready for
// the new document.
mNavigator->LoadingNewDocument();
}
// Set mDocument even if this is an outer window to avoid
// having to *always* reach into the inner window to find the
// document.
@ -1973,8 +1948,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
nsRefPtr<nsGlobalWindow> newInnerWindow;
bool thisChrome = IsChromeWindow();
nsCOMPtr<nsIXPConnectJSObjectHolder> navigatorHolder;
jsval nav;
bool isChrome = false;
@ -1994,11 +1967,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
// inner scope.
mContext->ClearScope(mJSObject, false);
// This code should not be called during shutdown any more (now that
// we don't ever call SetNewDocument(nsnull), so no need to null
// check xpc here.
nsIXPConnect *xpc = nsContentUtils::XPConnect();
nsCOMPtr<nsIXPConnectWrappedNative> wrapper;
if (reUseInnerWindow) {
// We're reusing the current inner window.
NS_ASSERTION(!currentInner->IsFrozen(),
@ -2023,15 +1991,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
mInnerWindowHolder = wsh->GetInnerWindowHolder();
NS_ASSERTION(newInnerWindow, "Got a state without inner window");
// These assignments addref.
mNavigator = wsh->GetNavigator();
if (mNavigator) {
// Update mNavigator's docshell pointer now.
mNavigator->SetDocShell(mDocShell);
mNavigator->LoadingNewDocument();
}
} else if (thisChrome) {
newInnerWindow = new nsGlobalChromeWindow(this);
isChrome = true;
@ -2041,21 +2000,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
newInnerWindow = new nsGlobalWindow(this);
}
if (currentInner && currentInner->mJSObject) {
if (mNavigator && !aState) {
// Hold on to the navigator wrapper so that we can set
// window.navigator in the new window to point to the same
// object (assuming we didn't change origins etc). See bug
// 163645 for more on why we need this.
nsIDOMNavigator* navigator =
static_cast<nsIDOMNavigator*>(mNavigator.get());
nsContentUtils::WrapNative(cx, currentInner->mJSObject, navigator,
&NS_GET_IID(nsIDOMNavigator), &nav,
getter_AddRefs(navigatorHolder));
}
}
if (!aState) {
// This is redundant if we're restoring from a previous inner window.
nsIScriptGlobalObject *sgo =
@ -2289,33 +2233,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
// Initialize DOM classes etc on the inner window.
rv = mContext->InitClasses(newInnerWindow->mJSObject);
NS_ENSURE_SUCCESS(rv, rv);
if (navigatorHolder) {
JS_ASSERT(JSVAL_IS_OBJECT(nav));
if (js::GetObjectCompartment(JSVAL_TO_OBJECT(nav)) ==
js::GetObjectCompartment(newInnerWindow->mJSObject)) {
// Restore window.navigator onto the new inner window.
::JS_DefineProperty(cx, newInnerWindow->mJSObject, "navigator",
nav, nsnull, nsnull,
JSPROP_ENUMERATE | JSPROP_PERMANENT |
JSPROP_READONLY);
// The Navigator's prototype object keeps a reference to the
// window in which it was first created and can thus cause that
// window to stay alive for too long. Reparenting it here allows
// the window to be collected sooner.
nsIDOMNavigator* navigator =
static_cast<nsIDOMNavigator*>(mNavigator);
xpc->
ReparentWrappedNativeIfFound(cx, JSVAL_TO_OBJECT(nav),
newInnerWindow->mJSObject,
navigator,
getter_AddRefs(navigatorHolder));
}
}
}
if (mArguments) {
@ -2502,8 +2419,8 @@ nsGlobalWindow::SetDocShell(nsIDocShell* aDocShell)
mDocShell = aDocShell; // Weak Reference
if (mNavigator)
mNavigator->SetDocShell(aDocShell);
NS_ASSERTION(!mNavigator, "Non-null mNavigator in outer window!");
if (mFrames)
mFrames->SetDocShell(aDocShell);
if (mScreen)
@ -2999,12 +2916,12 @@ nsGlobalWindow::GetSelf(nsIDOMWindow** aWindow)
NS_IMETHODIMP
nsGlobalWindow::GetNavigator(nsIDOMNavigator** aNavigator)
{
FORWARD_TO_OUTER(GetNavigator, (aNavigator), NS_ERROR_NOT_INITIALIZED);
FORWARD_TO_INNER(GetNavigator, (aNavigator), NS_ERROR_NOT_INITIALIZED);
*aNavigator = nsnull;
if (!mNavigator) {
mNavigator = new Navigator(mDocShell);
mNavigator = new Navigator(this);
}
NS_ADDREF(*aNavigator = mNavigator);
@ -9960,7 +9877,6 @@ nsGlobalWindow::SaveWindowState(nsISupports **aState)
nsCOMPtr<nsISupports> state = new WindowStateHolder(inner,
mInnerWindowHolder,
mNavigator,
proto,
realProtoHolder);
NS_ENSURE_TRUE(state, NS_ERROR_OUT_OF_MEMORY);

Просмотреть файл

@ -210,20 +210,23 @@ nsMimeTypeArray::NamedItem(const nsAString& aName, nsIDOMMimeType** aReturn)
return rv;
}
void nsMimeTypeArray::Clear()
void
nsMimeTypeArray::Clear()
{
mInited = false;
mMimeTypeArray.Clear();
mPluginMimeTypeCount = 0;
}
nsresult nsMimeTypeArray::Refresh()
void
nsMimeTypeArray::Refresh()
{
Clear();
return GetMimeTypes();
GetMimeTypes();
}
nsresult nsMimeTypeArray::GetMimeTypes()
nsresult
nsMimeTypeArray::GetMimeTypes()
{
NS_PRECONDITION(!mInited && mPluginMimeTypeCount==0,
"already initialized");

Просмотреть файл

@ -58,7 +58,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMMIMETYPEARRAY
nsresult Refresh();
void Refresh();
nsIDOMMimeType* GetItemAt(PRUint32 aIndex, nsresult* aResult);
nsIDOMMimeType* GetNamedItem(const nsAString& aName, nsresult* aResult);

Просмотреть файл

@ -55,13 +55,12 @@ using namespace mozilla::dom;
nsPluginArray::nsPluginArray(Navigator* navigator,
nsIDocShell *aDocShell)
: mNavigator(navigator),
mPluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID)),
mPluginCount(0),
mPluginArray(nsnull),
mDocShell(do_GetWeakReference(aDocShell))
{
nsresult rv;
mNavigator = navigator; // don't ADDREF here, needed for parent of script object.
mPluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &rv);
mPluginCount = 0;
mPluginArray = nsnull;
mDocShell = aDocShell;
}
nsPluginArray::~nsPluginArray()
@ -101,8 +100,10 @@ bool
nsPluginArray::AllowPlugins()
{
bool allowPlugins = false;
if (mDocShell)
if (NS_FAILED(mDocShell->GetAllowPlugins(&allowPlugins)))
nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mDocShell);
if (docShell)
if (NS_FAILED(docShell->GetAllowPlugins(&allowPlugins)))
allowPlugins = false;
return allowPlugins;
@ -193,12 +194,6 @@ nsPluginArray::GetPluginHost(nsIPluginHost** aPluginHost)
return rv;
}
void
nsPluginArray::SetDocShell(nsIDocShell *aDocShell)
{
mDocShell = aDocShell;
}
void
nsPluginArray::Invalidate()
{
@ -232,7 +227,7 @@ nsPluginArray::Refresh(bool aReloadDocuments)
if(pluginsNotChanged)
return res;
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(mDocShell);
nsCOMPtr<nsIWebNavigation> webNav = do_QueryReferent(mDocShell);
if (mPluginArray != nsnull) {
for (PRUint32 i = 0; i < mPluginCount; i++)

Просмотреть файл

@ -43,6 +43,7 @@
#include "nsIDOMPlugin.h"
#include "nsIPluginHost.h"
#include "nsIURL.h"
#include "nsWeakReference.h"
namespace mozilla {
namespace dom {
@ -92,7 +93,6 @@ private:
bool AllowPlugins();
public:
void SetDocShell(nsIDocShell *aDocShell);
void Invalidate();
protected:
@ -100,7 +100,7 @@ protected:
nsCOMPtr<nsIPluginHost> mPluginHost;
PRUint32 mPluginCount;
nsIDOMPlugin** mPluginArray;
nsIDocShell* mDocShell; // weak reference
nsWeakPtr mDocShell;
};
class nsPluginElement : public nsIDOMPlugin

Просмотреть файл

@ -87,7 +87,7 @@ NS_IMPL_RELEASE_INHERITED(BatteryManager, nsDOMEventTargetWrapperCache)
BatteryManager::BatteryManager()
: mLevel(kDefaultLevel)
, mCharging(kDefaultCharging)
, mRemainingTime(kUnknownRemainingTime)
, mRemainingTime(kDefaultRemainingTime)
{
}
@ -191,6 +191,14 @@ BatteryManager::UpdateFromBatteryInfo(const hal::BatteryInformation& aBatteryInf
mLevel = aBatteryInfo.level();
mCharging = aBatteryInfo.charging();
mRemainingTime = aBatteryInfo.remainingTime();
// Add some guards to make sure the values are coherent.
if (mLevel == 1.0 && mCharging == true &&
mRemainingTime != kDefaultRemainingTime) {
mRemainingTime = kDefaultRemainingTime;
NS_ERROR("Battery API: When charging and level at 1.0, remaining time "
"should be 0. Please fix your backend!");
}
}
void

Просмотреть файл

@ -48,6 +48,7 @@ namespace battery {
static const double kDefaultLevel = 1.0;
static const bool kDefaultCharging = true;
static const double kDefaultRemainingTime = 0;
static const double kUnknownRemainingTime = -1;
} // namespace battery

Просмотреть файл

@ -26,7 +26,7 @@ var battery = navigator.mozBattery;
is(battery.level, 1.0, "Default battery level should be 1.0");
is(battery.charging, true, "Default charging value should be true");
is(battery.dischargingTime, Infinity, "Default dischargingTime should be Inifinity");
is(battery.chargingTime, Infinity, "Default chargingTime should be Inifinity");
is(battery.chargingTime, 0, "Default chargingTime should be 0");
</script>
</pre>

Просмотреть файл

@ -85,9 +85,7 @@ doubleVariantToIdentifier(NPVariant variant)
}
/*
* Parse a color in hex format, like AARRGGBB
* If the string is short, portions to the left are assumed omitted.
* R G B default to 0, A defaults to 0xFF
* Parse a color in hex format, #AARRGGBB or AARRGGBB.
*/
PRUint32
parseHexColor(const char* color, int len)
@ -95,19 +93,14 @@ parseHexColor(const char* color, int len)
PRUint8 bgra[4] = { 0, 0, 0, 0xFF };
int i = 0;
assert(len == 9 || len == 8);
// start from the right and work to the left
while (len > 0) {
while (len >= 2) { // we have at least #AA or AA left.
char byte[3];
if (len > 1) {
// parse two hex digits
byte[0] = color[len - 2];
byte[1] = color[len - 1];
}
else {
// only one digit left
byte[0] = '0';
byte[1] = color[len - 1];
}
// parse two hex digits
byte[0] = color[len - 2];
byte[1] = color[len - 1];
byte[2] = '\0';
bgra[i] = (PRUint8)(strtoul(byte, NULL, 16) & 0xFF);

Просмотреть файл

@ -259,9 +259,10 @@ nsDOMStorageManager::nsDOMStorageManager()
{
}
NS_IMPL_ISUPPORTS2(nsDOMStorageManager,
NS_IMPL_ISUPPORTS3(nsDOMStorageManager,
nsIDOMStorageManager,
nsIObserver)
nsIObserver,
nsISupportsWeakReference)
//static
nsresult
@ -288,25 +289,22 @@ nsDOMStorageManager::Initialize()
return NS_OK;
nsresult rv;
rv = os->AddObserver(gStorageManager, "cookie-changed", false);
rv = os->AddObserver(gStorageManager, "cookie-changed", true);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "offline-app-removed", false);
rv = os->AddObserver(gStorageManager, "offline-app-removed", true);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, NS_PRIVATE_BROWSING_SWITCH_TOPIC,
false);
rv = os->AddObserver(gStorageManager, NS_PRIVATE_BROWSING_SWITCH_TOPIC, true);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "profile-after-change", false);
rv = os->AddObserver(gStorageManager, "profile-after-change", true);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "perm-changed", false);
rv = os->AddObserver(gStorageManager, "perm-changed", true);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "browser:purge-domain-data", false);
rv = os->AddObserver(gStorageManager, "browser:purge-domain-data", true);
NS_ENSURE_SUCCESS(rv, rv);
// Used for temporary table flushing
rv = os->AddObserver(gStorageManager, "profile-before-change", false);
rv = os->AddObserver(gStorageManager, "profile-before-change", true);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, false);
rv = os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, true);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
@ -329,6 +327,13 @@ nsDOMStorageManager::Shutdown()
NS_IF_RELEASE(gStorageManager);
gStorageManager = nsnull;
ShutdownDB();
}
//static
void
nsDOMStorageManager::ShutdownDB()
{
delete DOMStorageImpl::gStorageDB;
DOMStorageImpl::gStorageDB = nsnull;
}
@ -484,13 +489,14 @@ nsDOMStorageManager::Observe(nsISupports *aSubject,
NS_ENSURE_SUCCESS(rv, rv);
DOMStorageImpl::gStorageDB->RemoveOwner(aceDomain, true);
} else if (!strcmp(aTopic, "profile-before-change") ||
!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
} else if (!strcmp(aTopic, "profile-before-change")) {
if (DOMStorageImpl::gStorageDB) {
DebugOnly<nsresult> rv =
DOMStorageImpl::gStorageDB->FlushAndDeleteTemporaryTables(true);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"DOMStorage: temporary table commit failed");
DOMStorageImpl::gStorageDB->Close();
nsDOMStorageManager::ShutdownDB();
}
} else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC)) {
if (DOMStorageImpl::gStorageDB) {

Просмотреть файл

@ -105,6 +105,7 @@ public:
class nsDOMStorageManager : public nsIDOMStorageManager
, public nsIObserver
, public nsSupportsWeakReference
{
public:
// nsISupports
@ -128,6 +129,7 @@ public:
static nsresult Initialize();
static nsDOMStorageManager* GetInstance();
static void Shutdown();
static void ShutdownDB();
/**
* Checks whether there is any data waiting to be flushed from a temp table.

Просмотреть файл

@ -78,6 +78,13 @@ nsDOMStorageDBWrapper::~nsDOMStorageDBWrapper()
{
}
void
nsDOMStorageDBWrapper::Close()
{
mPersistentDB.Close();
mChromePersistentDB.Close();
}
nsresult
nsDOMStorageDBWrapper::Init()
{

Просмотреть файл

@ -89,6 +89,11 @@ public:
nsDOMStorageDBWrapper();
~nsDOMStorageDBWrapper();
/**
* Close the connections, finalizing all the cached statements.
*/
void Close();
nsresult
Init();

Просмотреть файл

@ -54,6 +54,8 @@
#include "mozIStorageFunction.h"
#include "nsNetUtil.h"
using namespace mozilla;
// Temporary tables for a storage scope will be flushed if found older
// then this time in seconds since the load
#define TEMP_TABLE_MAX_AGE (10) // seconds
@ -447,6 +449,28 @@ nsDOMStoragePersistentDB::Init(const nsString& aDatabaseName)
return NS_OK;
}
void
nsDOMStoragePersistentDB::Close()
{
// Null the statements, this will finalize them.
mCopyToTempTableStatement = nsnull;
mCopyBackToDiskStatement = nsnull;
mDeleteTemporaryTableStatement = nsnull;
mGetAllKeysStatement = nsnull;
mGetKeyValueStatement = nsnull;
mInsertKeyStatement = nsnull;
mSetSecureStatement = nsnull;
mRemoveKeyStatement = nsnull;
mRemoveOwnerStatement = nsnull;
mRemoveStorageStatement = nsnull;
mRemoveAllStatement = nsnull;
mGetOfflineExcludedUsageStatement = nsnull;
mGetFullUsageStatement = nsnull;
DebugOnly<nsresult> rv = mConnection->Close();
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
nsresult
nsDOMStoragePersistentDB::EnsureLoadTemporaryTableForStorage(DOMStorageImpl* aStorage)
{

Просмотреть файл

@ -62,6 +62,12 @@ public:
nsresult
Init(const nsString& aDatabaseName);
/**
* Close the connection, finalizing all the cached statements.
*/
void
Close();
/**
* Retrieve a list of all the keys associated with a particular domain.
*/
@ -199,6 +205,7 @@ protected:
nsCOMPtr<mozIStorageStatement> mRemoveAllStatement;
nsCOMPtr<mozIStorageStatement> mGetOfflineExcludedUsageStatement;
nsCOMPtr<mozIStorageStatement> mGetFullUsageStatement;
// If you add an statement, remember to null in in Close.
nsCString mCachedOwner;
PRInt32 mCachedUsage;

Просмотреть файл

@ -100,10 +100,10 @@ function WifiGeoPositionProvider() {
gTestingEnabled = Services.prefs.getBoolPref("geo.wifi.testing");
} catch (e) {}
wifiService = null;
timer = null;
hasSeenWiFi = false;
started = false;
this.wifiService = null;
this.timer = null;
this.hasSeenWiFi = false;
this.started = false;
}
WifiGeoPositionProvider.prototype = {

Просмотреть файл

@ -55,13 +55,14 @@ public class GeckoBatteryManager
// dom/battery/Constants.h
private final static double kDefaultLevel = 1.0;
private final static boolean kDefaultCharging = true;
private final static double kDefaultRemainingTime = -1.0;
private final static double kUnknownRemainingTime = -1.0;
private static Date sLastLevelChange = new Date(0);
private static boolean sNotificationsEnabled = false;
private static double sLevel = kDefaultLevel;
private static boolean sCharging = kDefaultCharging;
private static double sRemainingTime = kUnknownRemainingTime;;
private static double sRemainingTime = kDefaultRemainingTime;;
@Override
public void onReceive(Context context, Intent intent) {
@ -135,7 +136,7 @@ public class GeckoBatteryManager
} else {
sLevel = kDefaultLevel;
sCharging = kDefaultCharging;
sRemainingTime = kUnknownRemainingTime;
sRemainingTime = kDefaultRemainingTime;
}
/*

Просмотреть файл

@ -1053,8 +1053,6 @@ LayerManagerOGL::CopyToTarget()
mGLContext->fPixelStorei(LOCAL_GL_PACK_ALIGNMENT, 4);
}
mGLContext->fFinish();
mGLContext->fReadPixels(0, 0,
width, height,
format,

Просмотреть файл

@ -342,3 +342,11 @@ CPPSRCS += \
endif
include $(topsrcdir)/config/rules.mk
ifneq (,$(INTEL_ARCHITECTURE))
ifdef GNU_CC
SkBitmapProcState_opts_SSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
SkBlitRow_opts_SSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
SkUtils_opts_SSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
endif
endif

Просмотреть файл

@ -253,7 +253,7 @@
//////////////////////////////////////////////////////////////////////
#ifndef SK_OVERRIDE
#if defined(SK_BUILD_FOR_WIN)
#if defined(_MSC_VER)
#define SK_OVERRIDE override
#elif defined(__clang__)
// Some documentation suggests we should be using __attribute__((override)),

57
gfx/skia/mingw-fix.patch Normal file
Просмотреть файл

@ -0,0 +1,57 @@
diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h
index 0135b85..bb108f8 100644
--- a/gfx/skia/include/core/SkPostConfig.h
+++ b/gfx/skia/include/core/SkPostConfig.h
@@ -253,7 +253,7 @@
//////////////////////////////////////////////////////////////////////
#ifndef SK_OVERRIDE
-#if defined(SK_BUILD_FOR_WIN)
+#if defined(_MSC_VER)
#define SK_OVERRIDE override
#elif defined(__clang__)
// Some documentation suggests we should be using __attribute__((override)),
diff --git a/gfx/skia/src/ports/SkFontHost_win.cpp b/gfx/skia/src/ports/SkFontHost_win.cpp
index dd9c5dc..ca2c3dc 100644
--- a/gfx/skia/src/ports/SkFontHost_win.cpp
+++ b/gfx/skia/src/ports/SkFontHost_win.cpp
@@ -22,7 +22,7 @@
#ifdef WIN32
#include "windows.h"
#include "tchar.h"
-#include "Usp10.h"
+#include "usp10.h"
// always packed xxRRGGBB
typedef uint32_t SkGdiRGB;
@@ -1033,6 +1033,10 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
HFONT savefont = (HFONT)SelectObject(hdc, font);
HFONT designFont = NULL;
+ const char stem_chars[] = {'i', 'I', '!', '1'};
+ int16_t min_width;
+ unsigned glyphCount;
+
// To request design units, create a logical font whose height is specified
// as unitsPerEm.
OUTLINETEXTMETRIC otm;
@@ -1046,7 +1050,7 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
if (!GetOutlineTextMetrics(hdc, sizeof(otm), &otm)) {
goto Error;
}
- const unsigned glyphCount = calculateGlyphCount(hdc);
+ glyphCount = calculateGlyphCount(hdc);
info = new SkAdvancedTypefaceMetrics;
info->fEmSize = otm.otmEMSquare;
@@ -1115,9 +1119,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
// Figure out a good guess for StemV - Min width of i, I, !, 1.
// This probably isn't very good with an italic font.
- int16_t min_width = SHRT_MAX;
+ min_width = SHRT_MAX;
info->fStemV = 0;
- char stem_chars[] = {'i', 'I', '!', '1'};
for (size_t i = 0; i < SK_ARRAY_COUNT(stem_chars); i++) {
ABC abcWidths;
if (GetCharABCWidths(hdc, stem_chars[i], stem_chars[i], &abcWidths)) {

Просмотреть файл

@ -22,7 +22,7 @@
#ifdef WIN32
#include "windows.h"
#include "tchar.h"
#include "Usp10.h"
#include "usp10.h"
// always packed xxRRGGBB
typedef uint32_t SkGdiRGB;
@ -1033,6 +1033,10 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
HFONT savefont = (HFONT)SelectObject(hdc, font);
HFONT designFont = NULL;
const char stem_chars[] = {'i', 'I', '!', '1'};
int16_t min_width;
unsigned glyphCount;
// To request design units, create a logical font whose height is specified
// as unitsPerEm.
OUTLINETEXTMETRIC otm;
@ -1046,7 +1050,7 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
if (!GetOutlineTextMetrics(hdc, sizeof(otm), &otm)) {
goto Error;
}
const unsigned glyphCount = calculateGlyphCount(hdc);
glyphCount = calculateGlyphCount(hdc);
info = new SkAdvancedTypefaceMetrics;
info->fEmSize = otm.otmEMSquare;
@ -1115,9 +1119,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
// Figure out a good guess for StemV - Min width of i, I, !, 1.
// This probably isn't very good with an italic font.
int16_t min_width = SHRT_MAX;
min_width = SHRT_MAX;
info->fStemV = 0;
char stem_chars[] = {'i', 'I', '!', '1'};
for (size_t i = 0; i < SK_ARRAY_COUNT(stem_chars); i++) {
ABC abcWidths;
if (GetCharABCWidths(hdc, stem_chars[i], stem_chars[i], &abcWidths)) {

Просмотреть файл

@ -104,4 +104,7 @@ patch -p3 < new-aa.patch
# Bug 688366 - Fix Skia marking radial gradients with the same radius as invalid.
patch -p3 < radial-gradients.patch
# Fix restrict keyword problem for VS2005
patch -p3 < skia-restrict-problem.patch
patch -p3 < skia_restrict_problem.patch
# Bug 705656 - Broken SKIA compilation on mingw
patch -p3 < mingw-fix.patch

Просмотреть файл

@ -199,7 +199,7 @@ UPowerClient::UPowerClient()
, mTrackedDevice(nsnull)
, mLevel(kDefaultLevel)
, mCharging(kDefaultCharging)
, mRemainingTime(kUnknownRemainingTime)
, mRemainingTime(kDefaultRemainingTime)
{
}
@ -279,7 +279,7 @@ UPowerClient::StopListening()
// We should now show the default values, not the latest we got.
mLevel = kDefaultLevel;
mCharging = kDefaultCharging;
mRemainingTime = kUnknownRemainingTime;
mRemainingTime = kDefaultRemainingTime;
}
void

Просмотреть файл

@ -227,8 +227,9 @@ AsyncChannel::SynchronouslyClose()
}
bool
AsyncChannel::Send(Message* msg)
AsyncChannel::Send(Message* _msg)
{
nsAutoPtr<Message> msg(_msg);
AssertWorkerThread();
mMonitor.AssertNotCurrentThreadOwns();
NS_ABORT_IF_FALSE(MSG_ROUTING_NONE != msg->routing_id(), "need a route");
@ -241,15 +242,16 @@ AsyncChannel::Send(Message* msg)
return false;
}
SendThroughTransport(msg);
SendThroughTransport(msg.forget());
}
return true;
}
bool
AsyncChannel::Echo(Message* msg)
AsyncChannel::Echo(Message* _msg)
{
nsAutoPtr<Message> msg(_msg);
AssertWorkerThread();
mMonitor.AssertNotCurrentThreadOwns();
NS_ABORT_IF_FALSE(MSG_ROUTING_NONE != msg->routing_id(), "need a route");
@ -267,7 +269,7 @@ AsyncChannel::Echo(Message* msg)
// and RPCChannel too
mIOLoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &AsyncChannel::OnEchoMessage, msg));
NewRunnableMethod(this, &AsyncChannel::OnEchoMessage, msg.forget()));
// OnEchoMessage takes ownership of |msg|
}

Просмотреть файл

@ -151,8 +151,9 @@ RPCChannel::Send(Message* msg, Message* reply)
}
bool
RPCChannel::Call(Message* msg, Message* reply)
RPCChannel::Call(Message* _msg, Message* reply)
{
nsAutoPtr<Message> msg(_msg);
AssertWorkerThread();
mMonitor.AssertNotCurrentThreadOwns();
RPC_ASSERT(!ProcessingSyncMessage(),
@ -178,7 +179,7 @@ RPCChannel::Call(Message* msg, Message* reply)
msg->set_rpc_local_stack_depth(1 + StackDepth());
mStack.push(*msg);
SendThroughTransport(msg);
SendThroughTransport(msg.forget());
while (1) {
// if a handler invoked by *Dispatch*() spun a nested event

Просмотреть файл

@ -95,8 +95,10 @@ SyncChannel::EventOccurred()
}
bool
SyncChannel::Send(Message* msg, Message* reply)
SyncChannel::Send(Message* _msg, Message* reply)
{
nsAutoPtr<Message> msg(_msg);
AssertWorkerThread();
mMonitor.AssertNotCurrentThreadOwns();
NS_ABORT_IF_FALSE(!ProcessingSyncMessage(),
@ -118,7 +120,7 @@ SyncChannel::Send(Message* msg, Message* reply)
mPendingReply = msg->type() + 1;
int32 msgSeqno = msg->seqno();
SendThroughTransport(msg);
SendThroughTransport(msg.forget());
while (1) {
bool maybeTimedOut = !SyncChannel::WaitForNotify();

Просмотреть файл

@ -2497,8 +2497,8 @@ ia64*-hpux*)
fi
if test -n "$GNU_CC"; then
CFLAGS="$CFLAGS -mstackrealign"
CXXFLAGS="$CXXFLAGS -mstackrealign"
CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
fi
MOZ_CHECK_HEADERS(mmintrin.h)

Просмотреть файл

@ -558,6 +558,16 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::SparcRegist
//
// After callWithABI(), the call state is reset, so a new call may begin.
Call callWithABI(void *fun, bool canThrow) {
#ifdef JS_CPU_ARM
// the repatcher requires that these instructions are adjacent in
// memory, make sure that they are in fact adjacent.
// Theoretically, this requires only 12 bytes of space, however
// there are at least a couple of off-by-one errors that I've noticed
// that make 12 insufficent. In case 16 is also insufficent, I've bumped
// it to 20.
ensureSpace(20);
int initFlushCount = flushCount();
#endif
// [Bug 614953]: This can only be made conditional once the ARM back-end
// is able to distinguish and patch both call sequences. Other
// architecutres are unaffected regardless.
@ -572,7 +582,9 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::SparcRegist
Call cl = call();
callPatches.append(CallPatch(cl, fun));
#ifdef JS_CPU_ARM
JS_ASSERT(initFlushCount == flushCount());
#endif
if (stackAdjust)
addPtr(Imm32(stackAdjust), stackPointerRegister);

Просмотреть файл

@ -154,8 +154,6 @@ IsPermitted(const char *name, JSFlatString *prop, bool set)
NAME('L', "Location",
PROP('h', W("hash") W("href"))
PROP('r', R("replace")))
NAME('N', "Navigator",
PROP('p', RW("preference")))
NAME('W', "Window",
PROP('b', R("blur"))
PROP('c', R("close") R("closed"))

Просмотреть файл

@ -70,6 +70,7 @@ DIRS += build
ifdef ENABLE_TESTS
PARALLEL_DIRS += \
mathml/tests \
xul/test \
xul/base/test \
$(NULL)

Просмотреть файл

@ -60,6 +60,10 @@
#include "mozilla/dom/TabChild.h"
#include "mozilla/Util.h"
#ifdef XP_WIN
#include "winuser.h"
#endif
#include "nsPresShell.h"
#include "nsPresContext.h"
#include "nsIContent.h"
@ -6260,6 +6264,11 @@ IsFullScreenAndRestrictedKeyEvent(nsIContent* aTarget, const nsEvent* aEvent)
case NS_VK_CONTROL:
case NS_VK_ALT:
case NS_VK_META:
#ifdef XP_WIN
case VK_VOLUME_MUTE:
case VK_VOLUME_DOWN:
case VK_VOLUME_UP:
#endif
// Unrestricted key code.
return false;
default:

Просмотреть файл

@ -747,8 +747,8 @@ nsFileControlFrame::CreateAccessible()
if (!accService)
return nsnull;
return accService->CreateHyperTextAccessible(mContent,
PresContext()->PresShell());
return accService->CreateHTMLFileInputAccessible(mContent,
PresContext()->PresShell());
}
#endif

Просмотреть файл

@ -84,12 +84,12 @@ nsMathMLmactionFrame::~nsMathMLmactionFrame()
// unregister us as a mouse event listener ...
// printf("maction:%p unregistering as mouse event listener ...\n", this);
if (mListener) {
mContent->RemoveEventListener(NS_LITERAL_STRING("click"), mListener,
false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseover"), mListener,
false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseout"), mListener,
false);
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("click"), mListener,
false);
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("mouseover"), mListener,
false);
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("mouseout"), mListener,
false);
}
}
@ -228,12 +228,12 @@ nsMathMLmactionFrame::SetInitialChildList(ChildListID aListID,
// create mouse event listener and register it
mListener = new nsMathMLmactionFrame::MouseListener(this);
// printf("maction:%p registering as mouse event listener ...\n", this);
mContent->AddEventListener(NS_LITERAL_STRING("click"), mListener,
false, false);
mContent->AddEventListener(NS_LITERAL_STRING("mouseover"), mListener,
false, false);
mContent->AddEventListener(NS_LITERAL_STRING("mouseout"), mListener,
false, false);
mContent->AddSystemEventListener(NS_LITERAL_STRING("click"), mListener,
false, false);
mContent->AddSystemEventListener(NS_LITERAL_STRING("mouseover"), mListener,
false, false);
mContent->AddSystemEventListener(NS_LITERAL_STRING("mouseout"), mListener,
false, false);
}
return rv;
}

Просмотреть файл

@ -0,0 +1,52 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Mozilla Foundation.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = layout/mathml/tests
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES =\
test_bug706406.html \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)

Просмотреть файл

@ -0,0 +1,71 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=706406
-->
<head>
<title>Test for Bug 706406</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=706406">Mozilla Bug 706406</a>
<p id="display"></p>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<maction actiontype="toggle" id="maction">
<mn>1</mn>
<mn>2</mn>
</maction>
</math>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 706406 **/
function doTest()
{
function doStopPropagation(aEvent) {
aEvent.stopPropagation();
}
var maction = document.getElementById("maction");
synthesizeMouseAtCenter(maction, {});
is(maction.getAttribute("selection"), "2",
"maction's selection attribute isn't 2 by first click");
synthesizeMouseAtCenter(maction, {});
is(maction.getAttribute("selection"), "1",
"maction's selection attribute isn't 1 by second click");
window.addEventListener("mousedown", doStopPropagation, true);
window.addEventListener("mouseup", doStopPropagation, true);
window.addEventListener("click", doStopPropagation, true);
synthesizeMouseAtCenter(maction, {});
is(maction.getAttribute("selection"), "2",
"maction's selection attribute isn't 2 by first click called stopPropagation()");
synthesizeMouseAtCenter(maction, {});
is(maction.getAttribute("selection"), "1",
"maction's selection attribute isn't 1 by second click called stopPropagation()");
window.removeEventListener("mousedown", doStopPropagation, true);
window.removeEventListener("mouseup", doStopPropagation, true);
window.removeEventListener("click", doStopPropagation, true);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(doTest);
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print"><head>
<style>
div.spacer {
height: 5px;
width: 10px;
}
img, td.spacer {
height: 140px;
width: 30px;
}
</style>
<title>rowspan pagination</title>
</head>
<body>
<div class="spacer"> </div>
<table>
<tbody>
<tr><td class="spacer"></td></tr>
<tr style="page-break-before:always">
<td rowspan="2">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
</td>
</tr>
<tr></tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print"><head>
<style>
div.spacer {
height: 5px;
width: 10px;
}
img, td.spacer {
height: 140px;
width: 30px;
}
</style>
<title>rowspan pagination</title>
</head>
<body>
<div class="spacer"> </div>
<table>
<tbody>
<tr><td class="spacer"></td></tr>
<tr>
<td rowspan="2">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
</td>
</tr>
<tr></tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -1233,6 +1233,7 @@ fails-if(cocoaWidget) == 456147.xul 456147-ref.html # bug 458047
== 466395-2.html 466395-2-ref.html
== 467084-1.html 467084-1-ref.html
== 467084-2.html 467084-2-ref.html
== 467444-1.html 467444-1-ref.html
== 467460-1.html 467460-1-ref.html
== 468546-1.xhtml 468546-1-ref.xhtml
== 468473-1.xul 468473-1-ref.xul

Просмотреть файл

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg">
<rect width="100" height="100" fill="green"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 96 B

Просмотреть файл

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
class="reftest-wait"
onload="setTimeAndSnapshot(5)">
<script xlink:href="../smil-util.js" type="text/javascript"/>
<rect width="100" height="100" fill="red">
<set attributeName="fill" to="green" dur="1s" repeatDur="indefinite"/>
</rect>
</svg>

После

Ширина:  |  Высота:  |  Размер: 343 B

Просмотреть файл

@ -1,2 +1,3 @@
# Tests for repeat behaviour
== indefinite-repeat-1.svg green-box-ref.svg
== init-repeat-1.svg init-repeat-1-ref.svg

Просмотреть файл

@ -1236,7 +1236,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
UndoContinuedRow(aPresContext, contRow);
contRow = nsnull;
nsTableRowFrame* oldLastRowThisPage = lastRowThisPage;
lastRowThisPage = firstTruncatedRow;
lastRowThisPage = rowBefore;
aStatus = NS_FRAME_NOT_COMPLETE;
// Call SplitSpanningCells again with rowBefore as the last row on the page

Просмотреть файл

@ -43,7 +43,8 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = layout_debug
DIRS = src ui tests
MODULE = layout_debug
DIRS = src ui
TEST_DIRS = tests
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -63,3 +63,12 @@ libs:: $(_TEST_FILES)
libs:: $(_CHROME_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
ifneq (mobile,$(MOZ_BUILD_APP))
_BROWSER_FILES = \
browser_bug703210.js \
$(NULL)
libs:: $(_BROWSER_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
endif

Просмотреть файл

@ -0,0 +1,65 @@
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
let doStopPropagation = function (aEvent)
{
aEvent.stopPropagation();
}
let onPopupShowing = function (aEvent)
{
is(aEvent.originalTarget.localName, "tooltip", "tooltip is showing");
let doc = gBrowser.contentDocument;
let win = gBrowser.contentWindow;
let p2 = doc.getElementById("p2");
setTimeout(function () {
EventUtils.synthesizeMouseAtCenter(p2, { type: "mousemove" }, win); }, 0);
}
let onPopupHiding = function (aEvent)
{
is(aEvent.originalTarget.localName, "tooltip", "tooltip is hiding");
let doc = gBrowser.contentDocument;
doc.removeEventListener("mousemove", doStopPropagation, true);
doc.removeEventListener("mouseenter", doStopPropagation, true);
doc.removeEventListener("mouseleave", doStopPropagation, true);
doc.removeEventListener("mouseover", doStopPropagation, true);
doc.removeEventListener("mouseout", doStopPropagation, true);
document.removeEventListener("popupshowing", onPopupShowing, true);
document.removeEventListener("popuphiding", onPopupHiding, true);
gBrowser.removeCurrentTab();
finish();
}
let onLoad = function (aEvent)
{
let doc = gBrowser.contentDocument;
let win = gBrowser.contentWindow;
let p1 = doc.getElementById("p1");
let p2 = doc.getElementById("p2");
EventUtils.synthesizeMouseAtCenter(p2, { type: "mousemove" }, win);
doc.addEventListener("mousemove", doStopPropagation, true);
doc.addEventListener("mouseenter", doStopPropagation, true);
doc.addEventListener("mouseleave", doStopPropagation, true);
doc.addEventListener("mouseover", doStopPropagation, true);
doc.addEventListener("mouseout", doStopPropagation, true);
document.addEventListener("popupshown", onPopupShowing, true);
document.addEventListener("popuphiding", onPopupHiding, true);
EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win);
}
gBrowser.selectedBrowser.addEventListener("load",
function () { setTimeout(onLoad, 0); }, true);
content.location = "data:text/html," +
"<p id=\"p1\" title=\"tooltip is here\">This paragraph has a tooltip.</p>" +
"<p id=\"p2\">This paragraph doesn't have tooltip.</p>";
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше