Merge mozilla-central to mozilla-inbound

This commit is contained in:
Ed Morley 2012-10-15 16:09:10 +01:00
commit 25701792b7
44 changed files with 5280 additions and 5870 deletions

View File

@ -262,19 +262,6 @@ public:
//----------------------------------------
/**
* Check whether a spec feature/version is supported.
* @param aObject the object, which should support the feature,
* for example nsIDOMNode or nsIDOMDOMImplementation
* @param aFeature the feature ("Views", "Core", "HTML", "Range" ...)
* @param aVersion the version ("1.0", "2.0", ...)
* @param aReturn whether the feature is supported or not [OUT]
*/
static nsresult InternalIsSupported(nsISupports* aObject,
const nsAString& aFeature,
const nsAString& aVersion,
bool* aReturn);
/**
* If there are listeners for DOMNodeInserted event, fires the event on all
* aNodes

View File

@ -2146,6 +2146,18 @@ public:
static bool GetSVGGlyphExtents(Element *aElement, const gfxMatrix& aSVGToAppSpace,
gfxRect *aResult);
/**
* Check whether a spec feature/version is supported.
* @param aObject the object, which should support the feature,
* for example nsIDOMNode or nsIDOMDOMImplementation
* @param aFeature the feature ("Views", "Core", "HTML", "Range" ...)
* @param aVersion the version ("1.0", "2.0", ...)
* @return whether the feature is supported or not
*/
static bool InternalIsSupported(nsISupports* aObject,
const nsAString& aFeature,
const nsAString& aVersion);
private:
static bool InitializeEventTable();

View File

@ -113,7 +113,6 @@
#include "prprf.h"
#include "nsDOMMutationObserver.h"
#include "nsSVGFeatures.h"
#include "nsWrapperCacheInlines.h"
#include "nsCycleCollector.h"
#include "xpcpublic.h"
@ -690,76 +689,13 @@ FragmentOrElement::GetPrefix(nsAString& aPrefix)
return NS_OK;
}
nsresult
FragmentOrElement::InternalIsSupported(nsISupports* aObject,
const nsAString& aFeature,
const nsAString& aVersion,
bool* aReturn)
{
NS_ENSURE_ARG_POINTER(aReturn);
*aReturn = false;
// Convert the incoming UTF16 strings to raw char*'s to save us some
// code when doing all those string compares.
NS_ConvertUTF16toUTF8 feature(aFeature);
NS_ConvertUTF16toUTF8 version(aVersion);
const char *f = feature.get();
const char *v = version.get();
if (PL_strcasecmp(f, "XML") == 0 ||
PL_strcasecmp(f, "HTML") == 0) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "1.0") == 0 ||
PL_strcmp(v, "2.0") == 0) {
*aReturn = true;
}
} else if (PL_strcasecmp(f, "Views") == 0 ||
PL_strcasecmp(f, "StyleSheets") == 0 ||
PL_strcasecmp(f, "Core") == 0 ||
PL_strcasecmp(f, "CSS") == 0 ||
PL_strcasecmp(f, "CSS2") == 0 ||
PL_strcasecmp(f, "Events") == 0 ||
PL_strcasecmp(f, "UIEvents") == 0 ||
PL_strcasecmp(f, "MouseEvents") == 0 ||
// Non-standard!
PL_strcasecmp(f, "MouseScrollEvents") == 0 ||
PL_strcasecmp(f, "HTMLEvents") == 0 ||
PL_strcasecmp(f, "Range") == 0 ||
PL_strcasecmp(f, "XHTML") == 0) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "2.0") == 0) {
*aReturn = true;
}
} else if (PL_strcasecmp(f, "XPath") == 0) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "3.0") == 0) {
*aReturn = true;
}
} else if (PL_strcasecmp(f, "SVGEvents") == 0 ||
PL_strcasecmp(f, "SVGZoomEvents") == 0 ||
nsSVGFeatures::HasFeature(aObject, aFeature)) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "1.0") == 0 ||
PL_strcmp(v, "1.1") == 0) {
*aReturn = true;
}
}
else if (NS_SMILEnabled() && PL_strcasecmp(f, "TimeControl") == 0) {
if (aVersion.IsEmpty() || PL_strcmp(v, "1.0") == 0) {
*aReturn = true;
}
}
return NS_OK;
}
NS_IMETHODIMP
FragmentOrElement::IsSupported(const nsAString& aFeature,
const nsAString& aVersion,
bool* aReturn)
{
return InternalIsSupported(this, aFeature, aVersion, aReturn);
*aReturn = nsContentUtils::InternalIsSupported(this, aFeature, aVersion);
return NS_OK;
}
NS_IMETHODIMP

View File

