Merge m-c to s-c.

This commit is contained in:
Richard Newman 2013-02-07 09:13:40 -08:00
commit 8620cbdb2a
216 changed files with 19541 additions and 3541 deletions

View File

@ -95,9 +95,6 @@ let gDataNotificationInfoBar = {
}.bind(this)
);
// Keep open until user closes it.
notification.persistence = -1;
// Tell the notification request we have displayed the notification.
request.onUserNotifyComplete();
},

View File

@ -98,3 +98,21 @@ richlistitem[type="download"]:not([selected]) button {
{
display: none;
}
/* Hacks for toolbar full and text modes, until bug 573329 removes them */
toolbar[mode="text"] > #downloads-indicator {
display: -moz-box;
-moz-box-orient: vertical;
-moz-box-pack: center;
}
toolbar[mode="text"] > #downloads-indicator > .toolbarbutton-text {
-moz-box-ordinal-group: 1;
}
toolbar[mode="text"] > #downloads-indicator > .toolbarbutton-icon {
display: -moz-box;
-moz-box-ordinal-group: 2;
visibility: collapse;
}

View File

@ -53,6 +53,8 @@
<vbox id="downloads-indicator-icon"/>
<vbox id="downloads-indicator-notification"/>
</stack>
<label class="toolbarbutton-text" crop="right" flex="1"
value="&downloads.label;"/>
</toolbarbutton>
</popupset>
</overlay>

View File

@ -355,3 +355,8 @@ toolbar[iconsize="large"] > #downloads-indicator[attention] > #downloads-indicat
#downloads-indicator[paused] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-progress > .progress-remainder {
background-image: linear-gradient(#4b5000, #515700);
}
toolbar[mode="full"] > #downloads-indicator > .toolbarbutton-text {
margin: 0;
text-align: center;
}

View File

@ -528,3 +528,10 @@ richlistitem[type="download"]:hover > stack > .downloadButton.downloadRetry:acti
#downloads-indicator[paused] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-progress > .progress-remainder {
background-image: linear-gradient(#4b5000, #515700);
}
toolbar[mode="full"] > #downloads-indicator > .toolbarbutton-text {
margin: 2px 0 0;
padding: 0;
text-align: center;
vertical-align: middle;
}

View File

@ -379,3 +379,8 @@ richlistitem[type="download"]:hover > stack > .downloadButton.downloadRetry:acti
#downloads-indicator[paused] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-progress > .progress-remainder {
background-image: linear-gradient(#4b5000, #515700);
}
toolbar[mode="full"] > #downloads-indicator > .toolbarbutton-text {
margin: 0;
text-align: center;
}

View File

@ -2177,6 +2177,11 @@ ia64*-hpux*)
dnl Probably also a compiler bug, but what can you do?
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
LDFLAGS="$LDFLAGS -DYNAMICBASE"
if test "$_MSC_VER" -ge 1500; then
dnl VS2008 or later supports SSSE3
HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
fi
fi
AC_DEFINE(HAVE_SNPRINTF)
AC_DEFINE(_WINDOWS)

View File

@ -2399,7 +2399,8 @@ struct NS_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcesso
gfxRect glyphRect(xpos, baselineOrigin.y - height,
advance, height);
gfxFontMissingGlyphs::DrawMissingGlyph(thebes, glyphRect,
detailedGlyphs[0].mGlyphID);
detailedGlyphs[0].mGlyphID,
nsDeviceContext::AppUnitsPerCSSPixel());
mCtx->mTarget->SetTransform(matrix);
}

View File

@ -905,7 +905,7 @@ nsEventDispatcher::CreateEvent(nsPresContext* aPresContext,
if (aEventType.LowerCaseEqualsLiteral("customevent"))
return NS_NewDOMCustomEvent(aDOMEvent, aPresContext, nullptr);
if (aEventType.LowerCaseEqualsLiteral("mozsmsevent"))
return NS_NewDOMSmsEvent(aDOMEvent, aPresContext, nullptr);
return NS_NewDOMMozSmsEvent(aDOMEvent, aPresContext, nullptr);
if (aEventType.LowerCaseEqualsLiteral("storageevent")) {
return NS_NewDOMStorageEvent(aDOMEvent, aPresContext, nullptr);
}

View File

@ -34,3 +34,6 @@ skip-if(Android||B2G) == 649134-2.html 649134-2-ref.html
== hidden-2.svg hidden-2-ref.svg
== href-attr-change-restyles.html href-attr-change-restyles-ref.html
== figure.html figure-ref.html
== table-border-1.html table-border-1-ref.html
== table-border-2.html table-border-2-ref.html
!= table-border-2.html table-border-2-notref.html

View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Table borders</title>
<style>
table {
border-width: 1px;
border-style: outset;
}
td {
border-width: 1px;
border-style: inset;
}
</style>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Table borders</title>
<table border>
<tr><td>Test
</table>
<table border="">
<tr><td>Test
</table>
<table border=null>
<tr><td>Test
</table>
<table border=undefined>
<tr><td>Test
</table>
<table border=foo>
<tr><td>Test
</table>
<table border=1>
<tr><td>Test
</table>
<table border=1foo>
<tr><td>Test
</table>
<table border=1%>
<tr><td>Test
</table>
<table border=-1>
<tr><td>Test
</table>
<table border=-1foo>
<tr><td>Test
</table>
<table border=-1%>
<tr><td>Test
</table>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Table borders</title>
<style>
table {
border-width: 1px;
border-style: outset;
}
td {
border-width: 1px;
border-style: inset;
}
</style>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Table borders</title>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>
<table>
<tr><td>Test
</table>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Table borders</title>
<table border=0>
<tr><td>Test
</table>
<table border=0foo>
<tr><td>Test
</table>
<table border=0%>
<tr><td>Test
</table>
<table border=+0>
<tr><td>Test
</table>
<table border=+0foo>
<tr><td>Test
</table>
<table border=+0%>
<tr><td>Test
</table>
<table border=-0>
<tr><td>Test
</table>
<table border=-0foo>
<tr><td>Test
</table>
<table border=-0%>
<tr><td>Test
</table>

View File

@ -0,0 +1,79 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "mozilla/dom/HTMLMapElement.h"
#include "mozilla/dom/HTMLMapElementBinding.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsContentList.h"
#include "nsCOMPtr.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
DOMCI_NODE_DATA(HTMLMapElement, mozilla::dom::HTMLMapElement)
namespace mozilla {
namespace dom {
HTMLMapElement::HTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMapElement,
nsGenericHTMLElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAreas)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(HTMLMapElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLMapElement, Element)
// QueryInterface implementation for HTMLMapElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLMapElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLMapElement, nsIDOMHTMLMapElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLMapElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMapElement)
NS_IMPL_ELEMENT_CLONE(HTMLMapElement)
nsIHTMLCollection*
HTMLMapElement::Areas()
{
if (!mAreas) {
// Not using NS_GetContentList because this should not be cached
mAreas = new nsContentList(this,
kNameSpaceID_XHTML,
nsGkAtoms::area,
nsGkAtoms::area,
false);
}
return mAreas;
}
NS_IMETHODIMP
HTMLMapElement::GetAreas(nsIDOMHTMLCollection** aAreas)
{
NS_ENSURE_ARG_POINTER(aAreas);
NS_ADDREF(*aAreas = Areas());
return NS_OK;
}
NS_IMPL_STRING_ATTR(HTMLMapElement, Name, name)
JSObject*
HTMLMapElement::WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
{
return HTMLMapElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_dom_HTMLMapElement_h
#define mozilla_dom_HTMLMapElement_h
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLMapElement.h"
#include "nsAutoPtr.h"
#include "nsGkAtoms.h"
class nsContentList;
namespace mozilla {
namespace dom {
class HTMLMapElement : public nsGenericHTMLElement,
public nsIDOMHTMLMapElement
{
public:
HTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLMapElement
NS_DECL_NSIDOMHTMLMAPELEMENT
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLMapElement,
nsGenericHTMLElement)
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
// XPCOM GetName is fine.
void SetName(const nsAString& aName, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::name, aName, aError);
}
nsIHTMLCollection* Areas();
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
protected:
nsRefPtr<nsContentList> mAreas;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLMapElement_h

View File

@ -0,0 +1,110 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "mozilla/dom/HTMLMetaElement.h"
#include "mozilla/dom/HTMLMetaElementBinding.h"
#include "nsStyleConsts.h"
#include "nsAsyncDOMEvent.h"
#include "nsContentUtils.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Meta)
DOMCI_NODE_DATA(HTMLMetaElement, mozilla::dom::HTMLMetaElement)
namespace mozilla {
namespace dom {
HTMLMetaElement::HTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
HTMLMetaElement::~HTMLMetaElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLMetaElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLMetaElement, Element)
// QueryInterface implementation for HTMLMetaElement
NS_INTERFACE_TABLE_HEAD(HTMLMetaElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLMetaElement, nsIDOMHTMLMetaElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLMetaElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMetaElement)
NS_IMPL_ELEMENT_CLONE(HTMLMetaElement)
NS_IMPL_STRING_ATTR(HTMLMetaElement, Content, content)
NS_IMPL_STRING_ATTR(HTMLMetaElement, HttpEquiv, httpEquiv)
NS_IMPL_STRING_ATTR(HTMLMetaElement, Name, name)
NS_IMPL_STRING_ATTR(HTMLMetaElement, Scheme, scheme)
void
HTMLMetaElement::GetItemValueText(nsAString& aValue)
{
GetContent(aValue);
}
void
HTMLMetaElement::SetItemValueText(const nsAString& aValue)
{
SetContent(aValue);
}
nsresult
HTMLMetaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument &&
AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, nsGkAtoms::viewport, eIgnoreCase)) {
nsAutoString content;
rv = GetContent(content);
NS_ENSURE_SUCCESS(rv, rv);
nsContentUtils::ProcessViewportInfo(aDocument, content);
}
CreateAndDispatchEvent(aDocument, NS_LITERAL_STRING("DOMMetaAdded"));
return rv;
}
void
HTMLMetaElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
nsCOMPtr<nsIDocument> oldDoc = GetCurrentDoc();
CreateAndDispatchEvent(oldDoc, NS_LITERAL_STRING("DOMMetaRemoved"));
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
void
HTMLMetaElement::CreateAndDispatchEvent(nsIDocument* aDoc,
const nsAString& aEventName)
{
if (!aDoc)
return;
nsRefPtr<nsAsyncDOMEvent> event = new nsAsyncDOMEvent(this, aEventName, true,
true);
event->PostDOMEvent();
}
JSObject*
HTMLMetaElement::WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
{
return HTMLMetaElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,82 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_dom_HTMLMetaElement_h
#define mozilla_dom_HTMLMetaElement_h
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLMetaElement.h"
namespace mozilla {
namespace dom {
class HTMLMetaElement : public nsGenericHTMLElement,
public nsIDOMHTMLMetaElement
{
public:
HTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~HTMLMetaElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLMetaElement
NS_DECL_NSIDOMHTMLMETAELEMENT
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers);
virtual void UnbindFromTree(bool aDeep = true,
bool aNullParent = true);
void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName);
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
// XPCOM GetName is fine.
void SetName(const nsAString& aName, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::name, aName, aRv);
}
// XPCOM GetHttpEquiv is fine.
void SetHttpEquiv(const nsAString& aHttpEquiv, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::httpEquiv, aHttpEquiv, aRv);
}
// XPCOM GetContent is fine.
void SetContent(const nsAString& aContent, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::content, aContent, aRv);
}
// XPCOM GetScheme is fine.
void SetScheme(const nsAString& aScheme, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::scheme, aScheme, aRv);
}
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
protected:
virtual void GetItemValueText(nsAString& text);
virtual void SetItemValueText(const nsAString& text);
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLMetaElement_h

View File