@ -171,6 +171,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#include "nsIParserService.h"
#include "nsIDOMScriptObjectFactory.h"
#include "nsSandboxFlags.h"
#include "nsSVGFeatures.h"
#include "nsWrapperCacheInlines.h"
@ -7133,3 +7134,63 @@ nsContentUtils::GetHTMLEditor(nsPresContext* aPresContext)
editorDocShell->GetEditor(getter_AddRefs(editor));
return editor;
}
bool
nsContentUtils::InternalIsSupported(nsISupports* aObject,
const nsAString& aFeature,
const nsAString& aVersion)
{
// Convert the incoming UTF16 strings to raw char*'s to save us some
// code when doing all those string compares.
NS_ConvertUTF16toUTF8 feature(aFeature);
NS_ConvertUTF16toUTF8 version(aVersion);
const char *f = feature.get();
const char *v = version.get();
if (PL_strcasecmp(f, "XML") == 0 ||
PL_strcasecmp(f, "HTML") == 0) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "1.0") == 0 ||
PL_strcmp(v, "2.0") == 0) {
return true;
}
} else if (PL_strcasecmp(f, "Views") == 0 ||
PL_strcasecmp(f, "StyleSheets") == 0 ||
PL_strcasecmp(f, "Core") == 0 ||
PL_strcasecmp(f, "CSS") == 0 ||
PL_strcasecmp(f, "CSS2") == 0 ||
PL_strcasecmp(f, "Events") == 0 ||
PL_strcasecmp(f, "UIEvents") == 0 ||
PL_strcasecmp(f, "MouseEvents") == 0 ||
// Non-standard!
PL_strcasecmp(f, "MouseScrollEvents") == 0 ||
PL_strcasecmp(f, "HTMLEvents") == 0 ||
PL_strcasecmp(f, "Range") == 0 ||
PL_strcasecmp(f, "XHTML") == 0) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "2.0") == 0) {
return true;
}
} else if (PL_strcasecmp(f, "XPath") == 0) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "3.0") == 0) {
return true;
}
} else if (PL_strcasecmp(f, "SVGEvents") == 0 ||
PL_strcasecmp(f, "SVGZoomEvents") == 0 ||
nsSVGFeatures::HasFeature(aObject, aFeature)) {
if (aVersion.IsEmpty() ||
PL_strcmp(v, "1.0") == 0 ||
PL_strcmp(v, "1.1") == 0) {
return true;
}
}
else if (NS_SMILEnabled() && PL_strcasecmp(f, "TimeControl") == 0) {
if (aVersion.IsEmpty() || PL_strcmp(v, "1.0") == 0) {
return true;
}
}
return false;
}

View File