@ -0,0 +1,53 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "mozilla/dom/HTMLModElement.h"
#include "mozilla/dom/HTMLModElementBinding.h"
#include "nsStyleConsts.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Mod)
DOMCI_NODE_DATA(HTMLModElement, mozilla::dom::HTMLModElement)
namespace mozilla {
namespace dom {
HTMLModElement::HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
HTMLModElement::~HTMLModElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLModElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLModElement, Element)
// QueryInterface implementation for HTMLModElement
NS_INTERFACE_TABLE_HEAD(HTMLModElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLModElement,
nsIDOMHTMLModElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLModElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLModElement)
NS_IMPL_ELEMENT_CLONE(HTMLModElement)
NS_IMPL_URI_ATTR(HTMLModElement, Cite, cite)
NS_IMPL_STRING_ATTR(HTMLModElement, DateTime, datetime)
JSObject*
HTMLModElement::WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
{
return HTMLModElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_dom_HTMLModElement_h
#define mozilla_dom_HTMLModElement_h
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLModElement.h"
#include "nsGkAtoms.h"
namespace mozilla {
namespace dom {
class HTMLModElement : public nsGenericHTMLElement,
public nsIDOMHTMLModElement
{
public:
HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~HTMLModElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLModElement
NS_DECL_NSIDOMHTMLMODELEMENT
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
void GetCite(nsString& aCite)
{
GetHTMLURIAttr(nsGkAtoms::cite, aCite);
}
void SetCite(const nsAString& aCite, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::cite, aCite, aRv);
}
// XPCOM GetDateTime is fine.
void SetDateTime(const nsAString& aDateTime, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::datetime, aDateTime, aRv);
}
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLModElement_h

View File

@ -901,12 +901,6 @@ static const nsAttrValue::EnumTable kRulesTable[] = {
{ 0 }
};
static const nsAttrValue::EnumTable kLayoutTable[] = {
{ "auto", NS_STYLE_TABLE_LAYOUT_AUTO },
{ "fixed", NS_STYLE_TABLE_LAYOUT_FIXED },
{ 0 }
};
bool
HTMLTableElement::ParseAttribute(int32_t aNamespaceID,
@ -917,12 +911,10 @@ HTMLTableElement::ParseAttribute(int32_t aNamespaceID,
/* ignore summary, just a string */
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::cellspacing ||
aAttribute == nsGkAtoms::cellpadding) {
aAttribute == nsGkAtoms::cellpadding ||
aAttribute == nsGkAtoms::border) {
return aResult.ParseNonNegativeIntValue(aValue);
}
if (aAttribute == nsGkAtoms::border) {
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsGkAtoms::height) {
return aResult.ParseSpecialIntValue(aValue);
}
@ -948,9 +940,6 @@ HTMLTableElement::ParseAttribute(int32_t aNamespaceID,
if (aAttribute == nsGkAtoms::frame) {
return aResult.ParseEnumValue(aValue, kFrameTable, false);
}
if (aAttribute == nsGkAtoms::layout) {
return aResult.ParseEnumValue(aValue, kLayoutTable, false);
}
if (aAttribute == nsGkAtoms::rules) {
return aResult.ParseEnumValue(aValue, kRulesTable, false);
}
@ -996,16 +985,6 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
SetFloatValue(float(value->GetIntegerValue()), eCSSUnit_Pixel);
}
}
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Table)) {
const nsAttrValue* value;
// layout
nsCSSValue* tableLayout = aData->ValueForTableLayout();
if (tableLayout->GetUnit() == eCSSUnit_Null) {
value = aAttributes->GetAttr(nsGkAtoms::layout);
if (value && value->Type() == nsAttrValue::eEnum)
tableLayout->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
}
}
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Margin)) {
// align; Check for enumerated type (it may be another type if
// illegal)
@ -1123,7 +1102,6 @@ NS_IMETHODIMP_(bool)
HTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
static const MappedAttributeEntry attributes[] = {
{ &nsGkAtoms::layout },
{ &nsGkAtoms::cellpadding },
{ &nsGkAtoms::cellspacing },
{ &nsGkAtoms::border },

View File

@ -41,6 +41,9 @@ EXPORTS_mozilla/dom = \
HTMLImageElement.h \
HTMLLabelElement.h \
HTMLLIElement.h \
HTMLMapElement.h \
HTMLMetaElement.h \
HTMLModElement.h \
HTMLParagraphElement.h \
HTMLPreElement.h \
HTMLScriptElement.h \
@ -90,12 +93,12 @@ CPPSRCS = \
HTMLLabelElement.cpp \
nsHTMLLegendElement.cpp \
nsHTMLLinkElement.cpp \
nsHTMLMapElement.cpp \
HTMLMapElement.cpp \
nsHTMLMenuElement.cpp \
nsHTMLMenuItemElement.cpp \
nsHTMLMetaElement.cpp \
HTMLMetaElement.cpp \
nsHTMLMeterElement.cpp \
nsHTMLModElement.cpp \
HTMLModElement.cpp \
HTMLObjectElement.cpp \
nsHTMLSharedObjectElement.cpp \
nsHTMLOptionElement.cpp \

View File

@ -180,7 +180,10 @@ static const nsAttrValue::EnumTable* kInputDefaultInputmode = &kInputInputmodeTa
const double nsHTMLInputElement::kStepScaleFactorDate = 86400000;
const double nsHTMLInputElement::kStepScaleFactorNumber = 1;
const double nsHTMLInputElement::kStepScaleFactorTime = 1000;
const double nsHTMLInputElement::kDefaultStepBase = 0;
const double nsHTMLInputElement::kDefaultStep = 1;
const double nsHTMLInputElement::kDefaultStepTime = 60;
const double nsHTMLInputElement::kStepAny = 0;
#define NS_INPUT_ELEMENT_STATE_IID \
@ -1486,7 +1489,8 @@ double
nsHTMLInputElement::GetStepBase() const
{
MOZ_ASSERT(mType == NS_FORM_INPUT_NUMBER ||
mType == NS_FORM_INPUT_DATE,
mType == NS_FORM_INPUT_DATE ||
mType == NS_FORM_INPUT_TIME,
"Check that kDefaultStepBase is correct for this new type");
double stepBase;
@ -1501,12 +1505,9 @@ nsHTMLInputElement::GetStepBase() const
// If @min is not a double, we should use @value.
nsAutoString valueStr;
if (GetAttr(kNameSpaceID_None, nsGkAtoms::value, valueStr)) {
nsresult ec;
stepBase = valueStr.ToDouble(&ec);
if (NS_SUCCEEDED(ec)) {
return stepBase;
}
if (GetAttr(kNameSpaceID_None, nsGkAtoms::value, valueStr) &&
ConvertStringToNumber(valueStr, stepBase)) {
return stepBase;
}
return kDefaultStepBase;
@ -4492,24 +4493,22 @@ nsHTMLInputElement::GetStep() const
{
MOZ_ASSERT(DoesStepApply(), "GetStep() can only be called if @step applies");
// NOTE: should be defaultStep, which is 1 for type=number and date.
double step = 1;
if (!HasAttr(kNameSpaceID_None, nsGkAtoms::step)) {
return GetDefaultStep() * GetStepScaleFactor();
}
if (HasAttr(kNameSpaceID_None, nsGkAtoms::step)) {
nsAutoString stepStr;
GetAttr(kNameSpaceID_None, nsGkAtoms::step, stepStr);
nsAutoString stepStr;
GetAttr(kNameSpaceID_None, nsGkAtoms::step, stepStr);
if (stepStr.LowerCaseEqualsLiteral("any")) {
// The element can't suffer from step mismatch if there is no step.
return kStepAny;
}
if (stepStr.LowerCaseEqualsLiteral("any")) {
// The element can't suffer from step mismatch if there is no step.
return kStepAny;
}
nsresult ec;
step = stepStr.ToDouble(&ec);
if (NS_FAILED(ec) || step <= 0) {
// NOTE: we should use defaultStep, which is 1 for type=number and date.
step = 1;
}
nsresult ec;
double step = stepStr.ToDouble(&ec);
if (NS_FAILED(ec) || step <= 0) {
step = GetDefaultStep();
}
// TODO: This multiplication can lead to inexact results, we should use a
@ -5011,17 +5010,24 @@ nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage,
ConvertNumberToString(valueLow, valueLowStr);
ConvertNumberToString(valueHigh, valueHighStr);
const PRUnichar* params[] = { valueLowStr.get(), valueHighStr.get() };
rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
"FormValidationStepMismatch",
params, message);
if (valueLowStr.Equals(valueHighStr)) {
const PRUnichar* params[] = { valueLowStr.get() };
rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
"FormValidationStepMismatchOneValue",
params, message);
} else {
const PRUnichar* params[] = { valueLowStr.get(), valueHighStr.get() };
rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
"FormValidationStepMismatch",
params, message);
}
} else {
nsAutoString valueLowStr;
ConvertNumberToString(valueLow, valueLowStr);
const PRUnichar* params[] = { valueLowStr.get() };
rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
"FormValidationStepMismatchWithoutMax",
"FormValidationStepMismatchOneValue",
params, message);
}
@ -5444,6 +5450,25 @@ nsHTMLInputElement::GetStepScaleFactor() const
return kStepScaleFactorDate;
case NS_FORM_INPUT_NUMBER:
return kStepScaleFactorNumber;
case NS_FORM_INPUT_TIME:
return kStepScaleFactorTime;
default:
MOZ_NOT_REACHED();
return MOZ_DOUBLE_NaN();
}
}
double
nsHTMLInputElement::GetDefaultStep() const
{
MOZ_ASSERT(DoesStepApply());
switch (mType) {
case NS_FORM_INPUT_DATE:
case NS_FORM_INPUT_NUMBER:
return kDefaultStep;
case NS_FORM_INPUT_TIME:
return kDefaultStepTime;
default:
MOZ_NOT_REACHED();
return MOZ_DOUBLE_NaN();

View File

@ -486,7 +486,7 @@ protected:
/**
* Returns if the step attribute apply for the current type.
*/
bool DoesStepApply() const { return DoesMinMaxApply() && mType != NS_FORM_INPUT_TIME; }
bool DoesStepApply() const { return DoesMinMaxApply(); }
/**
* Returns if stepDown and stepUp methods apply for the current type.
@ -703,6 +703,12 @@ protected:
*/
double GetStepBase() const;
/**
* Returns the default step for the current type.
* @return the default step for the current type.
*/
double GetDefaultStep() const;
/**
* Apply a step change from stepUp or stepDown by multiplying aStep by the
* current step value.
@ -768,10 +774,16 @@ protected:
// Step scale factor values, for input types that have one.
static const double kStepScaleFactorDate;
static const double kStepScaleFactorNumber;
static const double kStepScaleFactorTime;
// Default step base value when a type do not have specific one.
static const double kDefaultStepBase;
// Float alue returned by GetStep() when the step attribute is set to 'any'.
// Default step used when there is no specified step.
static const double kDefaultStep;
static const double kDefaultStepTime;
// Float value returned by GetStep() when the step attribute is set to 'any'.
static const double kStepAny;
/**

View File

@ -1,97 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsIDOMHTMLMapElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsContentList.h"
#include "nsCOMPtr.h"
using namespace mozilla::dom;
class nsHTMLMapElement : public nsGenericHTMLElement,
public nsIDOMHTMLMapElement
{
public:
nsHTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLMapElement
NS_DECL_NSIDOMHTMLMAPELEMENT
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLMapElement,
nsGenericHTMLElement)
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
nsRefPtr<nsContentList> mAreas;
};
NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
nsHTMLMapElement::nsHTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLMapElement,
nsGenericHTMLElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAreas)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsHTMLMapElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLMapElement, Element)
DOMCI_NODE_DATA(HTMLMapElement, nsHTMLMapElement)
// QueryInterface implementation for nsHTMLMapElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLMapElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLMapElement, nsIDOMHTMLMapElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMapElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMapElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLMapElement)
NS_IMETHODIMP
nsHTMLMapElement::GetAreas(nsIDOMHTMLCollection** aAreas)
{
NS_ENSURE_ARG_POINTER(aAreas);
if (!mAreas) {
// Not using NS_GetContentList because this should not be cached
mAreas = new nsContentList(this,
kNameSpaceID_XHTML,
nsGkAtoms::area,
nsGkAtoms::area,
false);
}
NS_ADDREF(*aAreas = mAreas);
return NS_OK;
}
NS_IMPL_STRING_ATTR(nsHTMLMapElement, Name, name)

View File

@ -1,142 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsIDOMHTMLMetaElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsAsyncDOMEvent.h"
#include "nsContentUtils.h"
using namespace mozilla::dom;
class nsHTMLMetaElement : public nsGenericHTMLElement,
public nsIDOMHTMLMetaElement
{
public:
nsHTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~nsHTMLMetaElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLMetaElement
NS_DECL_NSIDOMHTMLMETAELEMENT
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers);
virtual void UnbindFromTree(bool aDeep = true,
bool aNullParent = true);
void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName);
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual void GetItemValueText(nsAString& text);
virtual void SetItemValueText(const nsAString& text);
};
NS_IMPL_NS_NEW_HTML_ELEMENT(Meta)
nsHTMLMetaElement::nsHTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}
nsHTMLMetaElement::~nsHTMLMetaElement()
{
}
NS_IMPL_ADDREF_INHERITED(nsHTMLMetaElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLMetaElement, Element)
DOMCI_NODE_DATA(HTMLMetaElement, nsHTMLMetaElement)
// QueryInterface implementation for nsHTMLMetaElement
NS_INTERFACE_TABLE_HEAD(nsHTMLMetaElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLMetaElement, nsIDOMHTMLMetaElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMetaElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMetaElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLMetaElement)
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Content, content)
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, HttpEquiv, httpEquiv)
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Name, name)
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Scheme, scheme)
void
nsHTMLMetaElement::GetItemValueText(nsAString& aValue)
{
GetContent(aValue);
}
void
nsHTMLMetaElement::SetItemValueText(const nsAString& aValue)
{
SetContent(aValue);
}
nsresult
nsHTMLMetaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument &&
AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, nsGkAtoms::viewport, eIgnoreCase)) {
nsAutoString content;
rv = GetContent(content);
NS_ENSURE_SUCCESS(rv, rv);
nsContentUtils::ProcessViewportInfo(aDocument, content);
}
CreateAndDispatchEvent(aDocument, NS_LITERAL_STRING("DOMMetaAdded"));
return rv;
}
void
nsHTMLMetaElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
nsCOMPtr<nsIDocument> oldDoc = GetCurrentDoc();
CreateAndDispatchEvent(oldDoc, NS_LITERAL_STRING("DOMMetaRemoved"));
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
void
nsHTMLMetaElement::CreateAndDispatchEvent(nsIDocument* aDoc,
const nsAString& aEventName)
{
if (!aDoc)
return;
nsRefPtr<nsAsyncDOMEvent> event = new nsAsyncDOMEvent(this, aEventName, true,
true);
event->PostDOMEvent();
}

View File

@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsIDOMHTMLModElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
using namespace mozilla::dom;
class nsHTMLModElement : public nsGenericHTMLElement,
public nsIDOMHTMLModElement
{
public:
nsHTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~nsHTMLModElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLModElement
NS_DECL_NSIDOMHTMLMODELEMENT
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
};
NS_IMPL_NS_NEW_HTML_ELEMENT(Mod)
nsHTMLModElement::nsHTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}
nsHTMLModElement::~nsHTMLModElement()
{
}
NS_IMPL_ADDREF_INHERITED(nsHTMLModElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLModElement, Element)
DOMCI_NODE_DATA(HTMLModElement, nsHTMLModElement)
// QueryInterface implementation for nsHTMLModElement
NS_INTERFACE_TABLE_HEAD(nsHTMLModElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLModElement,
nsIDOMHTMLModElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLModElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLModElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLModElement)
NS_IMPL_URI_ATTR(nsHTMLModElement, Cite, cite)
NS_IMPL_STRING_ATTR(nsHTMLModElement, DateTime, datetime)

View File

@ -337,6 +337,9 @@ MOCHITEST_FILES = \
test_htmlcollection.html \
test_formelements.html \
test_rowscollection.html \
test_map_attributes_reflection.html \
test_meta_attributes_reflection.html \
test_mod_attributes_reflection.html \
test_mozaudiochannel.html \
test_style_attributes_reflection.html \
$(NULL)

View File

@ -239,6 +239,9 @@ for (var test of data) {
break;
case 'time':
// Don't worry about that.
input.step = 'any';
input.max = '10:10';
input.value = '10:09';
checkValidity(input, true, apply, apply);

View File

@ -237,6 +237,9 @@ for (var test of data) {
"validation message");
break;
case 'time':
// Don't worry about that.
input.step = 'any';
input.min = '20:20';
input.value = '20:20:01';
checkValidity(input, true, apply, apply);

View File

@ -19,30 +19,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=635553
/** Test for Bug 635553 **/
var types = [
[ 'hidden', false ],
[ 'text', false ],
[ 'search', false ],
[ 'tel', false ],
[ 'url', false ],
[ 'email', false ],
[ 'password', false ],
[ 'datetime', true, true ],
[ 'date', true ],
[ 'month', true, true ],
[ 'week', true, true ],
[ 'time', true ],
[ 'datetime-local', true, true ],
[ 'number', true ],
[ 'range', true, true ],
[ 'color', false, true ],
[ 'checkbox', false ],
[ 'radio', false ],
[ 'file', false ],
[ 'submit', false ],
[ 'image', false ],
[ 'reset', false ],
[ 'button', false ],
var data = [
{ type: 'hidden', apply: false },
{ type: 'text', apply: false },
{ type: 'search', apply: false },
{ type: 'tel', apply: false },
{ type: 'url', apply: false },
{ type: 'email', apply: false },
{ type: 'password', apply: false },
{ type: 'datetime', apply: true, todo: true },
{ type: 'date', apply: true },
{ type: 'month', apply: true, todo: true },
{ type: 'week', apply: true, todo: true },
{ type: 'time', apply: true },
{ type: 'datetime-local', apply: true, todo: true },
{ type: 'number', apply: true },
{ type: 'range', apply: true, todo: true },
{ type: 'color', apply: false, todo: true },
{ type: 'checkbox', apply: false },
{ type: 'radio', apply: false },
{ type: 'file', apply: false },
{ type: 'submit', apply: false },
{ type: 'image', apply: false },
{ type: 'reset', apply: false },
{ type: 'button', apply: false },
];
function getFreshElement(type) {
@ -63,9 +63,18 @@ function checkValidity(aElement, aValidity, aApply, aData)
if (aValidity) {
is(aElement.validationMessage, "", "There should be no validation message.");
} else {
is(aElement.validationMessage, "Please select a valid value. " +
"The two nearest valid values are " + aData.low + " and " + aData.high + ".",
"There should be a validation message.");
if (aElement.validity.rangeUnderflow) {
is(aElement.validationMessage, "Please select a value that is higher than " +
aElement.min + ".", "There should be a validation message.");
} else if (aData.low == aData.high) {
is(aElement.validationMessage, "Please select a valid value. " +
"The nearest valid value is " + aData.low + ".",
"There should be a validation message.");
} else {
is(aElement.validationMessage, "Please select a valid value. " +
"The two nearest valid values are " + aData.low + " and " + aData.high + ".",
"There should be a validation message.");
}
}
is(aElement.mozMatchesSelector(":valid"), aElement.willValidate && aValidity,
@ -76,327 +85,441 @@ function checkValidity(aElement, aValidity, aApply, aData)
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
for (var data of types) {
var input = getFreshElement(data[0]);
var apply = data[1];
for (var test of data) {
var input = getFreshElement(test.type);
var apply = test.apply;
if (data[2]) {
todo_is(input.type, data[0], data[0] + " isn't implemented yet");
continue;
}
if (input.type == 'time') {
if (test.todo) {
todo_is(input.type, test.type, test.type + " isn't implemented yet");
continue;
}
// The element should be valid, there should be no step mismatch.
checkValidity(input, true, apply);
input.step = '0';
checkValidity(input, true, apply);
if (input.type == 'url') {
input.value = 'http://mozilla.org';
checkValidity(input, true, apply);
} else if (input.type == 'email') {
input.value = 'foo@bar.com';
checkValidity(input, true, apply);
} else if (input.type == 'file') {
// Need privileges to set a filename with .value.
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var file = dirSvc.get("ProfD", Components.interfaces.nsIFile);
file.append('635499_file');
var outStream = Components.classes["@mozilla.org/network/file-output-stream;1"].
createInstance(Components.interfaces.nsIFileOutputStream);
outStream.init(file, 0x02 | 0x08 | 0x20, // write, create, truncate
0666, 0);
outStream.write("foo", 3);
outStream.close();
input.value = file.path;
checkValidity(input, true, apply);
file.remove(false);
} else if (input.type == 'date') {
// For date, the step is calulated on the timestamp since 1970-01-01
// which mean that for all dates prior to the epoch, this timestamp is < 0
// and the behavior might differ, therefore we have to test for these cases.
// When step is 1 every date is valid
input.value = '2012-07-05';
checkValidity(input, true, apply);
input.step = 'foo';
input.value = '1970-01-01';
checkValidity(input, true, apply);
input.step = '-1';
input.value = '1969-12-12';
checkValidity(input, true, apply);
input.removeAttribute('step');
input.value = '1500-01-01';
checkValidity(input, true, apply);
input.step = 'any';
checkValidity(input, true, apply);
input.step = 'aNy';
checkValidity(input, true, apply);
input.step = 'AnY';
checkValidity(input, true, apply);
input.step = 'ANY';
checkValidity(input, true, apply);
// When min is set to a valid date, there is a step base.
input.min = '2008-02-28';
input.step = '2';
input.value = '2008-03-01';
checkValidity(input, true, apply);
input.value = '2008-02-29';
checkValidity(input, false, apply, { low: "2008-02-28", high: "2008-03-01" });
input.min = '2008-02-27';
input.value = '2008-02-28';
checkValidity(input, false, apply, { low: "2008-02-27", high: "2008-02-29" });
input.min = '2009-02-27';
input.value = '2009-02-28';
checkValidity(input, false, apply, { low: "2009-02-27", high: "2009-03-01" });
input.min = '2009-02-01';
input.step = '1.1';
input.value = '2009-02-02';
checkValidity(input, false, apply, { low: "2009-02-01", high: "2009-02-12" });
// Without any step attribute the date is valid
input.removeAttribute('step');
checkValidity(input, true, apply);
input.min = '1950-01-01';
input.step = '366';
input.value = '1951-01-01';
checkValidity(input, false, apply, { low: "1950-01-01", high: "1951-01-02" });
input.min = '1951-01-01';
input.step = '365';
input.value = '1952-01-01';
checkValidity(input, true, apply);
input.step = '0.9';
input.value = '1951-01-02';
checkValidity(input, false, apply, { low: "1951-01-01", high: "1951-01-10" });
input.value = '1951-01-10'
checkValidity(input, true, apply);
input.step = '0.5';
input.value = '1951-01-02';
checkValidity(input, true, apply);
input.step = '1.5';
input.value = '1951-01-03';
checkValidity(input, false, apply, { low: "1951-01-01", high: "1951-01-04" });
// Checks to do for all types that support step:
// - check for @step=0,
// - check for @step behind removed,
// - check for @step being 'any' with different case variations.
switch (input.type) {
case 'text':
case 'hidden':
case 'search':
case 'password':
case 'tel':
case 'radio':
case 'checkbox':
case 'reset':
case 'button':
case 'submit':
case 'image':
input.value = '0';
checkValidity(input, true, apply);
break;
case 'url':
input.value = 'http://mozilla.org';
checkValidity(input, true, apply);
break;
case 'email':
input.value = 'foo@bar.com';
checkValidity(input, true, apply);
break;
case 'file':
// Need privileges to set a filename with .value.
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var file = dirSvc.get("ProfD", Components.interfaces.nsIFile);
file.append('635499_file');
var outStream = Components.classes["@mozilla.org/network/file-output-stream;1"].
createInstance(Components.interfaces.nsIFileOutputStream);
outStream.init(file, 0x02 | 0x08 | 0x20, // write, create, truncate
0666, 0);
outStream.write("foo", 3);
outStream.close();
input.value = file.path;
checkValidity(input, true, apply);
file.remove(false);
break;
case 'date':
// For date, the step is calulated on the timestamp since 1970-01-01
// which mean that for all dates prior to the epoch, this timestamp is < 0
// and the behavior might differ, therefore we have to test for these cases.
// When step is invalid, every date is valid
input.step = 0;
input.value = '2012-07-05';
checkValidity(input, true, apply);
input.step = 'foo';
input.value = '1970-01-01';
checkValidity(input, true, apply);
input.step = '-1';
input.value = '1969-12-12';
checkValidity(input, true, apply);
input.removeAttribute('step');
input.value = '1500-01-01';
checkValidity(input, true, apply);
input.step = 'any';
input.value = '1966-12-12';
checkValidity(input, true, apply);
input.step = 'ANY';
input.value = '2013-02-03';
checkValidity(input, true, apply);
// When min is set to a valid date, there is a step base.
input.min = '2008-02-28';
input.step = '2';
input.value = '2008-03-01';
checkValidity(input, true, apply);
input.value = '2008-02-29';
checkValidity(input, false, apply, { low: "2008-02-28", high: "2008-03-01" });
input.min = '2008-02-27';
input.value = '2008-02-28';
checkValidity(input, false, apply, { low: "2008-02-27", high: "2008-02-29" });
input.min = '2009-02-27';
input.value = '2009-02-28';
checkValidity(input, false, apply, { low: "2009-02-27", high: "2009-03-01" });
input.min = '2009-02-01';
input.step = '1.1';
input.value = '2009-02-02';
checkValidity(input, false, apply, { low: "2009-02-01", high: "2009-02-12" });
// Without any step attribute the date is valid
input.removeAttribute('step');
checkValidity(input, true, apply);
input.min = '1950-01-01';
input.step = '366';
input.value = '1951-01-01';
checkValidity(input, false, apply, { low: "1950-01-01", high: "1951-01-02" });
input.min = '1951-01-01';
input.step = '365';
input.value = '1952-01-01';
checkValidity(input, true, apply);
input.step = '0.9';
input.value = '1951-01-02';
checkValidity(input, false, apply, { low: "1951-01-01", high: "1951-01-10" });
input.value = '1951-01-10'
checkValidity(input, true, apply);
input.step = '0.5';
input.value = '1951-01-02';
checkValidity(input, true, apply);
input.step = '1.5';
input.value = '1951-01-03';
checkValidity(input, false, apply, { low: "1951-01-01", high: "1951-01-04" });
input.value = '1951-01-08';
checkValidity(input, false, apply, { low: "1951-01-07", high: "1951-01-10" });
input.step = '3000';
input.min= '1968-01-01';
input.value = '1968-05-12';
checkValidity(input, false, apply, { low: "1968-01-01", high: "1976-03-19" });
input.value = '1971-01-01';
checkValidity(input, false, apply, { low: "1968-01-01", high: "1976-03-19" });
input.value = '1951-01-08';
checkValidity(input, false, apply, { low: "1951-01-07", high: "1951-01-10" });
input.value = '1991-01-01';
checkValidity(input, false, apply, { low: "1984-06-05", high: "1992-08-22" });
input.step = '3000';
input.min= '1968-01-01';
input.value = '1968-05-12';
checkValidity(input, false, apply, { low: "1968-01-01", high: "1976-03-19" });
input.value = '1984-06-05';
checkValidity(input, true, apply);
input.value = '1971-01-01';
checkValidity(input, false, apply, { low: "1968-01-01", high: "1976-03-19" });
input.value = '1992-08-22';
checkValidity(input, true, apply);
input.value = '1991-01-01';
checkValidity(input, false, apply, { low: "1984-06-05", high: "1992-08-22" });
input.step = '1.1';
input.min = '1991-01-01';
input.value = '1991-01-01';
checkValidity(input, true, apply);
input.value = '1984-06-05';
checkValidity(input, true, apply);
input.value = '1991-01-02';
checkValidity(input, false, apply, { low: "1991-01-01", high: "1991-01-12" });
input.value = '1992-08-22';
checkValidity(input, true, apply);
input.value = '1991-01-12';
checkValidity(input, true, apply);
input.step = '1.1';
input.min = '1991-01-01';
input.value = '1991-01-01';
checkValidity(input, true, apply);
input.step = '1.1';
input.min = '1969-12-20';
input.value = '1969-12-20';
checkValidity(input, true, apply);
input.value = '1991-01-02';
checkValidity(input, false, apply, { low: "1991-01-01", high: "1991-01-12" });
input.value = '1969-12-21';
checkValidity(input, false, apply, { low: "1969-12-20", high: "1969-12-31" });
input.value = '1991-01-12';
checkValidity(input, true, apply);
input.value = '1969-12-31';
checkValidity(input, true, apply);
input.step = '1.1';
input.min = '1969-12-20';
input.value = '1969-12-20';
checkValidity(input, true, apply);
break;
case 'number':
// When step=0, the allowed step is 1.
input.step = '0';
input.value = '1.2';
checkValidity(input, false, apply, { low: 1, high: 2 });
input.value = '1969-12-21';
checkValidity(input, false, apply, { low: "1969-12-20", high: "1969-12-31" });
input.value = '1';
checkValidity(input, true, apply);
input.value = '1969-12-31';
checkValidity(input, true, apply);
input.value = '0';
checkValidity(input, true, apply);
} else {
// When step=0, the allowed step is 1.
input.value = '1.2';
checkValidity(input, false, apply, { low: 1, high: 2 });
// When step is NaN, the allowed step value is 1.
input.step = 'foo';
input.value = '1';
checkValidity(input, true, apply);
input.value = '1';
checkValidity(input, true, apply);
input.value = '1.5';
checkValidity(input, false, apply, { low: 1, high: 2 });
input.value = '0';
checkValidity(input, true, apply);
// When step is negative, the allowed step value is 1.
input.step = '-0.1';
checkValidity(input, false, apply, { low: 1, high: 2 });
// When step is NaN, the allowed step value is 1.
input.step = 'foo';
input.value = '1';
checkValidity(input, true, apply);
input.value = '1';
checkValidity(input, true, apply);
input.value = '1.5';
checkValidity(input, false, apply, { low: 1, high: 2 });
// When step is missing, the allowed step value is 1.
input.removeAttribute('step');
input.value = '1.5';
checkValidity(input, false, apply, { low: 1, high: 2 });
// When step is negative, the allowed step value is 1.
input.step = '-0.1';
checkValidity(input, false, apply, { low: 1, high: 2 });
input.value = '1';
checkValidity(input, true, apply);
input.value = '1';
checkValidity(input, true, apply);
// When step is 'any', all values are fine wrt to step.
input.step = 'any';
checkValidity(input, true, apply);
// When step is missing, the allowed step value is 1.
input.removeAttribute('step');
input.value = '1.5';
checkValidity(input, false, apply, { low: 1, high: 2 });
input.step = 'aNy';
input.value = '1337';
checkValidity(input, true, apply);
input.value = '1';
checkValidity(input, true, apply);
input.step = 'AnY';
input.value = '0.1';
checkValidity(input, true, apply);
// When step is 'any', all values are fine wrt to step.
input.step = 'any';
checkValidity(input, true, apply);
input.step = 'ANY';
input.value = '-13.37';
checkValidity(input, true, apply);
input.step = 'aNy';
input.value = '1337';
checkValidity(input, true, apply);
input.step = 'AnY';
input.value = '0.1';
checkValidity(input, true, apply);
input.step = 'ANY';
input.value = '-13.37';
checkValidity(input, true, apply);
// When min is set to a valid float, there is a step base.
input.min = '1';
input.step = '2';
input.value = '3';
checkValidity(input, true, apply);
input.value = '2';
checkValidity(input, false, apply, { low: 1, high: 3 });
input.removeAttribute('step'); // step = 1
input.min = '0.5';
input.value = '5.5';
checkValidity(input, true, apply);
input.value = '1';
checkValidity(input, false, apply, { low: 0.5, high: 1.5 });
input.min = '-0.1';
input.step = '1';
input.value = '0.9';
checkValidity(input, true, apply);
input.value = '0.1';
checkValidity(input, false, apply, { low: -0.1, high: 0.9 });
// When min is set to NaN, there is no step base (step base=0 actually).
input.min = 'foo';
input.step = '1';
input.value = '1';
checkValidity(input, true, apply);
input.value = '0.5';
checkValidity(input, false, apply, { low: 0, high: 1 });
input.min = '';
input.value = '1';
checkValidity(input, true, apply);
input.value = '0.5';
checkValidity(input, false, apply, { low: 0, high: 1 });
input.removeAttribute('min');
// If value isn't a number, the element isn't invalid.
input.value = '';
checkValidity(input, true, apply);
// Regular situations.
input.step = '2';
input.value = '1.5';
checkValidity(input, false, apply, { low: 0, high: 2 });
input.value = '42.0';
checkValidity(input, true, apply);
input.step = '0.1';
input.value = '-0.1';
checkValidity(input, true, apply);
input.step = '2';
input.removeAttribute('min');
input.max = '10';
input.value = '-9';
checkValidity(input, false, apply, {low: -10, high: -8});
// If there is a value defined but no min, the step base is the value.
input = getFreshElement(data[0]);
input.setAttribute('value', '1');
input.step = 2;
checkValidity(input, true, apply);
input.value = 3;
checkValidity(input, true, apply);
input.value = 2;
checkValidity(input, false, apply, {low: 1, high: 3});
// Should also work with defaultValue.
input = getFreshElement(data[0]);
input.defaultValue = 1;
input.step = 2;
checkValidity(input, true, apply);
input.value = 3;
checkValidity(input, true, apply);
input.value = 2;
checkValidity(input, false, apply, {low: 1, high: 3});
}
if (input.type == 'number') {
// Check that when the higher value is higher than max, we don't show it.
input = getFreshElement(data[0]);
input.step = '2';
input.min = '1';
input.max = '10.9';
input.value = '10';
is(input.validationMessage, "Please select a valid value. " +
"The nearest valid value is 9.",
"The validation message should not include the higher value.");
// When min is set to a valid float, there is a step base.
input.min = '1';
input.step = '2';
input.value = '3';
checkValidity(input, true, apply);
input.value = '2';
checkValidity(input, false, apply, { low: 1, high: 3 });
input.removeAttribute('step'); // step = 1
input.min = '0.5';
input.value = '5.5';
checkValidity(input, true, apply);
input.value = '1';
checkValidity(input, false, apply, { low: 0.5, high: 1.5 });
input.min = '-0.1';
input.step = '1';
input.value = '0.9';
checkValidity(input, true, apply);
input.value = '0.1';
checkValidity(input, false, apply, { low: -0.1, high: 0.9 });
// When min is set to NaN, there is no step base (step base=0 actually).
input.min = 'foo';
input.step = '1';
input.value = '1';
checkValidity(input, true, apply);
input.value = '0.5';
checkValidity(input, false, apply, { low: 0, high: 1 });
input.min = '';
input.value = '1';
checkValidity(input, true, apply);
input.value = '0.5';
checkValidity(input, false, apply, { low: 0, high: 1 });
input.removeAttribute('min');
// If value isn't a number, the element isn't invalid.
input.value = '';
checkValidity(input, true, apply);
// Regular situations.
input.step = '2';
input.value = '1.5';
checkValidity(input, false, apply, { low: 0, high: 2 });
input.value = '42.0';
checkValidity(input, true, apply);
input.step = '0.1';
input.value = '-0.1';
checkValidity(input, true, apply);
input.step = '2';
input.removeAttribute('min');
input.max = '10';
input.value = '-9';
checkValidity(input, false, apply, {low: -10, high: -8});
// If there is a value defined but no min, the step base is the value.
input = getFreshElement(test.type);
input.setAttribute('value', '1');
input.step = 2;
checkValidity(input, true, apply);
input.value = 3;
checkValidity(input, true, apply);
input.value = 2;
checkValidity(input, false, apply, {low: 1, high: 3});
// Should also work with defaultValue.
input = getFreshElement(test.type);
input.defaultValue = 1;
input.step = 2;
checkValidity(input, true, apply);
input.value = 3;
checkValidity(input, true, apply);
input.value = 2;
checkValidity(input, false, apply, {low: 1, high: 3});
// Check that when the higher value is higher than max, we don't show it.
input = getFreshElement(test.type);
input.step = '2';
input.min = '1';
input.max = '10.9';
input.value = '10';
is(input.validationMessage, "Please select a valid value. " +
"The nearest valid value is 9.",
"The validation message should not include the higher value.");
break;
case 'time':
// Tests invalid step values. That defaults to step = 1 minute (60).
var values = [ '0', '-1', 'foo', 'any', 'ANY', 'aNy' ];
for (var value of values) {
input.step = value;
input.value = '19:06:00';
checkValidity(input, true, apply);
input.value = '19:06:51';
if (value.toLowerCase() != 'any') {
checkValidity(input, false, apply, {low: '19:06', high: '19:07'});
} else {
checkValidity(input, true, apply);
}
}
// No step means that we use the default step value.
input.removeAttribute('step');
input.value = '19:06:00';
checkValidity(input, true, apply);
input.value = '19:06:51';
checkValidity(input, false, apply, {low: '19:06', high: '19:07'});
var tests = [
// With step=1, we allow values by the second.
{ step: '1', value: '19:11:01', min: '00:00', result: true },
{ step: '1', value: '19:11:01.001', min: '00:00', result: false,
low: '19:11:01', high: '19:11:02' },
{ step: '1', value: '19:11:01.1', min: '00:00', result: false,
low: '19:11:01', high: '19:11:02' },
// When step >= 86400000, only the minimum value is valid.
// This is actually @value if there is no @min.
{ step: '86400000', value: '00:00', result: true },
{ step: '86400000', value: '00:01', result: true },
{ step: '86400000', value: '00:00', min: '00:01', result: false },
{ step: '86400000', value: '00:01', min: '00:00', result: false,
low: '00:00', high: '00:00' },
// When step < 1, it should just work.
{ step: '0.1', value: '15:05:05.1', min: '00:00', result: true },
{ step: '0.1', value: '15:05:05.101', min: '00:00', result: false,
low: '15:05:05.100', high: '15:05:05.200' },
{ step: '0.2', value: '15:05:05.2', min: '00:00', result: true },
{ step: '0.2', value: '15:05:05.1', min: '00:00', result: false,
low: '15:05:05', high: '15:05:05.200' },
{ step: '0.01', value: '15:05:05.01', min: '00:00', result: true },
{ step: '0.01', value: '15:05:05.011', min: '00:00', result: false,
low: '15:05:05.010', high: '15:05:05.020' },
{ step: '0.02', value: '15:05:05.02', min: '00:00', result: true },
{ step: '0.02', value: '15:05:05.01', min: '00:00', result: false,
low: '15:05:05', high: '15:05:05.020' },
{ step: '0.002', value: '15:05:05.002', min: '00:00', result: true },
{ step: '0.002', value: '15:05:05.001', min: '00:00', result: false,
low: '15:05:05', high: '15:05:05.002' },
// When step<=0.001, any value is allowed.
{ step: '0.001', value: '15:05:05.001', min: '00:00', result: true },
{ step: '0.001', value: '15:05:05', min: '00:00', result: true },
{ step: '0.000001', value: '15:05:05', min: '00:00', result: true },
// This value has conversion to double issues.
{ step: '0.0000001', value: '15:05:05', min: '00:00', result: true,
todo: true },
// Some random values.
{ step: '100', value: '15:06:40', min: '00:00', result: true },
{ step: '100', value: '15:05:05.010', min: '00:00', result: false,
low: '15:05', high: '15:06:40' },
{ step: '3600', value: '15:00', min: '00:00', result: true },
{ step: '3600', value: '15:14', min: '00:00', result: false,
low: '15:00', high: '16:00' },
{ step: '7200', value: '14:00', min: '00:00', result: true },
{ step: '7200', value: '15:14', min: '00:00', result: false,
low: '14:00', high: '16:00' },
{ step: '7260', value: '14:07', min: '00:00', result: true },
{ step: '7260', value: '15:14', min: '00:00', result: false,
low: '14:07', high: '16:08' },
];
var type = test.type;
for (var test of tests) {
var input = getFreshElement(type);
input.step = test.step;
input.setAttribute('value', test.value);
if (test.min !== undefined) {
input.min = test.min;
}
if (test.todo) {
todo(input.validity.valid, test.result,
"This test should fail for the moment because of precission issues");
continue;
}
if (test.result) {
checkValidity(input, true, apply);
} else {
checkValidity(input, false, apply,
{ low: test.low, high: test.high });
}
}
break;
default:
ok(false, "Implement the tests for <input type='" + test.type + " >");
break;
}
}

View File

@ -48,6 +48,7 @@ function checkAvailability()
["button", false],
["number", true],
["date", true],
["time", true],
// The next types have not been implemented but will fallback to "text"
// which has the same value.
["color", false],
@ -58,7 +59,6 @@ function checkAvailability()
["datetime", true],
["month", true],
["week", true],
["time", true],
["datetime-local", true],
["range", true],
];
@ -229,8 +229,8 @@ function checkStepDown()
[ '2012-01-04', '2', '2012-01-01', null, null, '2012-01-03', false ],
[ '2012-01-06', '2', '2012-01-01', null, 2, '2012-01-03', false ],
[ '2012-01-05', '2', '2012-01-04', '2012-01-08', null, '2012-01-04', false ],
[ '1970-01-04', '2', null, null, null, '1970-01-03', false ],
[ '1970-01-09', '3', null, null, null, '1970-01-07', false ],
[ '1970-01-04', '2', null, null, null, '1970-01-02', false ],
[ '1970-01-09', '3', null, null, null, '1970-01-06', false ],
// Clamping.
[ '2012-05-01', null, null, '2012-01-05', null, '2012-01-05', false ],
[ '1970-01-05', '2', '1970-01-02', '1970-01-05', null, '1970-01-04', false ],
@ -246,6 +246,70 @@ function checkStepDown()
[ '2012-01-01', 'AnY', null, null, 1, null, true ],
[ '2012-01-01', 'aNy', null, null, 1, null, true ],
]},
{ type: 'time', data: [
// Regular case.
[ '16:39', null, null, null, null, '16:38', false ],
// Argument testing.
[ '16:40', null, null, null, 1, '16:39', false ],
[ '16:40', null, null, null, 5, '16:35', false ],
[ '16:40', null, null, null, -1, '16:41', false ],
[ '16:40', null, null, null, 0, '16:40', false ],
// hour/minutes/seconds wrapping.
[ '05:00', null, null, null, null, '04:59', false ],
[ '05:00:00', 1, null, null, null, '04:59:59', false ],
[ '05:00:00', 0.1, null, null, null, '04:59:59.900', false ],
[ '05:00:00', 0.01, null, null, null, '04:59:59.990', false ],
[ '05:00:00', 0.001, null, null, null, '04:59:59.999', false ],
// stepDown() on '00:00' gives '23:59'.
[ '00:00', null, null, null, 1, '23:59', false ],
[ '00:00', null, null, null, 3, '23:57', false ],
// Some random step values..
[ '16:56', '0.5', null, null, null, '16:55:59.500', false ],
[ '16:56', '2', null, null, null, '16:55:58', false ],
[ '16:56', '0.25',null, null, 4, '16:55:59', false ],
[ '16:57', '1.1', '16:00', null, 1, '16:56:59.900', false ],
[ '16:57', '1.1', '16:00', null, 2, '16:56:58.800', false ],
[ '16:57', '1.1', '16:00', null, 10, '16:56:50', false ],
[ '16:57', '1.1', '16:00', null, 11, '16:56:48.900', false ],
[ '16:57', '1.1', '16:00', null, 8, '16:56:52.200', false ],
// Invalid @step, means that we use the default value.
[ '17:01', '0', null, null, null, '17:00', false ],
[ '17:01', '-1', null, null, null, '17:00', false ],
[ '17:01', 'foo', null, null, null, '17:00', false ],
// Min values testing.
[ '17:02', '60', 'foo', null, 2, '17:00', false ],
[ '17:10', '60', '17:09', null, null, '17:09', false ],
[ '17:10', '60', '17:10', null, null, '17:10', false ],
[ '17:10', '60', '17:30', null, 1, '17:10', false ],
[ '17:10', '180', '17:05', null, null, '17:08', false ],
[ '17:10', '300', '17:10', '17:11', null, '17:10', false ],
// Max values testing.
[ '17:15', '60', null, 'foo', null, '17:14', false ],
[ '17:15', null, null, '17:20', null, '17:14', false ],
[ '17:15', null, null, '17:15', null, '17:14', false ],
[ '17:15', null, null, '17:13', 4, '17:11', false ],
[ '17:15', '120', null, '17:13', 3, '17:09', false ],
// Step mismatch.
[ '17:19', '120', '17:10', null, null, '17:18', false ],
[ '17:19', '120', '17:10', null, 2, '17:16', false ],
[ '17:19', '120', '17:18', '17:25', null, '17:18', false ],
[ '17:19', '120', null, null, null, '17:17', false ],
[ '17:19', '180', null, null, null, '17:16', false ],
// Clamping.
[ '17:22', null, null, '17:11', null, '17:11', false ],
[ '17:22', '120', '17:20', '17:22', null, '17:20', false ],
[ '17:22', '300', '17:12', '17:20', 10, '17:12', false ],
[ '17:22', '300', '17:18', '17:20', 2, '17:18', false ],
[ '17:22', '180', '17:00', '17:20', 15, '17:00', false ],
[ '17:22', '180', '17:10', '17:20', 2, '17:16', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
// With step = 'any'.
[ '17:26', 'any', null, null, 1, null, true ],
[ '17:26', 'ANY', null, null, 1, null, true ],
[ '17:26', 'AnY', null, null, 1, null, true ],
[ '17:26', 'aNy', null, null, 1, null, true ],
]},
];
for (var test of testData) {
@ -410,9 +474,9 @@ function checkStepUp()
[ '2012-01-02', '2', '2012-01-01', null, null, '2012-01-03', false ],
[ '2012-01-02', '2', '2012-01-01', null, 2, '2012-01-05', false ],
[ '2012-01-05', '2', '2012-01-01', '2012-01-06', null, '2012-01-05', false ],
[ '1970-01-02', '2', null, null, null, '1970-01-03', false ],
[ '1970-01-05', '3', null, null, null, '1970-01-07', false ],
[ '1970-01-03', '3', null, null, null, '1970-01-04', false ],
[ '1970-01-02', '2', null, null, null, '1970-01-04', false ],
[ '1970-01-05', '3', null, null, null, '1970-01-08', false ],
[ '1970-01-03', '3', null, null, null, '1970-01-06', false ],
[ '1970-01-03', '3', '1970-01-02', null, null, '1970-01-05', false ],
// Clamping.
[ '2012-01-01', null, '2012-01-31', null, null, '2012-01-31', false ],
@ -429,6 +493,70 @@ function checkStepUp()
[ '2012-01-01', 'AnY', null, null, 1, null, true ],
[ '2012-01-01', 'aNy', null, null, 1, null, true ],
]},
{ type: 'time', data: [
// Regular case.
[ '16:39', null, null, null, null, '16:40', false ],
// Argument testing.
[ '16:40', null, null, null, 1, '16:41', false ],
[ '16:40', null, null, null, 5, '16:45', false ],
[ '16:40', null, null, null, -1, '16:39', false ],
[ '16:40', null, null, null, 0, '16:40', false ],
// hour/minutes/seconds wrapping.
[ '04:59', null, null, null, null, '05:00', false ],
[ '04:59:59', 1, null, null, null, '05:00', false ],
[ '04:59:59.900', 0.1, null, null, null, '05:00', false ],
[ '04:59:59.990', 0.01, null, null, null, '05:00', false ],
[ '04:59:59.999', 0.001, null, null, null, '05:00', false ],
// stepUp() on '23:59' gives '00:00'.
[ '23:59', null, null, null, 1, '00:00', false ],
[ '23:59', null, null, null, 3, '00:02', false ],
// Some random step values..
[ '16:56', '0.5', null, null, null, '16:56:00.500', false ],
[ '16:56', '2', null, null, null, '16:56:02', false ],
[ '16:56', '0.25',null, null, 4, '16:56:01', false ],
[ '16:57', '1.1', '16:00', null, 1, '16:57:01', false ],
[ '16:57', '1.1', '16:00', null, 2, '16:57:02.100', false ],
[ '16:57', '1.1', '16:00', null, 10, '16:57:10.900', false ],
[ '16:57', '1.1', '16:00', null, 11, '16:57:12', false ],
[ '16:57', '1.1', '16:00', null, 8, '16:57:08.700', false ],
// Invalid @step, means that we use the default value.
[ '17:01', '0', null, null, null, '17:02', false ],
[ '17:01', '-1', null, null, null, '17:02', false ],
[ '17:01', 'foo', null, null, null, '17:02', false ],
// Min values testing.
[ '17:02', '60', 'foo', null, 2, '17:04', false ],
[ '17:10', '60', '17:09', null, null, '17:11', false ],
[ '17:10', '60', '17:10', null, null, '17:11', false ],
[ '17:10', '60', '17:30', null, 1, '17:30', false ],
[ '17:10', '180', '17:05', null, null, '17:11', false ],
[ '17:10', '300', '17:10', '17:11', null,'17:10', false ],
// Max values testing.
[ '17:15', '60', null, 'foo', null, '17:16', false ],
[ '17:15', null, null, '17:20', null, '17:16', false ],
[ '17:15', null, null, '17:15', null, '17:15', false ],
[ '17:15', null, null, '17:13', 4, '17:15', false ],
[ '17:15', '120', null, '17:13', 3, '17:15', false ],
// Step mismatch.
[ '17:19', '120', '17:10', null, null, '17:20', false ],
[ '17:19', '120', '17:10', null, 2, '17:22', false ],
[ '17:19', '120', '17:18', '17:25', null, '17:20', false ],
[ '17:19', '120', null, null, null, '17:21', false ],
[ '17:19', '180', null, null, null, '17:22', false ],
// Clamping.
[ '17:22', null, null, '17:11', null, '17:22', false ],
[ '17:22', '120', '17:20', '17:22', null, '17:22', false ],
[ '17:22', '300', '17:12', '17:20', 10, '17:22', false ],
[ '17:22', '300', '17:18', '17:20', 2, '17:22', false ],
[ '17:22', '180', '17:00', '17:20', 15, '17:22', false ],
[ '17:22', '180', '17:10', '17:20', 2, '17:22', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
// With step = 'any'.
[ '17:26', 'any', null, null, 1, null, true ],
[ '17:26', 'ANY', null, null, 1, null, true ],
[ '17:26', 'AnY', null, null, 1, null, true ],
[ '17:26', 'aNy', null, null, 1, null, true ],
]},
];
for (var test of testData) {

View File

@ -0,0 +1,27 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for HTMLMapElement attributes reflection</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="reflect.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for HTMLMapElement attributes reflection **/
// .name (String)
reflectString({
element: document.createElement("map"),
attribute: "name",
})
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for HTMLMetaElement attributes reflection</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="reflect.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for HTMLMetaElement attributes reflection **/
// .name (String)
reflectString({
element: document.createElement("meta"),
attribute: "name",
})
// .httpEquiv (String)
reflectString({
element: document.createElement("meta"),
attribute: { content: "http-equiv", idl: "httpEquiv" },
})
// .content (String)
reflectString({
element: document.createElement("meta"),
attribute: "content",
})
// .scheme (String)
reflectString({
element: document.createElement("meta"),
attribute: "scheme",
})
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,33 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for HTMLModElement attributes reflection</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="reflect.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for HTMLModElement attributes reflection **/
// TODO: cite (URL)
// .dateTime (String)
reflectString({
element: document.createElement("ins"),
attribute: "dateTime",
})
reflectString({
element: document.createElement("del"),
attribute: "dateTime",
})
</script>
</pre>
</body>
</html>

View File

@ -61,9 +61,7 @@ NS_IMETHODIMP SVGAltGlyphElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
already_AddRefed<nsIDOMSVGAnimatedString>
SVGAltGlyphElement::Href()
{
nsCOMPtr<nsIDOMSVGAnimatedString> href;
mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
return href.forget();
return mStringAttributes[HREF].ToDOMAnimatedString(this);
}
void

View File

@ -115,9 +115,7 @@ SVGGradientElement::SpreadMethod()
already_AddRefed<nsIDOMSVGAnimatedString>
SVGGradientElement::Href()
{
nsCOMPtr<nsIDOMSVGAnimatedString> href;
mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
return href.forget();
return mStringAttributes[HREF].ToDOMAnimatedString(this);
}
NS_IMETHODIMP

View File

@ -166,9 +166,7 @@ SVGImageElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
already_AddRefed<nsIDOMSVGAnimatedString>
SVGImageElement::Href()
{
nsCOMPtr<nsIDOMSVGAnimatedString> href;
mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
return href.forget();;
return mStringAttributes[HREF].ToDOMAnimatedString(this);
}
//----------------------------------------------------------------------

View File

@ -87,9 +87,7 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMPathElement)
already_AddRefed<nsIDOMSVGAnimatedString>
SVGMPathElement::Href()
{
nsCOMPtr<nsIDOMSVGAnimatedString> href;
mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
return href.forget();
return mStringAttributes[HREF].ToDOMAnimatedString(this);
}
NS_IMETHODIMP

View File

@ -113,9 +113,7 @@ SVGScriptElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
already_AddRefed<nsIDOMSVGAnimatedString>
SVGScriptElement::Href()
{
nsCOMPtr<nsIDOMSVGAnimatedString> href;
mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
return href.forget();
return mStringAttributes[HREF].ToDOMAnimatedString(this);
}
//----------------------------------------------------------------------

View File

@ -102,9 +102,7 @@ NS_IMETHODIMP SVGTextPathElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
already_AddRefed<nsIDOMSVGAnimatedString>
SVGTextPathElement::Href()
{
nsCOMPtr<nsIDOMSVGAnimatedString> href;
mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
return href.forget();
return mStringAttributes[HREF].ToDOMAnimatedString(this);
}
//----------------------------------------------------------------------

View File

@ -72,15 +72,6 @@ nsSVGClass::SetAnimValue(const nsAString& aValue, nsSVGElement *aSVGElement)
aSVGElement->DidAnimateClass();
}
nsresult
nsSVGClass::ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult,
nsSVGElement *aSVGElement)
{
*aResult = new DOMAnimatedString(this, aSVGElement);
NS_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
nsSVGClass::DOMAnimatedString::GetAnimVal(nsAString& aResult)
{

View File

@ -34,8 +34,19 @@ public:
bool IsAnimated() const
{ return !!mAnimVal; }
already_AddRefed<nsIDOMSVGAnimatedString>
ToDOMAnimatedString(nsSVGElement* aSVGElement)
{
nsRefPtr<DOMAnimatedString> result = new DOMAnimatedString(this, aSVGElement);
return result.forget();
}
nsresult ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult,
nsSVGElement *aSVGElement);
nsSVGElement *aSVGElement)
{
*aResult = ToDOMAnimatedString(aSVGElement).get();
return NS_OK;
}
// Returns a new nsISMILAttr object that the caller must delete
nsISMILAttr* ToSMILAttr(nsSVGElement *aSVGElement);

View File

@ -1163,9 +1163,7 @@ nsSVGElement::GetViewportElement()
already_AddRefed<nsIDOMSVGAnimatedString>
nsSVGElement::ClassName()
{
nsCOMPtr<nsIDOMSVGAnimatedString> className;
mClassAttribute.ToDOMAnimatedString(getter_AddRefs(className), this);
return className.forget();
return mClassAttribute.ToDOMAnimatedString(this);
}
//------------------------------------------------------------------------

View File

@ -75,6 +75,13 @@ nsSVGString::SetAnimValue(const nsAString& aValue, nsSVGElement *aSVGElement)
nsresult
nsSVGString::ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult,
nsSVGElement *aSVGElement)
{
*aResult = ToDOMAnimatedString(aSVGElement).get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedString>
nsSVGString::ToDOMAnimatedString(nsSVGElement* aSVGElement)
{
nsRefPtr<DOMAnimatedString> domAnimatedString =
sSVGAnimatedStringTearoffTable.GetTearoff(this);
@ -83,8 +90,7 @@ nsSVGString::ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult,
sSVGAnimatedStringTearoffTable.AddTearoff(this, domAnimatedString);
}
domAnimatedString.forget(aResult);
return NS_OK;
return domAnimatedString.forget();
}
nsSVGString::DOMAnimatedString::~DOMAnimatedString()

View File

@ -40,6 +40,9 @@ public:
nsresult ToDOMAnimatedString(nsIDOMSVGAnimatedString **aResult,
nsSVGElement *aSVGElement);
already_AddRefed<nsIDOMSVGAnimatedString>
ToDOMAnimatedString(nsSVGElement* aSVGElement);
// Returns a new nsISMILAttr object that the caller must delete
nsISMILAttr* ToSMILAttr(nsSVGElement *aSVGElement);

View File

@ -5373,7 +5373,7 @@ nsDocShell::GetMixedContentChannel(nsIChannel **aMixedContentChannel)
NS_IMETHODIMP
nsDocShell::GetAllowMixedContentAndConnectionData(bool* aRootHasSecureConnection, bool* aAllowMixedContent, bool* aIsRootDocShell)
{
*aRootHasSecureConnection = false;
*aRootHasSecureConnection = true;
*aAllowMixedContent = false;
*aIsRootDocShell = false;
@ -5384,29 +5384,27 @@ nsDocShell::GetAllowMixedContentAndConnectionData(bool* aRootHasSecureConnection
// now get the document from sameTypeRoot
nsCOMPtr<nsIDocument> rootDoc = do_GetInterface(sameTypeRoot);
NS_ASSERTION(rootDoc, "No root document from document shell root tree item.");
if (rootDoc) {
nsCOMPtr<nsIPrincipal> rootPrincipal = rootDoc->NodePrincipal();
nsCOMPtr<nsIPrincipal> rootPrincipal = rootDoc->NodePrincipal();
NS_ASSERTION(rootPrincipal, "No root principal from root document");
// For things with system principal (e.g. scratchpad) there is no uri
// aRootHasSecureConnection should be false.
nsCOMPtr<nsIURI> rootUri;
if (nsContentUtils::IsSystemPrincipal(rootPrincipal) ||
NS_FAILED(rootPrincipal->GetURI(getter_AddRefs(rootUri))) || !rootUri ||
NS_FAILED(rootUri->SchemeIs("https", aRootHasSecureConnection))) {
*aRootHasSecureConnection = false;
}
// For things with system principal (e.g. scratchpad) there is no uri
// aRootHasSecureConnection should remain false.
if (!nsContentUtils::IsSystemPrincipal(rootPrincipal)) {
nsCOMPtr<nsIURI> rootUri;
rootPrincipal->GetURI(getter_AddRefs(rootUri));
NS_ASSERTION(rootUri, "No root uri from root principal");
nsresult rv = rootUri->SchemeIs("https", aRootHasSecureConnection);
NS_ENSURE_SUCCESS(rv, rv);
// Check the root doc's channel against the root docShell's mMixedContentChannel to see
// if they are the same. If they are the same, the user has overriden
// the block.
nsCOMPtr<nsIDocShell> rootDocShell = do_QueryInterface(sameTypeRoot);
nsCOMPtr<nsIChannel> mixedChannel;
rootDocShell->GetMixedContentChannel(getter_AddRefs(mixedChannel));
*aAllowMixedContent = mixedChannel && (mixedChannel == rootDoc->GetChannel());
}
// Check the root doc's channel against the root docShell's mMixedContentChannel to see
// if they are the same. If they are the same, the user has overriden
// the block.
nsCOMPtr<nsIDocShell> rootDocShell = do_GetInterface(sameTypeRoot);
nsCOMPtr<nsIChannel> mixedChannel;
rootDocShell->GetMixedContentChannel(getter_AddRefs(mixedChannel));
*aAllowMixedContent = mixedChannel && (mixedChannel == rootDoc->GetChannel());
return NS_OK;
}

View File

@ -32,6 +32,33 @@ function isAbsoluteURI(aURI) {
Services.io.newURI(aURI, null, bar).prePath != bar.prePath;
}
function mozIApplication() {
}
mozIApplication.prototype = {
hasPermission: function(aPermission) {
let uri = Services.io.newURI(this.origin, null, null);
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
// This helper checks an URI inside |aApp|'s origin and part of |aApp| has a
// specific permission. It is not checking if browsers inside |aApp| have such
// permission.
let principal = secMan.getAppCodebasePrincipal(uri, this.localId,
/*mozbrowser*/false);
let perm = Services.perms.testExactPermissionFromPrincipal(principal,
aPermission);
return (perm === Ci.nsIPermissionManager.ALLOW_ACTION);
},
QueryInterface: function(aIID) {
if (aIID.equals(Ci.mozIDOMApplication) ||
aIID.equals(Ci.mozIApplication) ||
aIID.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
}
this.AppsUtils = {
// Clones a app, without the manifest.
cloneAppObject: function cloneAppObject(aApp) {
@ -68,27 +95,7 @@ this.AppsUtils = {
cloneAsMozIApplication: function cloneAsMozIApplication(aApp) {
let res = this.cloneAppObject(aApp);
res.hasPermission = function(aPermission) {
let uri = Services.io.newURI(this.origin, null, null);
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
// This helper checks an URI inside |aApp|'s origin and part of |aApp| has a
// specific permission. It is not checking if browsers inside |aApp| have such
// permission.
let principal = secMan.getAppCodebasePrincipal(uri, aApp.localId,
/*mozbrowser*/false);
let perm = Services.perms.testExactPermissionFromPrincipal(principal,
aPermission);
return (perm === Ci.nsIPermissionManager.ALLOW_ACTION);
};
res.QueryInterface = function(aIID) {
if (aIID.equals(Ci.mozIDOMApplication) ||
aIID.equals(Ci.mozIApplication) ||
aIID.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
res.__proto__ = mozIApplication.prototype;
return res;
},

View File

@ -419,18 +419,12 @@ using mozilla::dom::workers::ResolveWorkerClasses;
#include "nsIDOMPowerManager.h"
#include "nsIDOMWakeLock.h"
#include "nsIDOMSmsManager.h"
#include "nsIDOMSmsMessage.h"
#include "nsIDOMSmsEvent.h"
#include "nsIDOMMozSmsMessage.h"
#include "nsIDOMSmsRequest.h"
#include "nsIDOMSmsFilter.h"
#include "nsIDOMSmsCursor.h"
#include "nsIDOMSmsSegmentInfo.h"
#include "nsIDOMConnection.h"
#ifdef MOZ_B2G_RIL
#include "nsIDOMMobileConnection.h"
#endif
#include "USSDReceivedEvent.h"
#include "DataErrorEvent.h"
#include "mozilla/dom/network/Utils.h"
#ifdef MOZ_B2G_RIL
@ -441,7 +435,7 @@ using mozilla::dom::workers::ResolveWorkerClasses;
#include "StkCommandEvent.h"
#include "nsIDOMMozCellBroadcast.h"
#include "nsIDOMMozCellBroadcastEvent.h"
#include "CFStateChangeEvent.h"
#include "nsIDOMMobileConnection.h"
#endif // MOZ_B2G_RIL
#ifdef MOZ_B2G_FM
@ -1268,9 +1262,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(MozSmsMessage, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozSmsEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozSmsRequest, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -1292,17 +1283,8 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(MozCellBroadcast, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CFStateChangeEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif
NS_DEFINE_CLASSINFO_DATA(USSDReceivedEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DataErrorEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -3376,11 +3358,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsMessage)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozSmsEvent, nsIDOMMozSmsEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozSmsRequest, nsIDOMMozSmsRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@ -3418,23 +3395,8 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCellBroadcastEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CFStateChangeEvent, nsIDOMCFStateChangeEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCFStateChangeEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
DOM_CLASSINFO_MAP_END
#endif // MOZ_B2G_RIL
DOM_CLASSINFO_MAP_BEGIN(USSDReceivedEvent, nsIDOMUSSDReceivedEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMUSSDReceivedEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(DataErrorEvent, nsIDOMDataErrorEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataErrorEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_END
@ -3985,19 +3947,6 @@ nsDOMClassInfo::PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj)
{
*parentObj = globalObj;
nsCOMPtr<nsPIDOMWindow> piwin = do_QueryWrapper(cx, globalObj);
if (!piwin) {
return NS_OK;
}
if (piwin->IsOuterWindow()) {
nsGlobalWindow *win = ((nsGlobalWindow *)piwin.get())->
GetCurrentInnerWindowInternal();
return SetParentToWindow(win, parentObj);
}
return NS_OK;
}
@ -4544,10 +4493,10 @@ nsWindowSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
static JSClass sGlobalScopePolluterClass = {
"Global Scope Polluter",
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE,
nsWindowSH::SecurityCheckOnAddDelProp,
nsWindowSH::SecurityCheckOnAddDelProp,
JS_PropertyStub,
JS_PropertyStub,
nsWindowSH::GlobalScopePolluterGetProperty,
nsWindowSH::SecurityCheckOnSetProp,
JS_StrictPropertyStub,
JS_EnumerateStub,
(JSResolveOp)nsWindowSH::GlobalScopePolluterNewResolve,
JS_ConvertStub,
@ -4578,32 +4527,6 @@ nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JSHandleObject obj,
return JS_TRUE;
}
// static
JSBool
nsWindowSH::SecurityCheckOnAddDelProp(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
{
// Someone is accessing a element by referencing its name/id in the
// global scope, do a security check to make sure that's ok.
nsresult rv =
sSecMan->CheckPropertyAccess(cx, ::JS_GetGlobalForObject(cx, obj),
"Window", id,
nsIXPCSecurityManager::ACCESS_SET_PROPERTY);
// If !NS_SUCCEEDED(rv) the security check failed. The security
// manager set a JS exception for us.
return NS_SUCCEEDED(rv);
}
// static
JSBool
nsWindowSH::SecurityCheckOnSetProp(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
{
return SecurityCheckOnAddDelProp(cx, obj, id, vp);
}
static nsHTMLDocument*
GetDocument(JSObject *obj)
{

View File

@ -347,10 +347,6 @@ public:
JSMutableHandleObject objp);
static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSHandleObject obj,
JSHandleId id, JSMutableHandleValue vp);
static JSBool SecurityCheckOnAddDelProp(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp);
static JSBool SecurityCheckOnSetProp(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSBool strict, JSMutableHandleValue vp);
static JSBool InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj);
static nsresult InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
nsIHTMLDocument *doc);

View File

@ -314,7 +314,6 @@ DOMCI_CLASS(MozWakeLock)
DOMCI_CLASS(MozSmsManager)
DOMCI_CLASS(MozSmsMessage)
DOMCI_CLASS(MozSmsEvent)
DOMCI_CLASS(MozSmsRequest)
DOMCI_CLASS(MozSmsFilter)
DOMCI_CLASS(MozSmsCursor)
@ -324,13 +323,8 @@ DOMCI_CLASS(MozConnection)
#ifdef MOZ_B2G_RIL
DOMCI_CLASS(MozMobileConnection)
DOMCI_CLASS(MozCellBroadcast)
DOMCI_CLASS(CFStateChangeEvent)
#endif
DOMCI_CLASS(USSDReceivedEvent)
DOMCI_CLASS(DataErrorEvent)
// @font-face in CSS
DOMCI_CLASS(CSSFontFaceRule)

View File

@ -419,6 +419,18 @@ DOMInterfaces = {
'hasInstanceInterface': 'nsIDOMHTMLLIElement',
},
'HTMLMapElement': {
'hasInstanceInterface': 'nsIDOMHTMLMapElement',
},
'HTMLMetaElement': {
'hasInstanceInterface': 'nsIDOMHTMLMetaElement',
},
'HTMLModElement': {
'hasInstanceInterface': 'nsIDOMHTMLModElement',
},
'HTMLOListElement': {
'headerFile' : 'mozilla/dom/HTMLSharedListElement.h',
'hasInstanceInterface': 'nsIDOMHTMLOListElement'

View File

@ -236,7 +236,6 @@ const ContentPanning = {
if (!isPan) {
// If panning distance is not large enough, both BES and APZC
// should not perform scrolling
evt.preventDefault();
return;
}

View File

@ -93,6 +93,9 @@ function testEtwsMessageAttributes() {
cbs.addEventListener("received", function onreceived(event) {
cbs.removeEventListener("received", onreceived);
// Bug 838542: following check throws an exception and fails this case.
// ok(event instanceof MozCellBroadcastEvent,
// "event is instanceof " + event.constructor)
ok(event, "event is valid");
let message = event.message;

View File

@ -148,6 +148,9 @@ function testGsmMessageAttributes() {
cbs.addEventListener("received", function onreceived(event) {
cbs.removeEventListener("received", onreceived);
// Bug 838542: following check throws an exception and fails this case.
// ok(event instanceof MozCellBroadcastEvent,
// "event is instanceof " + event.constructor)
ok(event, "event is valid");
let message = event.message;

View File

@ -1378,21 +1378,18 @@
"[[\"stylewithcss\",\"true\"],[\"fontname\",\"sans-serif\"]] \"<span style=font-family:monospace>fo[o</span><kbd>b]ar</kbd>\" queryCommandValue(\"fontname\") before":true,
"[[\"stylewithcss\",\"false\"],[\"fontname\",\"sans-serif\"]] \"<span style=font-family:monospace>fo[o</span><kbd>b]ar</kbd>\" queryCommandValue(\"fontname\") before":true,
"[[\"fontsize\",\"4\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo</p> <p>bar]</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo</p> <p>bar]</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo</p> <p>bar]</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p>[foo</p> <p>bar]</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span>[foo</span> <span>bar]</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span>[foo</span> <span>bar]</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span>[foo</span> <span>bar]</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<span>[foo</span> <span>bar]</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p>[foo<p><br><p>bar]\" queryCommandIndeterm(\"fontsize\") after":true,
@ -1401,29 +1398,29 @@
"[[\"fontsize\",\"4\"]] \"<span>foo</span>{}<span>bar</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"]] \"<span>foo[</span><span>]bar</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"]] \"<span>foo[</span><span>]bar</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar<b>baz]qoz</b>quz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar<b>baz]qoz</b>quz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar<b>baz]qoz</b>quz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo[bar<b>baz]qoz</b>quz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar<i>baz]qoz</i>quz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar<i>baz]qoz</i>quz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[bar<i>baz]qoz</i>quz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo[bar<i>baz]qoz</i>quz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"{<p><p> <p>foo</p>}\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"{<p><p> <p>foo</p>}\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"{<p><p> <p>foo</p>}\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"{<p><p> <p>foo</p>}\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"0\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-5\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-5\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-5\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"-5\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"6\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"6\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"6\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"6\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"7\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"7\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
@ -1441,184 +1438,172 @@
"[[\"fontsize\",\"20pt\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"xx-large\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"xx-large\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\" 1 \"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\" 1 \"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\" 1 \"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\" 1 \"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"1.\"]] \"foo[bar]baz\": execCommand(\"fontsize\", false, \"1.\") return value":true,
"[[\"fontsize\",\"1.\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"fontsize\",\"1.\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"1.\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.0\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"1.0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.0e2\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.0e2\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.0e2\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"1.0e2\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.1\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"1.1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.9\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"1.9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"1.9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"+0\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"fontsize\",\"+0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"+1\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"+1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"+1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"+1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"+9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"+9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"-0\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"fontsize\",\"-0\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-1\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"-1\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-9\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"-9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"-9\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"\"]] \"foo[bar]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"{<table><tr><td>foo<td>bar<td>baz</table>}\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"{<table><tr><td>foo<td>bar<td>baz</table>}\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"{<table><tr><td>foo<td>bar<td>baz</table>}\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"{<table><tr><td>foo<td>bar<td>baz</table>}\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=1>[bar]</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=1>foo[bar]baz</font>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=3>[bar]</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=3>foo[bar]baz</font>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=4>[bar]</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"]] \"<font size=4>foo[bar]baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=1>[bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=1>foo[bar]baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=3>[bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=3>foo[bar]baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=4>[bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=+1>[bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=+1>[bar]</font>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=+1>[bar]</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<font size=+1>[bar]</font>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"]] \"<font size=+1>foo[bar]baz</font>\" compare innerHTML":true,
"[[\"fontsize\",\"4\"]] \"<font size=+1>foo[bar]baz</font>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=4>foo<font size=1>b[a]r</font>baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=4>foo<font size=1>b[a]r</font>baz</font>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<font size=4>foo<font size=1>b[a]r</font>baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: xx-small\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: xx-small\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: xx-small\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: xx-small\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: xx-small\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: xx-small\\\">foo[bar]baz</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: xx-small\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: xx-small\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: xx-small\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: medium\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: medium\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: medium\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: medium\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: medium\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: medium\\\">foo[bar]baz</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: medium\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: medium\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: medium\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: large\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: large\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: large\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: large\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: large\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo[bar]baz</span>\" compare innerHTML":true,
"[[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo<span style=\\\"font-size: xx-small\\\">b[a]r</span>baz</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo<span style=\\\"font-size: xx-small\\\">b[a]r</span>baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo<span style=\\\"font-size: xx-small\\\">b[a]r</span>baz</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo<span style=\\\"font-size: xx-small\\\">b[a]r</span>baz</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: large\\\">foo<span style=\\\"font-size: xx-small\\\">b[a]r</span>baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: 2em\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: 2em\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: 2em\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: 2em\\\">[bar]</span>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"foo<span style=\\\"font-size: 2em\\\">[bar]</span>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: 2em\\\">foo[bar]baz</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: 2em\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: 2em\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<span style=\\\"font-size: 2em\\\">foo[bar]baz</span>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: medium\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: medium\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: medium\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: medium\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: xx-small\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: medium\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: medium\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: large\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<p style=\\\"font-size: 2em\\\">foo[bar]baz</p>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<font size=6>foo <span style=\\\"font-size: 2em\\\">b[a]r</span> baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<font size=6>foo <span style=\\\"font-size: 2em\\\">b[a]r</span> baz</font>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"<font size=6>foo <span style=\\\"font-size: 2em\\\">b[a]r</span> baz</font>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<font size=6>foo <span style=\\\"font-size: 2em\\\">b[a]r</span> baz</font>\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"<font size=6>foo <span style=\\\"font-size: 2em\\\">b[a]r</span> baz</font>\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<big>[bar]</big>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<big>[bar]</big>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<big>[bar]</big>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"foo<big>[bar]</big>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"foo<big>[bar]</big>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<big>b[a]r</big>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<big>b[a]r</big>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<big>b[a]r</big>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"foo<big>b[a]r</big>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<small>[bar]</small>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<small>[bar]</small>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<small>[bar]</small>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"foo<small>[bar]</small>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"foo<small>[bar]</small>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<small>b[a]r</small>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<small>b[a]r</small>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"3\"]] \"foo<small>b[a]r</small>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"3\"]] \"foo<small>b[a]r</small>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>b]ar</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>b]ar</font>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>b]ar</font>baz\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>b]ar</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>b]ar</font>baz\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>ba[r</font>b]az\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>ba[r</font>b]az\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>ba[r</font>b]az\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>bar</font>b]az\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>bar</font>b]az\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>bar</font>b]az\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"fo[o<font size=2>bar</font>b]az\" queryCommandValue(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[<font size=2>b]ar</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>ba[r</font>]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[<font size=2>bar</font>]baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>[bar]</font>baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo{<font size=2>bar</font>}baz\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=1>fo[o</font><span style=font-size:xx-small>b]ar</span>\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=1>fo[o</font><span style=font-size:xx-small>b]ar</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[<font size=2>b]ar</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>ba[r</font>]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo[<font size=2>bar</font>]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo<font size=2>[bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"foo{<font size=2>bar</font>}baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=1>fo[o</font><span style=font-size:xx-small>b]ar</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=2>fo[o</font><span style=font-size:small>b]ar</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=2>fo[o</font><span style=font-size:small>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=2>fo[o</font><span style=font-size:small>b]ar</span>\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=2>fo[o</font><span style=font-size:small>b]ar</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<font size=2>fo[o</font><span style=font-size:small>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=3>fo[o</font><span style=font-size:medium>b]ar</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=3>fo[o</font><span style=font-size:medium>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=3>fo[o</font><span style=font-size:medium>b]ar</span>\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=3>fo[o</font><span style=font-size:medium>b]ar</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<font size=3>fo[o</font><span style=font-size:medium>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"]] \"<font size=4>fo[o</font><span style=font-size:large>b]ar</span>\" compare innerHTML":true,
"[[\"fontsize\",\"4\"]] \"<font size=4>fo[o</font><span style=font-size:large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=5>fo[o</font><span style=font-size:x-large>b]ar</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=5>fo[o</font><span style=font-size:x-large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=5>fo[o</font><span style=font-size:x-large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=5>fo[o</font><span style=font-size:x-large>b]ar</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<font size=5>fo[o</font><span style=font-size:x-large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=6>fo[o</font><span style=font-size:xx-large>b]ar</span>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=6>fo[o</font><span style=font-size:xx-large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=6>fo[o</font><span style=font-size:xx-large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") after":true,
"[[\"stylewithcss\",\"true\"],[\"fontsize\",\"4\"]] \"<font size=6>fo[o</font><span style=font-size:xx-large>b]ar</span>\" queryCommandValue(\"fontsize\") after":true,
"[[\"stylewithcss\",\"false\"],[\"fontsize\",\"4\"]] \"<font size=6>fo[o</font><span style=font-size:xx-large>b]ar</span>\" queryCommandIndeterm(\"fontsize\") before":true,
"[[\"stylewithcss\",\"false\"],[\"forecolor\",\"#0000FF\"]] \"<p>[foo</p> <p>bar]</p>\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"forecolor\",\"#0000FF\"]] \"<span>[foo</span> <span>bar]</span>\" compare innerHTML":true,

View File

@ -325,8 +325,6 @@ NS_NewDOMAnimationEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresCo
nsresult
NS_NewDOMTouchEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, class nsTouchEvent *aEvent);
nsresult
NS_NewDOMSmsEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);
nsresult
NS_NewDOMMozSettingsEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);
nsresult
NS_NewDOMMozApplicationEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);

View File

@ -16,7 +16,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(526C4DC4-25CD-46DE-A9B2-1501D624F7DF)]
[scriptable, builtinclass, uuid(526C4DC4-25CD-46DE-A9B2-1501D624F7DF)]
interface nsIDOMHTMLTableCaptionElement : nsIDOMHTMLElement
{
attribute DOMString align;

View File

@ -16,7 +16,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(006D2482-0B89-401B-9A16-EDE4D9971F02)]
[scriptable, builtinclass, uuid(006D2482-0B89-401B-9A16-EDE4D9971F02)]
interface nsIDOMHTMLTableSectionElement : nsIDOMHTMLElement
{
attribute DOMString align;

View File

@ -40,14 +40,14 @@ FormValidationInvalidURL=Please enter a URL.
FormValidationPatternMismatch=Please match the requested format.
# LOCALIZATION NOTE (FormValidationPatternMismatchWithTitle): %S is the (possibly truncated) title attribute value.
FormValidationPatternMismatchWithTitle=Please match the requested format: %S.
# LOCALIZATION NOTE (FormValidationRangeOverflow): %S can be a number or a date.
# LOCALIZATION NOTE (FormValidationRangeOverflow): %S can be a number, a date or a time.
FormValidationRangeOverflow=Please select a value that is lower than %S.
# LOCALIZATION NOTE (FormValidationRangeUnderflow): %S can be a number or a date.
# LOCALIZATION NOTE (FormValidationRangeUnderflow): %S can be a number, a date or a time.
FormValidationRangeUnderflow=Please select a value that is higher than %S.
# LOCALIZATION NOTE (FormValidationStepMismatch): both %S can be a number or a date.
# LOCALIZATION NOTE (FormValidationStepMismatch): both %S can be a number, a date or a time.
FormValidationStepMismatch=Please select a valid value. The two nearest valid values are %S and %S.
# LOCALIZATION NOTE (FormValidationStepMismatchWitoutMax): %S can be a number or a date. This is called instead of FormValidationStepMismatch when the second value isn't valid because it's higher than the maximum allowed value.
FormValidationStepMismatchWithoutMax=Please select a valid value. The nearest valid value is %S.
# LOCALIZATION NOTE (FormValidationStepMismatchOneValue): %S can be a number, a date or a time. This is called instead of FormValidationStepMismatch when the second value is the same as the first.
FormValidationStepMismatchOneValue=Please select a valid value. The nearest valid value is %S.
GetAttributeNodeWarning=Use of getAttributeNode() is deprecated. Use getAttribute() instead.
SetAttributeNodeWarning=Use of setAttributeNode() is deprecated. Use setAttribute() instead.
GetAttributeNodeNSWarning=Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead.

View File

@ -4,7 +4,7 @@
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(9342c4eb-b6b3-414c-892f-c3630ce35c40)]
[scriptable, builtinclass, uuid(905348f1-3d06-443c-8762-567e7e4b6696)]
interface nsIDOMCFStateChangeEvent : nsIDOMEvent
{
/**
@ -51,4 +51,24 @@ interface nsIDOMCFStateChangeEvent : nsIDOMEvent
* nsIDOMMozMobileConnectionInfo.ICC_SERVICE_CLASS_* values.
*/
readonly attribute unsigned short serviceClass;
[noscript] void initCFStateChangeEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in boolean aSuccess,
in unsigned short aAction,
in unsigned short aReason,
in DOMString aNumber,
in unsigned short aTimeSeconds,
in unsigned short aServiceClass);
};
dictionary CFStateChangeEventInit : EventInit
{
boolean success;
unsigned short action;
unsigned short reason;
DOMString number;
unsigned short timeSeconds;
unsigned short serviceClass;
};

View File

@ -4,8 +4,18 @@
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(494cf68f-0ca8-4cf9-924b-84cf379c9631)]
[scriptable, builtinclass, uuid(8b4ed443-a6b0-4445-aab0-9aa9fd5f6c1e)]
interface nsIDOMDataErrorEvent : nsIDOMEvent
{
readonly attribute DOMString message;
[noscript] void initDataErrorEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aMessage);
};
dictionary DataErrorEventInit : EventInit
{
DOMString message;
};

View File

@ -4,9 +4,21 @@
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(56e18850-96f1-4898-a0de-47e0c994c4ab)]
[scriptable, builtinclass, uuid(d26880c8-0468-4abb-94a6-9143defb5545)]
interface nsIDOMUSSDReceivedEvent : nsIDOMEvent
{
readonly attribute DOMString message;
[infallible] readonly attribute boolean sessionEnded;
[noscript] void initUSSDReceivedEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aMessage,
in boolean aSessionEnded);
};
dictionary USSDReceivedEventInit : EventInit
{
DOMString message;
boolean sessionEnded;
};

View File

@ -1,90 +0,0 @@
/* 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/. */
#include "CFStateChangeEvent.h"
#include "nsIDOMClassInfo.h"
#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h"
DOMCI_DATA(CFStateChangeEvent, mozilla::dom::network::CFStateChangeEvent)
namespace mozilla {
namespace dom {
namespace network {
already_AddRefed<CFStateChangeEvent>
CFStateChangeEvent::Create(bool aSuccess,
uint16_t aAction,
uint16_t aReason,
nsAString& aNumber,
uint16_t aTimeSeconds,
uint16_t aServiceClass)
{
NS_ASSERTION(!aNumber.IsEmpty(), "Empty number!");
nsRefPtr<CFStateChangeEvent> event = new CFStateChangeEvent();
event->mSuccess = aSuccess;
event->mAction = aAction;
event->mReason = aReason;
event->mNumber = aNumber;
event->mTimeSeconds = aTimeSeconds;
event->mServiceClass = aServiceClass;
return event.forget();
}
NS_IMPL_ADDREF_INHERITED(CFStateChangeEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(CFStateChangeEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN(CFStateChangeEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMCFStateChangeEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CFStateChangeEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
CFStateChangeEvent::GetSuccess(bool* aSuccess)
{
*aSuccess = mSuccess;
return NS_OK;
}
NS_IMETHODIMP
CFStateChangeEvent::GetAction(uint16_t* aAction)
{
*aAction = mAction;
return NS_OK;
}
NS_IMETHODIMP
CFStateChangeEvent::GetReason(uint16_t* aReason)
{
*aReason = mReason;
return NS_OK;
}
NS_IMETHODIMP
CFStateChangeEvent::GetNumber(nsAString& aNumber)
{
aNumber.Assign(mNumber);
return NS_OK;
}
NS_IMETHODIMP
CFStateChangeEvent::GetTimeSeconds(uint16_t* aTimeSeconds)
{
*aTimeSeconds = mTimeSeconds;
return NS_OK;
}
NS_IMETHODIMP
CFStateChangeEvent::GetServiceClass(uint16_t* aServiceClass)
{
*aServiceClass = mServiceClass;
return NS_OK;
}
}
}
}

View File

@ -1,70 +0,0 @@
/* 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/. */
#ifndef mozilla_dom_network_cfstatechangeevent_h
#define mozilla_dom_network_cfstatechangeevent_h
#include "nsIDOMCFStateChangeEvent.h"
#include "nsDOMEvent.h"
namespace mozilla {
namespace dom {
namespace network {
class CFStateChangeEvent : public nsDOMEvent,
public nsIDOMCFStateChangeEvent
{
bool mSuccess;
uint16_t mAction;
uint16_t mReason;
nsString mNumber;
uint16_t mTimeSeconds;
uint16_t mServiceClass;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIDOMCFSTATECHANGEEVENT
static already_AddRefed<CFStateChangeEvent>
Create(bool aSuccess,
uint16_t aAction,
uint16_t aReason,
nsAString& aNumber,
uint16_t aTimeSeconds,
uint16_t aServiceClass);
nsresult
Dispatch(nsIDOMEventTarget* aTarget, const nsAString& aEventType)
{
NS_ASSERTION(aTarget, "Null pointer!");
NS_ASSERTION(!aEventType.IsEmpty(), "Empty event type!");
nsresult rv = InitEvent(aEventType, false, false);
NS_ENSURE_SUCCESS(rv, rv);
SetTrusted(true);
nsDOMEvent* thisEvent = this;
bool dummy;
rv = aTarget->DispatchEvent(thisEvent, &dummy);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
private:
CFStateChangeEvent()
: nsDOMEvent(nullptr, nullptr)
{ }
~CFStateChangeEvent()
{ }
};
}
}
}
#endif // mozilla_dom_network_cfstatechangeevent_h

View File

@ -1,43 +0,0 @@
/* 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/. */
#include "DataErrorEvent.h"
#include "nsIDOMClassInfo.h"
DOMCI_DATA(DataErrorEvent, mozilla::dom::network::DataErrorEvent)
namespace mozilla {
namespace dom {
namespace network {
already_AddRefed<DataErrorEvent>
DataErrorEvent::Create(nsAString& aMessage)
{
NS_ASSERTION(!aMessage.IsEmpty(), "Empty message!");
nsRefPtr<DataErrorEvent> event = new DataErrorEvent();
event->mMessage = aMessage;
return event.forget();
}
NS_IMPL_ADDREF_INHERITED(DataErrorEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(DataErrorEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN(DataErrorEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDataErrorEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DataErrorEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
DataErrorEvent::GetMessage(nsAString& aMessage)
{
aMessage.Assign(mMessage);
return NS_OK;
}
}
}
}

View File

@ -1,61 +0,0 @@
/* 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/. */
#ifndef mozilla_dom_network_dataerrorevent_h
#define mozilla_dom_network_dataerrorevent_h
#include "nsIDOMDataErrorEvent.h"
#include "nsDOMEvent.h"
namespace mozilla {
namespace dom {
namespace network {
class DataErrorEvent : public nsDOMEvent,
public nsIDOMDataErrorEvent
{
nsString mMessage;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIDOMDATAERROREVENT
static already_AddRefed<DataErrorEvent>
Create(nsAString& aMessage);
nsresult
Dispatch(nsIDOMEventTarget* aTarget, const nsAString& aEventType)
{
NS_ASSERTION(aTarget, "Null pointer!");
NS_ASSERTION(!aEventType.IsEmpty(), "Empty event type!");
nsresult rv = InitEvent(aEventType, false, false);
NS_ENSURE_SUCCESS(rv, rv);
SetTrusted(true);
nsDOMEvent* thisEvent = this;
bool dummy;
rv = aTarget->DispatchEvent(thisEvent, &dummy);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
private:
DataErrorEvent()
: nsDOMEvent(nullptr, nullptr)
{ }
~DataErrorEvent()
{ }
};
}
}
}
#endif // mozilla_dom_network_dataerrorevent_h

View File

@ -49,8 +49,6 @@ EXPORTS_mozilla/dom/network = \
CPPSRCS = \
Connection.cpp \
Utils.cpp \
USSDReceivedEvent.cpp \
DataErrorEvent.cpp \
TCPSocketParent.cpp \
TCPSocketChild.cpp \
$(NULL)
@ -58,7 +56,6 @@ CPPSRCS = \
ifdef MOZ_B2G_RIL
CPPSRCS += \
MobileConnection.cpp \
CFStateChangeEvent.cpp \
$(NULL)
endif

View File

@ -7,13 +7,13 @@
#include "nsIDOMClassInfo.h"
#include "nsDOMEvent.h"
#include "nsIObserverService.h"
#include "USSDReceivedEvent.h"
#include "DataErrorEvent.h"
#include "nsIDOMUSSDReceivedEvent.h"
#include "nsIDOMDataErrorEvent.h"
#include "nsIDOMCFStateChangeEvent.h"
#include "mozilla/Services.h"
#include "IccManager.h"
#include "GeneratedEvents.h"
#include "nsIDOMICCCardLockErrorEvent.h"
#include "CFStateChangeEvent.h"
#include "nsContentUtils.h"
#include "nsJSUtils.h"
@ -170,25 +170,29 @@ MobileConnection::Observe(nsISupports* aSubject,
bool ok = dict.Init(nsDependentString(aData));
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
nsRefPtr<USSDReceivedEvent> event =
USSDReceivedEvent::Create(dict.mMessage, dict.mSessionEnded);
NS_ASSERTION(event, "This should never fail!");
nsresult rv = event->Dispatch(ToIDOMEventTarget(), USSDRECEIVED_EVENTNAME);
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMUSSDReceivedEvent(getter_AddRefs(event), nullptr, nullptr);
nsCOMPtr<nsIDOMUSSDReceivedEvent> ce = do_QueryInterface(event);
nsresult rv = ce->InitUSSDReceivedEvent(USSDRECEIVED_EVENTNAME,
false, false,
dict.mMessage, dict.mSessionEnded);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
return DispatchTrustedEvent(ce);
}
if (!strcmp(aTopic, kDataErrorTopic)) {
nsString dataerror;
dataerror.Assign(aData);
nsRefPtr<DataErrorEvent> event = DataErrorEvent::Create(dataerror);
NS_ASSERTION(event, "This should never fail!");
nsresult rv =
event->Dispatch(ToIDOMEventTarget(), DATAERROR_EVENTNAME);
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMDataErrorEvent(getter_AddRefs(event), nullptr, nullptr);
nsCOMPtr<nsIDOMDataErrorEvent> ce = do_QueryInterface(event);
nsresult rv = ce->InitDataErrorEvent(DATAERROR_EVENTNAME,
false, false, dataerror);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
return DispatchTrustedEvent(ce);
}
if (!strcmp(aTopic, kIccCardLockErrorTopic)) {
@ -250,18 +254,18 @@ MobileConnection::Observe(nsISupports* aSubject,
bool ok = dict.Init(nsDependentString(aData));
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
nsRefPtr<CFStateChangeEvent> event =
CFStateChangeEvent::Create(dict.mSuccess,
dict.mAction,
dict.mReason,
dict.mNumber,
dict.mTimeSeconds,
dict.mServiceClass);
NS_ASSERTION(event, "This should never fail!");
nsresult rv = event->Dispatch(ToIDOMEventTarget(), CFSTATECHANGE_EVENTNAME);
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMCFStateChangeEvent(getter_AddRefs(event), nullptr, nullptr);
nsCOMPtr<nsIDOMCFStateChangeEvent> ce = do_QueryInterface(event);
nsresult rv = ce->InitCFStateChangeEvent(CFSTATECHANGE_EVENTNAME,
false, false,
dict.mSuccess, dict.mAction,
dict.mReason, dict.mNumber,
dict.mTimeSeconds,
dict.mServiceClass);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
return DispatchTrustedEvent(ce);
}
MOZ_NOT_REACHED("Unknown observer topic!");

View File

@ -1,53 +0,0 @@
/* 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/. */
#include "USSDReceivedEvent.h"
#include "nsIDOMClassInfo.h"
#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h"
DOMCI_DATA(USSDReceivedEvent, mozilla::dom::network::USSDReceivedEvent)
namespace mozilla {
namespace dom {
namespace network {
already_AddRefed<USSDReceivedEvent>
USSDReceivedEvent::Create(nsAString& aMessage, bool aSessionEnded)
{
NS_ASSERTION(!aMessage.IsEmpty(), "Empty message!");
nsRefPtr<USSDReceivedEvent> event = new USSDReceivedEvent();
event->mMessage = aMessage;
event->mSessionEnded = aSessionEnded;
return event.forget();
}
NS_IMPL_ADDREF_INHERITED(USSDReceivedEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(USSDReceivedEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN(USSDReceivedEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMUSSDReceivedEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(USSDReceivedEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
USSDReceivedEvent::GetMessage(nsAString& aMessage)
{
aMessage.Assign(mMessage);
return NS_OK;
}
/* [infallible] */ NS_IMETHODIMP
USSDReceivedEvent::GetSessionEnded(bool* aSessionEnded)
{
*aSessionEnded = mSessionEnded;
return NS_OK;
}
}
}
}

View File

@ -1,62 +0,0 @@
/* 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/. */
#ifndef mozilla_dom_network_ussdreceivedevent_h
#define mozilla_dom_network_ussdreceivedevent_h
#include "nsIDOMUSSDReceivedEvent.h"
#include "nsDOMEvent.h"
namespace mozilla {
namespace dom {
namespace network {
class USSDReceivedEvent : public nsDOMEvent,
public nsIDOMUSSDReceivedEvent
{
nsString mMessage;
bool mSessionEnded;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIDOMUSSDRECEIVEDEVENT
static already_AddRefed<USSDReceivedEvent>
Create(nsAString& aMessage, bool aSessionEnded);
nsresult
Dispatch(nsIDOMEventTarget* aTarget, const nsAString& aEventType)
{
NS_ASSERTION(aTarget, "Null pointer!");
NS_ASSERTION(!aEventType.IsEmpty(), "Empty event type!");
nsresult rv = InitEvent(aEventType, false, false);
NS_ENSURE_SUCCESS(rv, rv);
SetTrusted(true);
nsDOMEvent* thisEvent = this;
bool dummy;
rv = aTarget->DispatchEvent(thisEvent, &dummy);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
private:
USSDReceivedEvent()
: nsDOMEvent(nullptr, nullptr)
{ }
~USSDReceivedEvent()
{ }
};
}
}
}
#endif // mozilla_dom_network_ussdreceivedevent_h

View File

@ -16,8 +16,8 @@ include $(topsrcdir)/dom/dom-config.mk
XPIDLSRCS = \
nsIDOMNavigatorSms.idl \
nsIDOMSmsManager.idl \
nsIDOMSmsMessage.idl \
nsIDOMSmsEvent.idl \
nsIDOMMozSmsMessage.idl \
nsIDOMMozSmsEvent.idl \
nsIDOMSmsRequest.idl \
nsIDOMSmsFilter.idl \
nsIDOMSmsCursor.idl \

View File

@ -0,0 +1,23 @@
/* 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/. */
#include "nsIDOMEvent.idl"
interface nsIDOMMozSmsMessage;
[scriptable, builtinclass, uuid(f12f9208-0abd-4d95-9a27-93a74b5e47a2)]
interface nsIDOMMozSmsEvent : nsIDOMEvent
{
readonly attribute nsIDOMMozSmsMessage message;
[noscript] void initMozSmsEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in nsIDOMMozSmsMessage aMessage);
};
dictionary MozSmsEventInit : EventInit
{
nsIDOMMozSmsMessage message;
};

View File

@ -1,15 +0,0 @@
/* 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/. */
#include "nsISupports.idl"
#include "nsIDOMEvent.idl"
interface nsIDOMMozSmsMessage;
[scriptable, builtinclass, uuid(89a5cdbc-5e43-4f9a-8d2c-64a582d64416)]
interface nsIDOMMozSmsEvent : nsIDOMEvent
{
[binaryname(MessageMoz)]
readonly attribute nsIDOMMozSmsMessage message;
};

View File

@ -59,7 +59,6 @@ CPPSRCS = \
SmsServicesFactory.cpp \
SmsParent.cpp \
SmsMessage.cpp \
SmsEvent.cpp \
Constants.cpp \
SmsChild.cpp \
SmsRequest.cpp \

View File

@ -6,7 +6,7 @@
#include "SmsCursor.h"
#include "nsIDOMClassInfo.h"
#include "nsError.h"
#include "nsIDOMSmsMessage.h"
#include "nsIDOMMozSmsMessage.h"
#include "SmsRequest.h"
#include "nsIMobileMessageDatabaseService.h"

View File

@ -1,63 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "SmsEvent.h"
#include "nsIDOMClassInfo.h"
#include "nsIDOMSmsMessage.h"
DOMCI_DATA(MozSmsEvent, mozilla::dom::sms::SmsEvent)
namespace mozilla {
namespace dom {
namespace sms {
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SmsEvent, nsDOMEvent)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessage)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(SmsEvent, nsDOMEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessage)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(SmsEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(SmsEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(SmsEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozSmsEvent)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMozSmsEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozSmsEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
nsresult
SmsEvent::Init(const nsAString& aEventTypeArg, bool aCanBubbleArg,
bool aCancelableArg, nsIDOMMozSmsMessage* aMessage)
{
nsresult rv = nsDOMEvent::InitEvent(aEventTypeArg, aCanBubbleArg,
aCancelableArg);
NS_ENSURE_SUCCESS(rv, rv);
mMessage = aMessage;
return NS_OK;
}
NS_IMETHODIMP
SmsEvent::GetMessageMoz(nsIDOMMozSmsMessage** aMessage)
{
NS_IF_ADDREF(*aMessage = mMessage);
return NS_OK;
}
} // namespace sms
} // namespace dom
} // namespace mozilla
nsresult
NS_NewDOMSmsEvent(nsIDOMEvent** aInstancePtrResult,
nsPresContext* aPresContext,
nsEvent* aEvent)
{
return CallQueryInterface(new mozilla::dom::sms::SmsEvent(aPresContext, aEvent),
aInstancePtrResult);
}

View File

@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_dom_sms_SmsEvent_h
#define mozilla_dom_sms_SmsEvent_h
#include "nsIDOMSmsEvent.h"
#include "nsDOMEvent.h"
class nsIDOMMozSmsMessage;
namespace mozilla {
namespace dom {
namespace sms {
class SmsEvent : public nsIDOMMozSmsEvent
, public nsDOMEvent
{
public:
SmsEvent(nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aPresContext, aEvent)
, mMessage(nullptr)
{}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMMOZSMSEVENT
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SmsEvent, nsDOMEvent)
nsresult Init(const nsAString & aEventTypeArg, bool aCanBubbleArg,
bool aCancelableArg, nsIDOMMozSmsMessage* aMessage);
private:
nsCOMPtr<nsIDOMMozSmsMessage> mMessage;
};
} // namespace sms
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_sms_SmsEvent_h

View File

@ -11,14 +11,15 @@
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "Constants.h"
#include "SmsEvent.h"
#include "nsIDOMSmsMessage.h"
#include "nsIDOMMozSmsEvent.h"
#include "nsIDOMMozSmsMessage.h"
#include "SmsRequest.h"
#include "nsJSUtils.h"
#include "nsContentUtils.h"
#include "nsIMobileMessageDatabaseService.h"
#include "nsIXPConnect.h"
#include "nsIPermissionManager.h"
#include "GeneratedEvents.h"
#define RECEIVED_EVENT_NAME NS_LITERAL_STRING("received")
#define SENDING_EVENT_NAME NS_LITERAL_STRING("sending")
@ -318,9 +319,13 @@ SmsManager::GetThreadList(nsIDOMMozSmsRequest** aRequest)
nsresult
SmsManager::DispatchTrustedSmsEventToSelf(const nsAString& aEventName, nsIDOMMozSmsMessage* aMessage)
{
nsRefPtr<nsDOMEvent> event = new SmsEvent(nullptr, nullptr);
nsresult rv = static_cast<SmsEvent*>(event.get())->Init(aEventName, false,
false, aMessage);
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMMozSmsEvent(getter_AddRefs(event), nullptr, nullptr);
NS_ASSERTION(event, "This should never fail!");
nsCOMPtr<nsIDOMMozSmsEvent> se = do_QueryInterface(event);
MOZ_ASSERT(se);
nsresult rv = se->InitMozSmsEvent(aEventName, false, false, aMessage);
NS_ENSURE_SUCCESS(rv, rv);
return DispatchTrustedEvent(event);

View File

@ -7,7 +7,7 @@
#define mozilla_dom_sms_SmsMessage_h
#include "mozilla/dom/sms/PSms.h"
#include "nsIDOMSmsMessage.h"
#include "nsIDOMMozSmsMessage.h"
#include "nsString.h"
#include "jspubtd.h"
#include "Types.h"

View File

@ -8,7 +8,7 @@
#include "nsDOMEvent.h"
#include "nsDOMString.h"
#include "nsContentUtils.h"
#include "nsIDOMSmsMessage.h"
#include "nsIDOMMozSmsMessage.h"
#include "nsIScriptGlobalObject.h"
#include "nsPIDOMWindow.h"
#include "SmsCursor.h"

View File

@ -8,7 +8,7 @@
#include "nsIObserverService.h"
#include "mozilla/Services.h"
#include "Constants.h"
#include "nsIDOMSmsMessage.h"
#include "nsIDOMMozSmsMessage.h"
#include "mozilla/unused.h"
#include "SmsMessage.h"
#include "nsIMobileMessageDatabaseService.h"

View File

@ -104,8 +104,10 @@ function doSendMessageAndCheckSuccess(receivers, body, callback) {
function onSmsSending(event) {
log("SmsManager.onsending event received.");
ok(event instanceof MozSmsEvent,
"event is instanceof " + event.constructor);
// Bug 838542: following check throws an exception and fails this case.
// ok(event instanceof MozSmsEvent,
// "event is instanceof " + event.constructor)
ok(event, "event is valid");
let message = event.message;
checkMessage(message, "sending", body);
@ -133,8 +135,10 @@ function doSendMessageAndCheckSuccess(receivers, body, callback) {
function onSmsSent(event) {
log("SmsManager.onsent event received.");
ok(event instanceof MozSmsEvent,
"event is instanceof " + event.constructor);
// Bug 838542: following check throws an exception and fails this case.
// ok(event instanceof MozSmsEvent,
// "event is instanceof " + event.constructor)
ok(event, "event is valid");
checkSentMessage(event.message, "onSentCalled");
}

View File

@ -25,7 +25,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService",
const TOPIC_INTERFACE_STATE_CHANGED = "network-interface-state-changed";
const TOPIC_INTERFACE_REGISTERED = "network-interface-registered";
const TOPIC_INTERFACE_UNREGISTERED = "network-interface-unregistered";
const TOPIC_DEFAULT_ROUTE_CHANGED = "network-default-route-changed";
const TOPIC_ACTIVE_CHANGED = "network-active-changed";
const TOPIC_MOZSETTINGS_CHANGED = "mozsettings-changed";
const TOPIC_PREF_CHANGED = "nsPref:changed";
const TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown";
@ -393,6 +393,7 @@ NetworkManager.prototype = {
if (this.active != this._overriddenActive) {
this.active = this._overriddenActive;
this.setDefaultRouteAndDNS(oldActive);
Services.obs.notifyObservers(this.active, TOPIC_ACTIVE_CHANGED, null);
}
return;
}
@ -431,6 +432,9 @@ NetworkManager.prototype = {
this.active = defaultDataNetwork;
}
this.setDefaultRouteAndDNS(oldActive);
if (this.active != oldActive) {
Services.obs.notifyObservers(this.active, TOPIC_ACTIVE_CHANGED, null);
}
}
if (this._manageOfflineStatus) {

View File

@ -1350,10 +1350,17 @@ let RIL = {
}
}
// Return a new object to avoid global variable, PNN, be modified by accident.
let ret = null;
if (pnnEntry) {
return [pnnEntry.fullName, pnnEntry.shortName];
ret = {
fullName: pnnEntry.fullName || "",
shortName: pnnEntry.shortName || "",
};
}
return null;
return ret;
},
/**
@ -3070,8 +3077,8 @@ let RIL = {
let networkName = this.updateNetworkName();
if (networkName) {
this.operator.longName = networkName[0];
this.operator.shortName = networkName[1];
this.operator.longName = networkName.fullName;
this.operator.shortName = networkName.shortName;
} else {
this.operator.longName = longName;
this.operator.shortName = shortName;
@ -8951,7 +8958,7 @@ let ICCRecordHelper = {
if (ICCUtilsHelper.isICCServiceAvailable("PNN")) {
if (DEBUG) debug("PNN: PNN is available");
this.getPNN();
this.readPNN();
} else {
if (DEBUG) debug("PNN: PNN is not available");
}
@ -9465,49 +9472,62 @@ let ICCRecordHelper = {
* See 3GPP TS 31.102 Sec. 4.2.58 for USIM
* 3GPP TS 51.011 Sec. 10.3.41 for SIM.
*/
getPNN: function getPNN() {
let pnn = [];
readPNN: function readPNN() {
function callback(options) {
let pnnElement = {
fullName: "",
shortName: ""
};
let len = Buf.readUint32();
let pnnElement;
let strLen = Buf.readUint32();
let octetLen = strLen / 2;
let readLen = 0;
while (len > readLen) {
while (readLen < octetLen) {
let tlvTag = GsmPDUHelper.readHexOctet();
readLen = readLen + 2; // 1 Hex octet
if (tlvTag == 0xFF) {
// Unused byte
continue;
}
let tlvLen = GsmPDUHelper.readHexOctet();
let name;
switch (tlvTag) {
case PNN_IEI_FULL_NETWORK_NAME:
pnnElement.fullName = GsmPDUHelper.readNetworkName(tlvLen);
readLen++;
Buf.seekIncoming((octetLen - readLen) * PDU_HEX_OCTET_SIZE);
break;
case PNN_IEI_SHORT_NETWORK_NAME:
pnnElement.shortName = GsmPDUHelper.readNetworkName(tlvLen);
break;
default:
Buf.seekIncoming(PDU_HEX_OCTET_SIZE * tlvLen);
}
readLen += (tlvLen * 2 + 2);
}
if (DEBUG) {
debug("PNN: [" + (pnn.length + 1) + "]: " + JSON.stringify(pnnElement));
}
Buf.readStringDelimiter(len);
pnn.push(pnnElement);
if (options.p1 < options.totalRecords) {
// Needs this check to avoid initializing twice.
pnnElement = pnnElement || {};
let tlvLen = GsmPDUHelper.readHexOctet();
switch (tlvTag) {
case PNN_IEI_FULL_NETWORK_NAME:
pnnElement.fullName = GsmPDUHelper.readNetworkName(tlvLen);
break;
case PNN_IEI_SHORT_NETWORK_NAME:
pnnElement.shortName = GsmPDUHelper.readNetworkName(tlvLen);
break;
default:
Buf.seekIncoming(tlvLen * PDU_HEX_OCTET_SIZE);
break;
}
readLen += (tlvLen + 2); // +2 for tlvTag and tlvLen
}
Buf.readStringDelimiter(strLen);
if (pnnElement) {
pnn.push(pnnElement);
}
// Will ignore remaining records when got the contents of a record are all 0xff.
if (pnnElement && options.p1 < options.totalRecords) {
ICCIOHelper.loadNextRecord(options);
} else {
if (DEBUG) {
for (let i = 0; i < pnn.length; i++) {
debug("PNN: [" + i + "]: " + JSON.stringify(pnn[i]));
}
}
RIL.iccInfoPrivate.PNN = pnn;
}
}
let pnn = [];
ICCIOHelper.loadLinearFixedEF({fileId: ICC_EF_PNN,
callback: callback.bind(this)});
},

View File

@ -1035,6 +1035,70 @@ add_test(function test_stk_proactive_command_set_up_call() {
run_next_test();
});
add_test(function test_read_pnn() {
let worker = newUint8Worker();
let helper = worker.GsmPDUHelper;
let record = worker.ICCRecordHelper;
let buf = worker.Buf;
let io = worker.ICCIOHelper;
let ril = worker.RIL;
io.loadLinearFixedEF = function fakeLoadLinearFixedEF(options) {
let records = [
// Record 1 - fullName: 'Long1', shortName: 'Short1'
[0x43, 0x06, 0x85, 0xCC, 0xB7, 0xFB, 0x1C, 0x03,
0x45, 0x07, 0x86, 0x53, 0xF4, 0x5B, 0x4E, 0x8F, 0x01,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF],
// Record 2 - fullName: 'Long2'
[0x43, 0x06, 0x85, 0xCC, 0xB7, 0xFB, 0x2C, 0x03,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF],
// Record 3 - Unused bytes
[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF],
];
// Fake get response
options.totalRecords = records.length;
options.recordSize = records[0].length;
options.p1 = options.p1 || 1;
let record = records[options.p1 - 1];
// Write data size
buf.writeUint32(record.length * 2);
// Write record
for (let i = 0; i < record.length; i++) {
helper.writeHexOctet(record[i]);
}
// Write string delimiter
buf.writeStringDelimiter(record.length * 2);
if (options.callback) {
options.callback(options);
}
};
io.loadNextRecord = function fakeLoadNextRecord(options) {
options.p1++;
io.loadLinearFixedEF(options);
};
record.readPNN();
do_check_eq(ril.iccInfoPrivate.PNN.length, 2);
do_check_eq(ril.iccInfoPrivate.PNN[0].fullName, "Long1");
do_check_eq(ril.iccInfoPrivate.PNN[0].shortName, "Short1");
do_check_eq(ril.iccInfoPrivate.PNN[1].fullName, "Long2");
do_check_eq(ril.iccInfoPrivate.PNN[1].shortName, undefined);
run_next_test();
});
add_test(function read_network_name() {
let worker = newUint8Worker();
let helper = worker.GsmPDUHelper;
@ -1102,8 +1166,8 @@ add_test(function test_update_network_name() {
RIL.operator.mnc = operatorMnc;
let result = RIL.updateNetworkName();
do_check_eq(result[0], expectedLongName);
do_check_eq(result[1], expectedShortName);
do_check_eq(result.fullName, expectedLongName);
do_check_eq(result.shortName, expectedShortName);
}
// Before EF_OPL and EF_PNN have been loaded.

View File

@ -0,0 +1,21 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-map-element
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-map-element
interface HTMLMapElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString name;
[Constant]
readonly attribute HTMLCollection areas;
// Not supported yet.
//readonly attribute HTMLCollection images;
};

View File

@ -0,0 +1,28 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-meta-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-meta-element
interface HTMLMetaElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString name;
[SetterThrows, Pure]
attribute DOMString httpEquiv;
[SetterThrows, Pure]
attribute DOMString content;
};
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLMetaElement {
[SetterThrows, Pure]
attribute DOMString scheme;
};

View File

@ -0,0 +1,19 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#attributes-common-to-ins-and-del-elements
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#attributes-common-to-ins-and-del-elements
interface HTMLModElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString cite;
[SetterThrows, Pure]
attribute DOMString dateTime;
};

View File

@ -71,6 +71,9 @@ webidl_files = \
HTMLImageElement.webidl \
HTMLLabelElement.webidl \
HTMLLIElement.webidl \
HTMLMapElement.webidl \
HTMLMetaElement.webidl \
HTMLModElement.webidl \
HTMLOListElement.webidl \
HTMLOptionsCollection.webidl \
HTMLParagraphElement.webidl \

View File

@ -183,45 +183,6 @@ void ProcessMarginRightValue(const nsAString * aInputString, nsAString & aOutput
}
}
static
void ProcessFontSizeValue(const nsAString* aInputString, nsAString& aOutputString,
const char* aDefaultValueString,
const char* aPrependString, const char* aAppendString)
{
aOutputString.Truncate();
if (aInputString) {
int32_t size = nsContentUtils::ParseLegacyFontSize(*aInputString);
switch (size) {
case 0:
// Didn't parse
return;
case 1:
aOutputString.AssignLiteral("x-small");
return;
case 2:
aOutputString.AssignLiteral("small");
return;
case 3:
aOutputString.AssignLiteral("medium");
return;
case 4:
aOutputString.AssignLiteral("large");
return;
case 5:
aOutputString.AssignLiteral("x-large");
return;
case 6:
aOutputString.AssignLiteral("xx-large");
return;
case 7:
// No corresponding CSS size
return;
default:
NS_NOTREACHED("Unexpected return value from ParseLegacyFontSize");
}
}
}
const nsHTMLCSSUtils::CSSEquivTable boldEquivTable[] = {
{ nsHTMLCSSUtils::eCSSEditableProperty_font_weight, ProcessBValue, nullptr, nullptr, nullptr, true, false },
{ nsHTMLCSSUtils::eCSSEditableProperty_NONE, 0 }
@ -257,11 +218,6 @@ const nsHTMLCSSUtils::CSSEquivTable fontFaceEquivTable[] = {
{ nsHTMLCSSUtils::eCSSEditableProperty_NONE, 0 }
};
const nsHTMLCSSUtils::CSSEquivTable fontSizeEquivTable[] = {
{ nsHTMLCSSUtils::eCSSEditableProperty_font_size, ProcessFontSizeValue, nullptr, nullptr, nullptr, true, false },
{ nsHTMLCSSUtils::eCSSEditableProperty_NONE, 0 }
};
const nsHTMLCSSUtils::CSSEquivTable bgcolorEquivTable[] = {
{ nsHTMLCSSUtils::eCSSEditableProperty_background_color, ProcessSameValue, nullptr, nullptr, nullptr, true, false },
{ nsHTMLCSSUtils::eCSSEditableProperty_NONE, 0 }
@ -347,21 +303,19 @@ nsHTMLCSSUtils::~nsHTMLCSSUtils()
bool
nsHTMLCSSUtils::IsCSSEditableProperty(nsIDOMNode* aNode,
nsIAtom* aProperty,
const nsAString* aAttribute,
const nsAString* aValue)
const nsAString* aAttribute)
{
NS_ASSERTION(aNode, "Shouldn't you pass aNode? - Bug 214025");
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
NS_ENSURE_TRUE(content, false);
return IsCSSEditableProperty(content, aProperty, aAttribute, aValue);
return IsCSSEditableProperty(content, aProperty, aAttribute);
}
bool
nsHTMLCSSUtils::IsCSSEditableProperty(nsIContent* aNode,
nsIAtom* aProperty,
const nsAString* aAttribute,
const nsAString* aValue)
const nsAString* aAttribute)
{
MOZ_ASSERT(aNode);
@ -387,16 +341,6 @@ nsHTMLCSSUtils::IsCSSEditableProperty(nsIContent* aNode,
return true;
}
// FONT SIZE doesn't work if the value is 7
if (nsEditProperty::font == aProperty && aAttribute &&
aAttribute->EqualsLiteral("size")) {
if (!aValue || aValue->IsEmpty()) {
return true;
}
int32_t size = nsContentUtils::ParseLegacyFontSize(*aValue);
return size && size != 7;
}
// ALIGN attribute on elements supporting it
if (aAttribute && (aAttribute->EqualsLiteral("align")) &&
(nsEditProperty::div == tagName
@ -908,9 +852,6 @@ nsHTMLCSSUtils::GenerateCSSDeclarationsFromHTMLStyle(dom::Element* aElement,
} else if (nsEditProperty::font == aHTMLProperty &&
aAttribute->EqualsLiteral("face")) {
equivTable = fontFaceEquivTable;
} else if (nsEditProperty::font == aHTMLProperty &&
aAttribute->EqualsLiteral("size")) {
equivTable = fontSizeEquivTable;
} else if (aAttribute->EqualsLiteral("bgcolor")) {
equivTable = bgcolorEquivTable;
} else if (aAttribute->EqualsLiteral("background")) {
@ -989,8 +930,7 @@ nsHTMLCSSUtils::SetCSSEquivalentToHTMLStyle(nsIDOMNode * aNode,
{
nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
*aCount = 0;
if (!element || !IsCSSEditableProperty(element, aHTMLProperty,
aAttribute, aValue)) {
if (!element || !IsCSSEditableProperty(element, aHTMLProperty, aAttribute)) {
return NS_OK;
}
@ -1066,8 +1006,7 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLInlineStyleSet(nsINode* aNode,
nsCOMPtr<dom::Element> theElement = GetElementContainerOrSelf(aNode);
NS_ENSURE_TRUE(theElement, NS_ERROR_NULL_POINTER);
if (!theElement || !IsCSSEditableProperty(theElement, aHTMLProperty,
aAttribute, &aValueString)) {
if (!theElement || !IsCSSEditableProperty(theElement, aHTMLProperty, aAttribute)) {
return NS_OK;
}
@ -1244,19 +1183,6 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode *aNode,
!valueStringLower.EqualsLiteral("serif");
}
return NS_OK;
} else if (nsEditProperty::font == aHTMLProperty && aHTMLAttribute &&
aHTMLAttribute->EqualsLiteral("size")) {
if (htmlValueString.IsEmpty()) {
aIsSet = true;
} else {
int32_t size = nsContentUtils::ParseLegacyFontSize(htmlValueString);
aIsSet = (size == 1 && valueString.EqualsLiteral("x-small")) ||
(size == 2 && valueString.EqualsLiteral("small")) ||
(size == 3 && valueString.EqualsLiteral("medium")) ||
(size == 4 && valueString.EqualsLiteral("large")) ||
(size == 5 && valueString.EqualsLiteral("x-large")) ||
(size == 6 && valueString.EqualsLiteral("xx-large"));
}
} else if (aHTMLAttribute && aHTMLAttribute->EqualsLiteral("align")) {
aIsSet = true;
} else {

View File

@ -82,18 +82,9 @@ public:
* @param aProperty [IN] an atom containing a HTML tag name
* @param aAttribute [IN] a string containing the name of a HTML
* attribute carried by the element above
* @param aValue [IN] an optional string containing the attribute's
* HTML value -- this matters for <font size>,
* since size=7 has no CSS equivalent. Make sure
* you pass the HTML value (e.g. "4"), not the
* CSS value (e.g. "large").
*/
bool IsCSSEditableProperty(nsIContent* aNode, nsIAtom* aProperty,
const nsAString* aAttribute,
const nsAString* aValue = nullptr);
bool IsCSSEditableProperty(nsIDOMNode* aNode, nsIAtom* aProperty,
const nsAString* aAttribute,
const nsAString* aValue = nullptr);
bool IsCSSEditableProperty(nsIContent* aNode, nsIAtom* aProperty, const nsAString* aAttribute);
bool IsCSSEditableProperty(nsIDOMNode* aNode, nsIAtom* aProperty, const nsAString* aAttribute);
/** adds/remove a CSS declaration to the STYLE atrribute carried by a given element
*

View File

@ -511,8 +511,7 @@ nsHTMLEditRules::AfterEditInner(EditAction action,
mHTMLEditor->mTypeInState->UpdateSelState(selection);
res = ReapplyCachedStyles();
NS_ENSURE_SUCCESS(res, res);
res = ClearCachedStyles();
NS_ENSURE_SUCCESS(res, res);
ClearCachedStyles();
}
}
@ -1241,8 +1240,7 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, bool *aCancel)
// For most actions we want to clear the cached styles, but there are
// exceptions
if (!IsStyleCachePreservingAction(mTheAction)) {
res = ClearCachedStyles();
NS_ENSURE_SUCCESS(res, res);
ClearCachedStyles();
}
return NS_OK;
@ -6316,8 +6314,7 @@ nsHTMLEditRules::ReturnInHeader(nsISelection *aSelection,
NS_ENSURE_SUCCESS(res, res);
if (!sibling || !nsTextEditUtils::IsBreak(sibling))
{
res = ClearCachedStyles();
NS_ENSURE_SUCCESS(res, res);
ClearCachedStyles();
mHTMLEditor->mTypeInState->ClearAllProps();
// create a paragraph
@ -7245,18 +7242,14 @@ nsHTMLEditRules::ReapplyCachedStyles()
}
nsresult
void
nsHTMLEditRules::ClearCachedStyles()
{
// clear the mPresent bits in mCachedStyles array
int32_t j;
for (j=0; j<SIZE_STYLE_TABLE; j++)
{
for (uint32_t j = 0; j < SIZE_STYLE_TABLE; j++) {
mCachedStyles[j].mPresent = false;
mCachedStyles[j].value.Truncate(0);
mCachedStyles[j].value.Truncate();
}
return NS_OK;
}

View File

@ -297,7 +297,7 @@ protected:
nsresult RemoveListStructure(nsIDOMNode *aList);
nsresult CacheInlineStyles(nsIDOMNode *aNode);
nsresult ReapplyCachedStyles();
nsresult ClearCachedStyles();
void ClearCachedStyles();
nsresult AdjustSpecialBreaks(bool aSafeToAskFrames = false);
nsresult AdjustWhitespace(nsISelection *aSelection);
nsresult PinSelectionToNewBlock(nsISelection *aSelection);

View File

@ -312,8 +312,7 @@ nsHTMLEditor::IsSimpleModifiableNode(nsIContent* aContent,
// No luck so far. Now we check for a <span> with a single style=""
// attribute that sets only the style we're looking for, if this type of
// style supports it
if (!mHTMLCSSUtils->IsCSSEditableProperty(element, aProperty,
aAttribute, aValue) ||
if (!mHTMLCSSUtils->IsCSSEditableProperty(element, aProperty, aAttribute) ||
!element->IsHTML(nsGkAtoms::span) || element->GetAttrCount() != 1 ||
!element->HasAttr(kNameSpaceID_None, nsGkAtoms::style)) {
return false;
@ -361,8 +360,7 @@ nsHTMLEditor::SetInlinePropertyOnTextNode( nsIDOMCharacterData *aTextNode,
// don't need to do anything if property already set on node
bool bHasProp;
if (mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty,
aAttribute, aValue)) {
if (mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty, aAttribute)) {
// the HTML styles defined by aProperty/aAttribute has a CSS equivalence
// in this implementation for node; let's check if it carries those css styles
nsAutoString value(*aValue);
@ -471,8 +469,7 @@ nsHTMLEditor::SetInlinePropertyOnNodeImpl(nsIContent* aNode,
}
// don't need to do anything if property already set on node
if (mHTMLCSSUtils->IsCSSEditableProperty(aNode, aProperty,
aAttribute, aValue)) {
if (mHTMLCSSUtils->IsCSSEditableProperty(aNode, aProperty, aAttribute)) {
if (mHTMLCSSUtils->IsCSSEquivalentToHTMLInlineStyleSet(
aNode, aProperty, aAttribute, *aValue, nsHTMLCSSUtils::eComputed)) {
return NS_OK;
@ -483,8 +480,7 @@ nsHTMLEditor::SetInlinePropertyOnNodeImpl(nsIContent* aNode,
}
bool useCSS = (IsCSSEnabled() &&
mHTMLCSSUtils->IsCSSEditableProperty(aNode, aProperty,
aAttribute, aValue)) ||
mHTMLCSSUtils->IsCSSEditableProperty(aNode, aProperty, aAttribute)) ||
// bgcolor is always done using CSS
aAttribute->EqualsLiteral("bgcolor");
@ -1157,11 +1153,7 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
return NS_OK;
}
// Bug 747889: we don't support CSS for fontSize values
if ((aProperty != nsEditProperty::font ||
!aAttribute->EqualsLiteral("size")) &&
mHTMLCSSUtils->IsCSSEditableProperty(collapsedNode, aProperty,
aAttribute)) {
if (mHTMLCSSUtils->IsCSSEditableProperty(collapsedNode, aProperty, aAttribute)) {
mHTMLCSSUtils->IsCSSEquivalentToHTMLInlineStyleSet(
collapsedNode, aProperty, aAttribute, isSet, tOutString,
nsHTMLCSSUtils::eComputed);
@ -1245,11 +1237,7 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
bool isSet = false;
if (first) {
if (mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty,
aAttribute) &&
// Bug 747889: we don't support CSS for fontSize values
(aProperty != nsEditProperty::font ||
!aAttribute->EqualsLiteral("size"))) {
if (mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty, aAttribute)){
// the HTML styles defined by aProperty/aAttribute has a CSS
// equivalence in this implementation for node; let's check if it
// carries those css styles
@ -1268,11 +1256,7 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
*outValue = firstValue;
}
} else {
if (mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty,
aAttribute) &&
// Bug 747889: we don't support CSS for fontSize values
(aProperty != nsEditProperty::font ||
!aAttribute->EqualsLiteral("size"))) {
if (mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty, aAttribute)){
// the HTML styles defined by aProperty/aAttribute has a CSS equivalence
// in this implementation for node; let's check if it carries those css styles
if (aValue) {

View File

@ -19,6 +19,7 @@ var knownFailures = {
},
'a' : {
'createbookmark-0' : true,
'fontsize-1' : true,
'subscript-1' : true,
'superscript-1' : true,
},
@ -34,6 +35,10 @@ var knownFailures = {
'fontsize-1' : true,
'fontsize-2' : true,
},
'c': {
'fontsize-1' : true,
'fontsize-2' : true,
},
};
function isKnownFailure(type, test, param) {

View File

@ -20,6 +20,9 @@ const knownFailures = {
"AC-Proposed-SUP_TEXT-1_SI-dM": true,
"AC-Proposed-SUP_TEXT-1_SI-body": true,
"AC-Proposed-SUP_TEXT-1_SI-div": true,
"AC-Proposed-FS:2_TEXT-1_SI-dM": true,
"AC-Proposed-FS:2_TEXT-1_SI-body": true,
"AC-Proposed-FS:2_TEXT-1_SI-div": true,
"AC-Proposed-FS:18px_TEXT-1_SI-dM": true,
"AC-Proposed-FS:18px_TEXT-1_SI-body": true,
"AC-Proposed-FS:18px_TEXT-1_SI-div": true,
@ -41,6 +44,9 @@ const knownFailures = {
"C-Proposed-FS:1_SPAN.ass.s:fs:large-1_SW-dM": true,
"C-Proposed-FS:1_SPAN.ass.s:fs:large-1_SW-body": true,
"C-Proposed-FS:1_SPAN.ass.s:fs:large-1_SW-div": true,
"C-Proposed-FS:5_FONTsz:1.s:fs:xs-1_SW-dM": true,
"C-Proposed-FS:5_FONTsz:1.s:fs:xs-1_SW-body": true,
"C-Proposed-FS:5_FONTsz:1.s:fs:xs-1_SW-div": true,
"C-Proposed-FS:larger_FONTsz:4-dM": true,
"C-Proposed-FS:larger_FONTsz:4-body": true,
"C-Proposed-FS:larger_FONTsz:4-div": true,
@ -77,9 +83,18 @@ const knownFailures = {
"CC-Proposed-FN:c_FONTf:a-2_SL-dM": true,
"CC-Proposed-FN:c_FONTf:a-2_SL-body": true,
"CC-Proposed-FN:c_FONTf:a-2_SL-div": true,
"CC-Proposed-FS:1_SPANs:fs:l-1_SW-dM": true,
"CC-Proposed-FS:1_SPANs:fs:l-1_SW-body": true,
"CC-Proposed-FS:1_SPANs:fs:l-1_SW-div": true,
"CC-Proposed-FS:18px_SPANs:fs:l-1_SW-dM": true,
"CC-Proposed-FS:18px_SPANs:fs:l-1_SW-body": true,
"CC-Proposed-FS:18px_SPANs:fs:l-1_SW-div": true,
"CC-Proposed-FS:4_SPANs:fs:l-1_SW-dM": true,
"CC-Proposed-FS:4_SPANs:fs:l-1_SW-body": true,
"CC-Proposed-FS:4_SPANs:fs:l-1_SW-div": true,
"CC-Proposed-FS:4_SPANs:fs:18px-1_SW-dM": true,
"CC-Proposed-FS:4_SPANs:fs:18px-1_SW-body": true,
"CC-Proposed-FS:4_SPANs:fs:18px-1_SW-div": true,
"CC-Proposed-FS:larger_SPANs:fs:l-1_SI-dM": true,
"CC-Proposed-FS:larger_SPANs:fs:l-1_SI-body": true,
"CC-Proposed-FS:larger_SPANs:fs:l-1_SI-div": true,
@ -663,6 +678,9 @@ const knownFailures = {
"C-Proposed-FS:1_SPAN.ass.s:fs:large-1_SW-dM": true,
"C-Proposed-FS:1_SPAN.ass.s:fs:large-1_SW-body": true,
"C-Proposed-FS:1_SPAN.ass.s:fs:large-1_SW-div": true,
"C-Proposed-FS:5_FONTsz:1.s:fs:xs-1_SW-dM": true,
"C-Proposed-FS:5_FONTsz:1.s:fs:xs-1_SW-body": true,
"C-Proposed-FS:5_FONTsz:1.s:fs:xs-1_SW-div": true,
"C-Proposed-FS:2_FONTc:b.sz:6-1_SI-dM": true,
"C-Proposed-FS:2_FONTc:b.sz:6-1_SI-body": true,
"C-Proposed-FS:2_FONTc:b.sz:6-1_SI-div": true,
@ -708,9 +726,18 @@ const knownFailures = {
"CC-Proposed-FN:c_FONTf:a-2_SL-dM": true,
"CC-Proposed-FN:c_FONTf:a-2_SL-body": true,
"CC-Proposed-FN:c_FONTf:a-2_SL-div": true,
"CC-Proposed-FS:1_SPANs:fs:l-1_SW-dM": true,
"CC-Proposed-FS:1_SPANs:fs:l-1_SW-body": true,
"CC-Proposed-FS:1_SPANs:fs:l-1_SW-div": true,
"CC-Proposed-FS:18px_SPANs:fs:l-1_SW-dM": true,
"CC-Proposed-FS:18px_SPANs:fs:l-1_SW-body": true,
"CC-Proposed-FS:18px_SPANs:fs:l-1_SW-div": true,
"CC-Proposed-FS:4_SPANs:fs:l-1_SW-dM": true,
"CC-Proposed-FS:4_SPANs:fs:l-1_SW-body": true,
"CC-Proposed-FS:4_SPANs:fs:l-1_SW-div": true,
"CC-Proposed-FS:4_SPANs:fs:18px-1_SW-dM": true,
"CC-Proposed-FS:4_SPANs:fs:18px-1_SW-body": true,
"CC-Proposed-FS:4_SPANs:fs:18px-1_SW-div": true,
"CC-Proposed-FS:larger_SPANs:fs:l-1_SI-dM": true,
"CC-Proposed-FS:larger_SPANs:fs:l-1_SI-body": true,
"CC-Proposed-FS:larger_SPANs:fs:l-1_SI-div": true,

View File

@ -21,47 +21,16 @@ function parseFontSizeTodo(input, expected) {
}
function parseFontSizeInner(input, expected, fn) {
// First test non-CSS
document.execCommand("styleWithCSS", false, false);
div.innerHTML = "foo";
getSelection().selectAllChildren(div);
document.execCommand("fontSize", false, input);
if (expected === null) {
fn(div.innerHTML, "foo",
'execCommand("fontSize", false, "' + input + '") should be no-op ' +
'(non-CSS)');
'execCommand("fontSize", false, "' + input + '") should be no-op');
} else {
fn(div.innerHTML, '<font size="' + expected + '">foo</font>',
'execCommand("fontSize", false, "' + input + '") should parse to ' +
expected + ' (non-CSS)');
}
// Now test CSS
document.execCommand("styleWithCSS", false, true);
div.innerHTML = "foo";
getSelection().selectAllChildren(div);
document.execCommand("fontSize", false, input);
if (expected === null) {
fn(div.innerHTML, "foo",
'execCommand("fontSize", false, "' + input + '") should be no-op ' +
'(CSS)');
} else if (expected === 7) {
// No CSS support for <font size=7>
fn(div.innerHTML, '<font size="' + expected + '">foo</font>',
'execCommand("fontSize", false, "' + input + '") should parse to ' +
expected + ' (CSS)');
} else {
var cssVal = {
1: "x-small",
2: "small",
3: "medium",
4: "large",
5: "x-large",
6: "xx-large",
}[expected];
fn(div.innerHTML, '<span style="font-size: ' + cssVal + ';">foo</span>',
'execCommand("fontSize", false, "' + input + '") should parse to ' +
expected + ' (CSS)');
expected);
}
}

Some files were not shown because too many files have changed in this diff Show More