@ -446,8 +446,9 @@ nsDOMAttribute::IsSupported(const nsAString& aFeature,
{
OwnerDoc()->WarnOnceAbout(nsIDocument::eIsSupported);
return nsGenericElement::InternalIsSupported(static_cast<nsIDOMAttr*>(this),
aFeature, aVersion, aReturn);
*aReturn = nsContentUtils::InternalIsSupported(static_cast<nsIDOMAttr*>(this),
aFeature, aVersion);
return NS_OK;
}
already_AddRefed<nsIURI>

View File

@ -1337,9 +1337,10 @@ nsDOMImplementation::HasFeature(const nsAString& aFeature,
const nsAString& aVersion,
bool* aReturn)
{
return nsGenericElement::InternalIsSupported(
*aReturn = nsContentUtils::InternalIsSupported(
static_cast<nsIDOMDOMImplementation*>(this),
aFeature, aVersion, aReturn);
aFeature, aVersion);
return NS_OK;
}
NS_IMETHODIMP
@ -5970,8 +5971,9 @@ NS_IMETHODIMP
nsDocument::IsSupported(const nsAString& aFeature, const nsAString& aVersion,
bool* aReturn)
{
return nsGenericElement::InternalIsSupported(static_cast<nsIDOMDocument*>(this),
aFeature, aVersion, aReturn);
*aReturn = nsContentUtils::InternalIsSupported(static_cast<nsIDOMDocument*>(this),
aFeature, aVersion);
return NS_OK;
}
NS_IMETHODIMP

View File

@ -148,8 +148,9 @@ nsGenericDOMDataNode::IsSupported(const nsAString& aFeature,
const nsAString& aVersion,
bool* aReturn)
{
return nsGenericElement::InternalIsSupported(static_cast<nsIContent*>(this),
aFeature, aVersion, aReturn);
*aReturn = nsContentUtils::InternalIsSupported(static_cast<nsIContent*>(this),
aFeature, aVersion);
return NS_OK;
}
//----------------------------------------------------------------------

View File

@ -14,6 +14,7 @@
#include "nsDOMEvent.h"
#include "nsGlobalWindow.h"
#include "nsJSUtils.h"
#include "mozilla/dom/ScreenBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -111,120 +112,42 @@ NS_IMPL_RELEASE_INHERITED(nsScreen, nsDOMEventTargetHelper)
NS_IMPL_EVENT_HANDLER(nsScreen, mozorientationchange)
NS_IMETHODIMP
nsScreen::GetTop(int32_t* aTop)
{
nsRect rect;
nsresult rv = GetRect(rect);
*aTop = rect.y;
return rv;
}
NS_IMETHODIMP
nsScreen::GetLeft(int32_t* aLeft)
{
nsRect rect;
nsresult rv = GetRect(rect);
*aLeft = rect.x;
return rv;
}
NS_IMETHODIMP
nsScreen::GetWidth(int32_t* aWidth)
{
nsRect rect;
nsresult rv = GetRect(rect);
*aWidth = rect.width;
return rv;
}
NS_IMETHODIMP
nsScreen::GetHeight(int32_t* aHeight)
{
nsRect rect;
nsresult rv = GetRect(rect);
*aHeight = rect.height;
return rv;
}
NS_IMETHODIMP
nsScreen::GetPixelDepth(int32_t* aPixelDepth)
int32_t
nsScreen::GetPixelDepth(ErrorResult& aRv)
{
nsDeviceContext* context = GetDeviceContext();
if (!context) {
*aPixelDepth = -1;
return NS_ERROR_FAILURE;
aRv.Throw(NS_ERROR_FAILURE);
return -1;
}
uint32_t depth;
context->GetDepth(depth);
*aPixelDepth = depth;
return NS_OK;
return depth;
}
NS_IMETHODIMP
nsScreen::GetColorDepth(int32_t* aColorDepth)
{
return GetPixelDepth(aColorDepth);
}
#define FORWARD_LONG_GETTER(_name) \
NS_IMETHODIMP \
nsScreen::Get ## _name(int32_t* aOut) \
{ \
ErrorResult rv; \
*aOut = Get ## _name(rv); \
return rv.ErrorCode(); \
}
NS_IMETHODIMP
nsScreen::GetAvailWidth(int32_t* aAvailWidth)
{
nsRect rect;
nsresult rv = GetAvailRect(rect);
FORWARD_LONG_GETTER(AvailWidth)
FORWARD_LONG_GETTER(AvailHeight)
FORWARD_LONG_GETTER(Width)
FORWARD_LONG_GETTER(Height)
*aAvailWidth = rect.width;
FORWARD_LONG_GETTER(Top)
FORWARD_LONG_GETTER(Left)
FORWARD_LONG_GETTER(AvailTop)
FORWARD_LONG_GETTER(AvailLeft)
return rv;
}
NS_IMETHODIMP
nsScreen::GetAvailHeight(int32_t* aAvailHeight)
{
nsRect rect;
nsresult rv = GetAvailRect(rect);
*aAvailHeight = rect.height;
return rv;
}
NS_IMETHODIMP
nsScreen::GetAvailLeft(int32_t* aAvailLeft)
{
nsRect rect;
nsresult rv = GetAvailRect(rect);
*aAvailLeft = rect.x;
return rv;
}
NS_IMETHODIMP
nsScreen::GetAvailTop(int32_t* aAvailTop)
{
nsRect rect;
nsresult rv = GetAvailRect(rect);
*aAvailTop = rect.y;
return rv;
}
FORWARD_LONG_GETTER(PixelDepth)
FORWARD_LONG_GETTER(ColorDepth)
nsDeviceContext*
nsScreen::GetDeviceContext()
@ -287,28 +210,34 @@ nsScreen::Notify(const hal::ScreenConfiguration& aConfiguration)
}
}
NS_IMETHODIMP
nsScreen::GetMozOrientation(nsAString& aOrientation)
void
nsScreen::GetMozOrientation(nsString& aOrientation)
{
switch (mOrientation) {
case eScreenOrientation_PortraitPrimary:
aOrientation.AssignLiteral("portrait-primary");
break;
case eScreenOrientation_PortraitSecondary:
aOrientation.AssignLiteral("portrait-secondary");
break;
case eScreenOrientation_LandscapePrimary:
aOrientation.AssignLiteral("landscape-primary");
break;
case eScreenOrientation_LandscapeSecondary:
aOrientation.AssignLiteral("landscape-secondary");
break;
case eScreenOrientation_None:
default:
MOZ_ASSERT(false);
return NS_ERROR_FAILURE;
case eScreenOrientation_PortraitPrimary:
aOrientation.AssignLiteral("portrait-primary");
break;
case eScreenOrientation_PortraitSecondary:
aOrientation.AssignLiteral("portrait-secondary");
break;
case eScreenOrientation_LandscapePrimary:
aOrientation.AssignLiteral("landscape-primary");
break;
case eScreenOrientation_LandscapeSecondary:
aOrientation.AssignLiteral("landscape-secondary");
break;
case eScreenOrientation_None:
default:
MOZ_NOT_REACHED("Unacceptable mOrientation value");
}
}
NS_IMETHODIMP
nsScreen::GetSlowMozOrientation(nsAString& aOrientation)
{
nsString orientation;
GetMozOrientation(orientation);
aOrientation = orientation;
return NS_OK;
}
@ -346,48 +275,81 @@ nsScreen::GetLockOrientationPermission() const
}
NS_IMETHODIMP
nsScreen::MozLockOrientation(const jsval& aOrientation, JSContext* aCx, bool* aReturn)
nsScreen::MozLockOrientation(const JS::Value& aOrientation, JSContext* aCx,
bool* aReturn)
{
*aReturn = false;
nsAutoTArray<nsString, 8> orientations;
// Preallocating 8 elements to make it faster.
if (aOrientation.isString()) {
nsDependentJSString item;
item.init(aCx, aOrientation.toString());
orientations.AppendElement(item);
} else {
// If we don't have a string, we must have an Array.
if (!aOrientation.isObject()) {
return NS_ERROR_INVALID_ARG;
}
JSObject& obj = aOrientation.toObject();
if (aOrientation.isObject() && IsArrayLike(aCx, &aOrientation.toObject())) {
JSObject* seq = &aOrientation.toObject();
uint32_t length;
if (!JS_GetArrayLength(aCx, &obj, &length) || length <= 0) {
return NS_ERROR_INVALID_ARG;
// JS_GetArrayLength actually works on all objects
if (!JS_GetArrayLength(aCx, seq, &length)) {
return NS_ERROR_FAILURE;
}
orientations.SetCapacity(length);
Sequence<nsString> orientations;
if (!orientations.SetCapacity(length)) {
return NS_ERROR_OUT_OF_MEMORY;
}
for (uint32_t i = 0; i < length; ++i) {
jsval value;
NS_ENSURE_TRUE(JS_GetElement(aCx, &obj, i, &value), NS_ERROR_UNEXPECTED);
if (!value.isString()) {
return NS_ERROR_INVALID_ARG;
JS::Value temp;
if (!JS_GetElement(aCx, seq, i, &temp)) {
return NS_ERROR_FAILURE;
}
nsDependentJSString item;
item.init(aCx, value);
orientations.AppendElement(item);
js::RootedString jsString(aCx, JS_ValueToString(aCx, temp));
if (!jsString) {
return NS_ERROR_FAILURE;
}
nsDependentJSString str;
if (!str.init(aCx, jsString)) {
return NS_ERROR_FAILURE;
}
*orientations.AppendElement() = str;
}
ErrorResult rv;
*aReturn = MozLockOrientation(orientations, rv);
return rv.ErrorCode();
}
js::RootedString jsString(aCx, JS_ValueToString(aCx, aOrientation));
if (!jsString) {
return NS_ERROR_FAILURE;
}
nsDependentJSString orientation;
if (!orientation.init(aCx, jsString)) {
return NS_ERROR_FAILURE;
}
ErrorResult rv;
*aReturn = MozLockOrientation(orientation, rv);
return rv.ErrorCode();
}
bool
nsScreen::MozLockOrientation(const nsAString& aOrientation, ErrorResult& aRv)
{
nsString orientation(aOrientation);
Sequence<nsString> orientations;
if (!orientations.AppendElement(orientation)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
}
return MozLockOrientation(orientations, aRv);
}
bool
nsScreen::MozLockOrientation(const Sequence<nsString>& aOrientations,
ErrorResult& aRv)
{
ScreenOrientation orientation = eScreenOrientation_None;
for (uint32_t i=0; i<orientations.Length(); ++i) {
nsString& item = orientations[i];
for (uint32_t i = 0; i < aOrientations.Length(); ++i) {
const nsString& item = aOrientations[i];
if (item.EqualsLiteral("portrait")) {
orientation |= eScreenOrientation_PortraitPrimary |
@ -404,22 +366,20 @@ nsScreen::MozLockOrientation(const jsval& aOrientation, JSContext* aCx, bool* aR
} else if (item.EqualsLiteral("landscape-secondary")) {
orientation |= eScreenOrientation_LandscapeSecondary;
} else {
// If we don't recognize that the token, we should just return 'false'
// If we don't recognize the token, we should just return 'false'
// without throwing.
return NS_OK;
return false;
}
}
switch (GetLockOrientationPermission()) {
case LOCK_DENIED:
return NS_OK;
return false;
case LOCK_ALLOWED:
*aReturn = hal::LockScreenOrientation(orientation);
return NS_OK;
case FULLSCREEN_LOCK_ALLOWED:
*aReturn = hal::LockScreenOrientation(orientation);
if (!*aReturn) {
return NS_OK;
return hal::LockScreenOrientation(orientation);
case FULLSCREEN_LOCK_ALLOWED: {
if (!hal::LockScreenOrientation(orientation)) {
return false;
}
// We are fullscreen and lock has been accepted.
@ -427,30 +387,46 @@ nsScreen::MozLockOrientation(const jsval& aOrientation, JSContext* aCx, bool* aR
// full-screen and when we will have to unlock the screen.
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
if (!target) {
return NS_OK;
// XXX: Bug 796873
return true;
}
if (!mEventListener) {
mEventListener = new FullScreenEventListener();
}
return target->AddSystemEventListener(NS_LITERAL_STRING("mozfullscreenchange"),
mEventListener, /* useCapture = */ true);
aRv = target->AddSystemEventListener(NS_LITERAL_STRING("mozfullscreenchange"),
mEventListener, /* useCapture = */ true);
return true;
}
}
// This is only for compilers that don't understand that the previous switch
// will always return.
MOZ_NOT_REACHED();
return NS_OK;
return false;
}
NS_IMETHODIMP
void
nsScreen::MozUnlockOrientation()
{
hal::UnlockScreenOrientation();
}
NS_IMETHODIMP
nsScreen::SlowMozUnlockOrientation()
{
MozUnlockOrientation();
return NS_OK;
}
/* virtual */
JSObject*
nsScreen::WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
{
return ScreenBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
NS_IMPL_ISUPPORTS1(nsScreen::FullScreenEventListener, nsIDOMEventListener)
NS_IMETHODIMP

View File

@ -5,36 +5,127 @@
#ifndef nsScreen_h___
#define nsScreen_h___
#include "mozilla/Attributes.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/Hal.h"
#include "nsIDOMScreen.h"
#include "nsISupports.h"
#include "nsIScriptContext.h"
#include "nsCOMPtr.h"
#include "nsDOMEventTargetHelper.h"
#include "mozilla/Attributes.h"
#include "nsRect.h"
class nsIDocShell;
class nsDeviceContext;
struct nsRect;
// Script "screen" object
class nsScreen : public nsDOMEventTargetHelper
, public nsIDOMScreen
, public mozilla::hal::ScreenConfigurationObserver
{
typedef mozilla::ErrorResult ErrorResult;
public:
static already_AddRefed<nsScreen> Create(nsPIDOMWindow* aWindow);
void Reset();
NS_DECL_ISUPPORTS
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSCREEN
NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
nsPIDOMWindow* GetParentObject() const
{
return GetOwner();
}
int32_t GetTop(ErrorResult& aRv)
{
nsRect rect;
aRv = GetRect(rect);
return rect.y;
}
int32_t GetLeft(ErrorResult& aRv)
{
nsRect rect;
aRv = GetRect(rect);
return rect.x;
}
int32_t GetWidth(ErrorResult& aRv)
{
nsRect rect;
aRv = GetRect(rect);
return rect.width;
}
int32_t GetHeight(ErrorResult& aRv)
{
nsRect rect;
aRv = GetRect(rect);
return rect.height;
}
int32_t GetPixelDepth(ErrorResult& aRv);
int32_t GetColorDepth(ErrorResult& aRv)
{
return GetPixelDepth(aRv);
}
int32_t GetAvailTop(ErrorResult& aRv)
{
nsRect rect;
aRv = GetAvailRect(rect);
return rect.y;
}
int32_t GetAvailLeft(ErrorResult& aRv)
{
nsRect rect;
aRv = GetAvailRect(rect);
return rect.x;
}
int32_t GetAvailWidth(ErrorResult& aRv)
{
nsRect rect;
aRv = GetAvailRect(rect);
return rect.width;
}
int32_t GetAvailHeight(ErrorResult& aRv)
{
nsRect rect;
aRv = GetAvailRect(rect);
return rect.height;
}
void GetMozOrientation(nsString& aOrientation);
JSObject* GetOnmozorientationchange(JSContext* aCx)
{
JS::Value val;
nsresult rv = GetOnmozorientationchange(aCx, &val);
return NS_SUCCEEDED(rv) ? val.toObjectOrNull() : nullptr;
}
void SetOnmozorientationchange(JSContext* aCx, JSObject* aCallback,
ErrorResult& aRv)
{
aRv = SetOnmozorientationchange(aCx, JS::ObjectOrNullValue(aCallback));
}
bool MozLockOrientation(const nsAString& aOrientation, ErrorResult& aRv);
bool MozLockOrientation(const mozilla::dom::Sequence<nsString>& aOrientations, ErrorResult& aRv);
void MozUnlockOrientation();
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsScreen,
nsDOMEventTargetHelper)
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap);
void Notify(const mozilla::hal::ScreenConfiguration& aConfiguration);
protected:

View File

@ -55,70 +55,29 @@ try {
ok(!window.screen.mozLockOrientation([""]), "Cannot lock to an empty string");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
var exception = false;
try {
ok(!window.screen.mozLockOrientation(42), "Cannot lock to a number");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
ok(!window.screen.mozLockOrientation(42), "Cannot lock to a number");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
exception = false;
try {
ok(!window.screen.mozLockOrientation(undefined), "Cannot lock to undefined");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
ok(!window.screen.mozLockOrientation(undefined), "Cannot lock to undefined");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
exception = false;
try {
ok(!window.screen.mozLockOrientation(null), "Cannot lock to null");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
ok(!window.screen.mozLockOrientation(null), "Cannot lock to null");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
exception = false;
try {
ok(!window.screen.mozLockOrientation({}), "Cannot lock to a non-Array object");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
ok(!window.screen.mozLockOrientation({}), "Cannot lock to a non-Array object");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
exception = false;
try {
ok(!window.screen.mozLockOrientation(["Foobar", 42]), "Cannot lock to a number");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
ok(!window.screen.mozLockOrientation(["Foobar", 42]), "Cannot lock to a number");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
exception = false;
try {
ok(!window.screen.mozLockOrientation(["Foobar", null]), "Cannot lock to null");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
ok(!window.screen.mozLockOrientation(["Foobar", null]), "Cannot lock to null");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
exception = false;
try {
ok(!window.screen.mozLockOrientation(["Foobar", undefined]), "Cannot lock to undefined");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch(e) {
exception = true;
}
is(exception, true, "We should get an exception");
}
finally {
ok(!window.screen.mozLockOrientation(["Foobar", undefined]), "Cannot lock to undefined");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
} catch (e) {
ok(false, "Got unexpected exception: " + e);
} finally {
window.screen.removeEventListener("mozorientationchange", unexpectedEvent);
}
</script>

View File

@ -301,6 +301,11 @@ DOMInterfaces = {
'resultNotAddRefed': [ 'item' ]
}],
'Screen': {
'nativeType': 'nsScreen',
'prefable': True,
},
'SVGLengthList': [
{
'nativeType': 'mozilla::DOMSVGLengthList',

View File

@ -48,17 +48,6 @@ struct SetListBaseInformation
SetListBaseInformation gSetListBaseInformation;
bool
DefineConstructor(JSContext* cx, JSObject* obj, DefineInterface aDefine, nsresult* aResult)
{
bool enabled;
bool defined = aDefine(cx, obj, &enabled);
MOZ_ASSERT(!defined || enabled,
"We defined a constructor but the new bindings are disabled?");
*aResult = defined ? NS_OK : NS_ERROR_FAILURE;
return enabled;
}
// static
JSObject*
DOMProxyHandler::EnsureExpandoObject(JSContext* cx, JSObject* obj)

View File

@ -14,6 +14,7 @@ FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
# Need this to find all our DOM source files.
include $(topsrcdir)/dom/dom-config.mk
@ -73,7 +74,9 @@ LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
-I$(topsrcdir)/js/xpconnect/wrappers \
-I$(topsrcdir)/content/canvas/src \
-I$(topsrcdir)/content/html/content/src \
-I$(topsrcdir)/media/webrtc/signaling/src/peerconnection
-I$(topsrcdir)/media/webrtc/signaling/src/peerconnection \
-I$(topsrcdir)/dom/base \
$(NULL)
include $(topsrcdir)/config/rules.mk

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,20 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
test_addRange.html.json \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_Document-open.html.json \
test_addRange.html.json \
test_getSelection.html.json \
test_interfaces.html.json \
$(NULL)

View File

@ -2,6 +2,12 @@
"Selection interface: existence and properties of interface object":true,
"Selection interface: existence and properties of interface prototype object":true,
"Selection interface: existence and properties of interface prototype object's \"constructor\" property":true,
"Selection interface: attribute anchorNode":true,
"Selection interface: attribute anchorOffset":true,
"Selection interface: attribute focusNode":true,
"Selection interface: attribute focusOffset":true,
"Selection interface: attribute isCollapsed":true,
"Selection interface: attribute rangeCount":true,
"Selection interface: calling collapse(Node,unsigned long) on getSelection() with too few arguments must throw TypeError":true,
"Selection interface: calling extend(Node,unsigned long) on getSelection() with too few arguments must throw TypeError":true,
"Selection interface: calling selectAllChildren(Node) on getSelection() with too few arguments must throw TypeError":true,

View File

@ -1,16 +1,18 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_001.html.json \
$(NULL)

View File

@ -3,4 +3,3 @@
"itemValue must reflect the textContent of time elements with no datetime attribute": true,
"itemValue must reflect the datetime attribute of time elements with a datetime attribute": true
}

View File

@ -1,16 +1,18 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_Range-cloneContents.html.json \
test_Range-cloneRange.html.json \
test_Range-collapse.html.json \

View File

@ -1,3 +1,3 @@
{
"Range 45 \"detached\"": true
"Range 45 \"detached\"": true
}

View File

@ -1,4 +1,4 @@
{
"Range 45 \"detached\", toStart true": true,
"Range 45 \"detached\", toStart true": true,
"Range 45 \"detached\", toStart false": true
}

View File

@ -44,6 +44,7 @@
"Event interface: attribute bubbles": true,
"Event interface: attribute cancelable": true,
"Event interface: attribute defaultPrevented": true,
"Event interface: attribute isTrusted": true,
"Event interface: attribute timeStamp": true,
"Stringification of document.createEvent(\"Event\")": "debug",
"Event interface: document.createEvent(\"Event\") must inherit property \"timeStamp\" with the proper type (14)": true,
@ -55,10 +56,12 @@
"CustomEvent interface constructor": true,
"CustomEvent interface: existence and properties of interface prototype object": true,
"CustomEvent interface: existence and properties of interface prototype object's \"constructor\" property": true,
"CustomEvent interface: attribute detail": true,
"Stringification of new CustomEvent(\"foo\")": "debug",
"Event interface: new CustomEvent(\"foo\") must inherit property \"timeStamp\" with the proper type (14)": true,
"Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent(\"foo\") with too few arguments must throw TypeError": true,
"EventTarget interface: operation addEventListener(DOMString,EventListener,boolean)": true,
"EventTarget interface: operation removeEventListener(DOMString,EventListener,boolean)": true,
"EventListener interface: existence and properties of interface object": true,
"EventListener interface: existence and properties of interface prototype object": true,
"EventListener interface: existence and properties of interface prototype object's \"constructor\" property": true,
@ -216,6 +219,9 @@
"DocumentType interface: existence and properties of interface object": true,
"DocumentType interface: existence and properties of interface prototype object": true,
"DocumentType interface: existence and properties of interface prototype object's \"constructor\" property": true,
"DocumentType interface: attribute name": true,
"DocumentType interface: attribute publicId": true,
"DocumentType interface: attribute systemId": true,
"DocumentType interface: operation remove()": true,
"Stringification of document.doctype": "debug",
"DocumentType interface: document.doctype must inherit property \"remove\" with the proper type (3)": true,
@ -281,6 +287,7 @@
"Attr interface: existence and properties of interface object": true,
"Attr interface: existence and properties of interface prototype object": true,
"Attr interface: existence and properties of interface prototype object's \"constructor\" property": true,
"Attr interface: attribute name": true,
"Attr interface: attribute value": true,
"Attr interface: attribute namespaceURI": true,
"Attr interface: attribute prefix": true,
@ -300,6 +307,7 @@
"Text interface: existence and properties of interface object": true,
"Text interface: existence and properties of interface prototype object": true,
"Text interface: existence and properties of interface prototype object's \"constructor\" property": true,
"Text interface: attribute wholeText": true,
"Stringification of document.createTextNode(\"abc\")": "debug",
"Text interface: calling splitText(unsigned long) on document.createTextNode(\"abc\") with too few arguments must throw TypeError": true,
"CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createTextNode(\"abc\") with too few arguments must throw TypeError": true,
@ -324,6 +332,7 @@
"ProcessingInstruction interface: existence and properties of interface object": true,
"ProcessingInstruction interface: existence and properties of interface prototype object": true,
"ProcessingInstruction interface: existence and properties of interface prototype object's \"constructor\" property": true,
"ProcessingInstruction interface: attribute target": true,
"Stringification of xmlDoc.createProcessingInstruction(\"abc\", \"def\")": "debug",
"CharacterData interface: calling substringData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction(\"abc\", \"def\") with too few arguments must throw TypeError": true,
"CharacterData interface: calling appendData(DOMString) on xmlDoc.createProcessingInstruction(\"abc\", \"def\") with too few arguments must throw TypeError": true,
@ -409,10 +418,18 @@
"NodeIterator interface: existence and properties of interface object": true,
"NodeIterator interface: existence and properties of interface prototype object": true,
"NodeIterator interface: existence and properties of interface prototype object's \"constructor\" property": true,
"NodeIterator interface: attribute root": true,
"NodeIterator interface: attribute referenceNode": true,
"NodeIterator interface: attribute pointerBeforeReferenceNode": true,
"NodeIterator interface: attribute whatToShow": true,
"NodeIterator interface: attribute filter": true,
"Stringification of document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false)": "debug",
"TreeWalker interface: existence and properties of interface object": true,
"TreeWalker interface: existence and properties of interface prototype object": true,
"TreeWalker interface: existence and properties of interface prototype object's \"constructor\" property": true,
"TreeWalker interface: attribute root": true,
"TreeWalker interface: attribute whatToShow": true,
"TreeWalker interface: attribute filter": true,
"TreeWalker interface: attribute currentNode": true,
"Stringification of document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false)": "debug",
"NodeFilter interface: existence and properties of interface object": true,
@ -435,9 +452,13 @@
"NodeFilter interface: constant SHOW_DOCUMENT_FRAGMENT on interface prototype object": true,
"NodeFilter interface: constant SHOW_NOTATION on interface prototype object": true,
"NodeFilter interface: operation acceptNode(Node)": true,
"NodeList interface: attribute length": true,
"HTMLCollection interface: attribute length": true,
"DOMStringList interface: existence and properties of interface object": true,
"DOMStringList interface: existence and properties of interface prototype object": true,
"DOMStringList interface: existence and properties of interface prototype object's \"constructor\" property": true,
"DOMStringList interface: attribute length": true,
"Stringification of document.body.classList": true
"DOMTokenList interface: attribute length": true,
"Stringification of document.body.classList": true,
"DOMSettableTokenList interface: attribute value": true
}

View File

@ -1,4 +1,4 @@
{
"Constants for createDocumentPosition on Node prototype object.": true,
"Constants for nodeType on Node prototype object.": true
"Constants for nodeType on Node prototype object.": true,
"Constants for createDocumentPosition on Node prototype object.": true
}

View File

@ -1,7 +1,7 @@
{
"Calling insertBefore with a non-Node first argument must throw TypeError.": true,
"Calling insertBefore with a non-Node first argument on a leaf node Comment node <!--Foo--> must throw TypeError.": true,
"Calling insertBefore with a non-Node first argument on a leaf node DocumentType node must throw TypeError.": true,
"Calling insertBefore with a non-Node first argument on a leaf node ProcessingInstruction node with target \"foo\" and data \"bar\" must throw TypeError.": true,
"Calling insertBefore with a non-Node first argument on a leaf node Text node \"Foo\" must throw TypeError.": true
"Calling insertBefore with a non-Node first argument on a leaf node Text node \"Foo\" must throw TypeError.": true,
"Calling insertBefore with a non-Node first argument on a leaf node Comment node <!--Foo--> must throw TypeError.": true,
"Calling insertBefore with a non-Node first argument on a leaf node ProcessingInstruction node with target \"foo\" and data \"bar\" must throw TypeError.": true
}

View File

@ -1,4 +1,4 @@
{
"If the context node is not a node that can contain children, a NotFoundError exception should be thrown": true,
"Passing null to replaceChild should throw a TypeError.": true
"Passing null to replaceChild should throw a TypeError.": true,
"If the context node is not a node that can contain children, a NotFoundError exception should be thrown": true
}

View File

@ -1,6 +1,6 @@
{
"AttrExodus": true,
"setAttribute should throw a NAMESPACE_ERR when qualifiedName starts with 'xmlns'": true,
"First set attribute is returned by setAttribute": true,
"First set attribute is returned with mapped attribute set first": true,
"setAttribute should throw a NAMESPACE_ERR when qualifiedName starts with 'xmlns'": true
"First set attribute is returned with mapped attribute set first": true
}

View File

@ -1,7 +1,7 @@
{
"getElementsByTagName ABC": true,
"getElementsByTagName Abc": true,
"getElementsByTagName abc": true,
"getElementsByTagName \u00c4": true,
"getElementsByTagName \u00e4": true
"getElementsByTagName Abc": true,
"getElementsByTagName ABC": true,
"getElementsByTagName \u00e4": true,
"getElementsByTagName \u00c4": true
}

View File

@ -1,18 +1,18 @@
{
"DocumentType member must be nuked: internalSubset": true,
"Historical DOM features must be removed: CDATASection": true,
"Historical DOM features must be removed: NamedNodeMap": true,
"Historical DOM features must be removed: UserDataHandler": true,
"Historical DOM features must be removed: createCDATASection": true,
"Historical DOM features must be removed: createAttribute": true,
"Historical DOM features must be removed: createAttributeNS": true,
"Historical DOM features must be removed: createCDATASection": true,
"Historical DOM features must be removed: inputEncoding": true,
"Historical DOM features must be removed: getAttributeNode": true,
"Historical DOM features must be removed: getAttributeNodeNS": true,
"Historical DOM features must be removed: inputEncoding": true,
"Historical DOM features must be removed: removeAttributeNode": true,
"Historical DOM features must be removed: setAttributeNode": true,
"Node member must be nuked: getUserData": true,
"Historical DOM features must be removed: removeAttributeNode": true,
"DocumentType member must be nuked: internalSubset": true,
"Node member must be nuked: hasAttributes": true,
"Node member must be nuked: isSupported": true,
"Node member must be nuked: getUserData": true,
"Node member must be nuked: setUserData": true
}

View File

@ -1,6 +1,6 @@
{
"Should be able to delete CharacterData.": true,
"Should be able to delete Document.": true,
"Should be able to delete Node.": true,
"Should be able to delete Document.": true,
"Should be able to delete CharacterData.": true,
"Should be able to delete NodeFilter.": true
}

View File

@ -1,16 +1,18 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_getElementsByClassName-10.xml.json \
test_getElementsByClassName-11.xml.json \
$(NULL)

View File

@ -1,16 +1,18 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_storage_local_security.html.json \
$(NULL)

View File

@ -1,16 +1,18 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_missing_arguments.html.json \
test_storage_local_in_js.html.json \
test_storage_local_removeitem_js.html.json \

View File

@ -1,16 +1,18 @@
DEPTH = @DEPTH@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DEPTH := @DEPTH@
DIRS = \
$(NULL)
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_interfaces.html.json \
$(NULL)

View File

@ -1,10 +1,21 @@
{
"XMLHttpRequest interface constructor": true,
"XMLHttpRequest interface: attribute onreadystatechange": true,
"XMLHttpRequest interface: attribute readyState": true,
"XMLHttpRequest interface: operation open(DOMString,DOMString,boolean,DOMString,DOMString)": true,
"XMLHttpRequest interface: attribute timeout": true,
"XMLHttpRequest interface: attribute withCredentials": true,
"XMLHttpRequest interface: attribute upload": true,
"XMLHttpRequest interface: operation send(union)": true,
"XMLHttpRequest interface: attribute status": true,
"XMLHttpRequest interface: attribute statusText": true,
"XMLHttpRequest interface: attribute response": true,
"XMLHttpRequest interface: attribute responseText": true,
"XMLHttpRequest interface: attribute responseXML": true,
"FormData interface: existence and properties of interface object": true,
"FormData interface constructor": true,
"FormData interface: existence and properties of interface prototype object": true,
"FormData interface: existence and properties of interface prototype object's \"constructor\" property": true,
"FormData interface: operation append(DOMString,Blob,DOMString)": true,
"Stringification of new FormData()": "debug",
"FormData interface: calling append(DOMString,Blob,DOMString) on new FormData() with too few arguments must throw TypeError": true,
"FormData interface: calling append(DOMString,DOMString) on new FormData() with too few arguments must throw TypeError": true,

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@ def dumpFailures(lines):
continue
# Avoid overly large diffs.
if '/editing/' in url:
if 'editing/' in url:
sep = ':'
else:
sep = ': '

View File

@ -261,6 +261,10 @@ policies and contribution forms [3].
* assert_regexp_match(actual, expected, description)
* asserts that /actual/ matches the regexp /expected/
*
* assert_class_string(object, class_name, description)
* asserts that the class string of /object/ as returned in
* Object.prototype.toString is equal to /class_name/.
*
* assert_own_property(object, property_name, description)
* assert that object has own property property_name
*
@ -629,7 +633,7 @@ policies and contribution forms [3].
function assert_object_equals(actual, expected, description)
{
//This needs to be improved a great deal
function check_equal(expected, actual, stack)
function check_equal(actual, expected, stack)
{
stack.push(actual);
@ -715,6 +719,12 @@ policies and contribution forms [3].
}
expose(assert_regexp_match, "assert_regexp_match");
function assert_class_string(object, class_string, description) {
assert_equals({}.toString.call(object), "[object " + class_string + "]",
description);
}
expose(assert_class_string, "assert_class_string");
function _assert_own_property(name) {
return function(object, property_name, description)
@ -1291,6 +1301,16 @@ policies and contribution forms [3].
return;
}
this.phase = this.phases.COMPLETE;
var this_obj = this;
this.tests.forEach(
function(x)
{
if(x.status === x.NOTRUN)
{
this_obj.notify_result(x);
}
}
);
this.notify_complete();
};
@ -1400,11 +1420,22 @@ policies and contribution forms [3].
Output.prototype.resolve_log = function()
{
if (!this.output_document) {
var output_document;
if (typeof this.output_document === "function")
{
output_document = this.output_document.apply(undefined);
} else
{
output_document = this.output_document;
}
if (!output_document)
{
return;
}
var node = this.output_document.getElementById("log");
if (node) {
var node = output_document.getElementById("log");
if (node)
{
this.output_document = output_document;
this.output_node = node;
}
};
@ -1533,7 +1564,7 @@ policies and contribution forms [3].
if (!style_element && !input_element.checked) {
style_element = output_document.createElementNS(xhtml_ns, "style");
style_element.id = "hide-" + result_class;
style_element.innerHTML = "table#results > tbody > tr."+result_class+"{display:none}";
style_element.textContent = "table#results > tbody > tr."+result_class+"{display:none}";
output_document.body.appendChild(style_element);
} else if (style_element && input_element.checked) {
style_element.parentNode.removeChild(style_element);
@ -1593,7 +1624,15 @@ policies and contribution forms [3].
+ escape_html(tests[i].message ? tests[i].message : " ")
+ "</td></tr>";
}
log.lastChild.innerHTML = html + "</tbody></table>";
html += "</tbody></table>";
try {
log.lastChild.innerHTML = html;
} catch (e) {
log.appendChild(document.createElementNS(xhtml_ns, "p"))
.textContent = "Setting innerHTML for the log threw an exception.";
log.appendChild(document.createElementNS(xhtml_ns, "pre"))
.textContent = html;
}
};
var output = new Output();

View File

@ -6,6 +6,13 @@
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>
<script type=text/plain class=untested>
interface EventTarget {
void addEventListener(DOMString type, EventListener? callback, optional boolean capture /* = false */);
void removeEventListener(DOMString type, EventListener? callback, optional boolean capture /* = false */);
boolean dispatchEvent(Event event);
};
</script>
<script type=text/plain>
[NoInterfaceObject]
interface XMLHttpRequestEventTarget : EventTarget {
@ -79,11 +86,17 @@ interface FormData {
"use strict";
var form = document.createElement("form");
var idlArray = new IdlArray();
idlArray.add_idls(document.querySelector("script[type=text\\/plain]").textContent);
[].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) {
if (node.className == "untested") {
idlArray.add_untested_idls(node.textContent);
} else {
idlArray.add_idls(node.textContent);
}
});
idlArray.add_objects({
XMLHttpRequest: ['new XMLHttpRequest()'],
XMLHttpRequestUpload: ['(new XMLHttpRequest()).upload'],
FormData: ['new FormData()', 'new FormData(form)']
XMLHttpRequest: ['new XMLHttpRequest()'],
XMLHttpRequestUpload: ['(new XMLHttpRequest()).upload'],
FormData: ['new FormData()', 'new FormData(form)']
});
idlArray.test();
</script>

View File

@ -24,6 +24,7 @@ interface nsIDOMScreen : nsIDOMEventTarget
* Can be: landscape-primary, landscape-secondary,
* portrait-primary or portrait-secondary.
*/
[binaryname(SlowMozOrientation)]
readonly attribute DOMString mozOrientation;
[implicit_jscontext] attribute jsval onmozorientationchange;
@ -57,5 +58,6 @@ interface nsIDOMScreen : nsIDOMEventTarget
/**
* Unlock the screen orientation.
*/
[binaryname(SlowMozUnlockOrientation)]
void mozUnlockOrientation();
};

52
dom/webidl/Screen.webidl Normal file
View File

@ -0,0 +1,52 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
interface Screen : EventTarget {
// CSSOM-View
// http://dev.w3.org/csswg/cssom-view/#the-screen-interface
[Throws]
readonly attribute long availWidth;
[Throws]
readonly attribute long availHeight;
[Throws]
readonly attribute long width;
[Throws]
readonly attribute long height;
[Throws]
readonly attribute long colorDepth;
[Throws]
readonly attribute long pixelDepth;
[Throws]
readonly attribute long top;
[Throws]
readonly attribute long left;
[Throws]
readonly attribute long availTop;
[Throws]
readonly attribute long availLeft;
/**
* Returns the current screen orientation.
* Can be: landscape-primary, landscape-secondary,
* portrait-primary or portrait-secondary.
*/
readonly attribute DOMString mozOrientation;
[SetterThrows]
attribute EventHandler onmozorientationchange;
/**
* Lock screen orientation to the specified type.
*/
[Throws]
boolean mozLockOrientation(DOMString orientation);
[Throws]
boolean mozLockOrientation(sequence<DOMString> orientation);
/**
* Unlock the screen orientation.
*/
void mozUnlockOrientation();
};

View File

@ -35,6 +35,7 @@ webidl_files = \
Performance.webidl \
PerformanceNavigation.webidl \
PerformanceTiming.webidl \
Screen.webidl \
SVGLengthList.webidl \
SVGNumberList.webidl \
SVGPathSegList.webidl \

0
js/src/tests/jstests.py Executable file → Normal file
View File

View File

@ -4,6 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/Services.jsm");
var dialog; // Quick access to document/form elements.
var gFindInst; // nsIWebBrowserFind that we're going to use
var gFindInstData; // use this to update the find inst data
@ -112,7 +114,8 @@ function onAccept()
{
if (!dialog.bundle)
dialog.bundle = document.getElementById("findBundle");
window.alert(dialog.bundle.getString("notFoundWarning"));
Services.prompt.alert(window, dialog.bundle.getString("notFoundTitle"),
dialog.bundle.getString("notFoundWarning"));
dialog.findKey.select();
dialog.findKey.focus();
}