Merge mozilla-central into services-central

This commit is contained in:
Gregory Szorc 2012-07-09 15:15:18 -07:00
commit 65cbfe3bcb
75 changed files with 1288 additions and 879 deletions

View File

@ -3001,9 +3001,9 @@
let tab = tabs[i];
tab.style.setProperty("max-width", tabWidth, "important");
if (!isEndTab) { // keep tabs the same width
tab.style.MozTransition = "none";
tab.style.transition = "none";
tab.clientTop; // flush styles to skip animation; see bug 649247
tab.style.MozTransition = "";
tab.style.transition = "";
}
}
this._hasTabTempMaxWidth = true;

View File

@ -194,6 +194,8 @@ static SETTING gDDESettings[] = {
{ MAKE_KEY_NAME1("Software\\Classes\\HTTPS", SOD) }
};
// See Bug 770883
#if 0
#if defined(MOZ_MAINTENANCE_SERVICE)
#define ONLY_SERVICE_LAUNCHING
@ -204,6 +206,7 @@ static const char *kPrefetchClearedPref =
"app.update.service.lastVersionPrefetchCleared";
static nsCOMPtr<nsIThread> sThread;
#endif
#endif
nsresult
GetHelperPath(nsAutoString& aPath)
@ -997,6 +1000,8 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
nsWindowsShellService::nsWindowsShellService() :
mCheckedThisSession(false)
{
// See Bug 770883
#if 0
#if defined(MOZ_MAINTENANCE_SERVICE)
// Check to make sure the service is installed
@ -1041,10 +1046,13 @@ nsWindowsShellService::nsWindowsShellService() :
nsnull, CLEAR_PREFETCH_TIMEOUT_MS, nsITimer::TYPE_ONE_SHOT);
}
#endif
#endif
}
nsWindowsShellService::~nsWindowsShellService()
{
// See Bug 770883
#if 0
#if defined(MOZ_MAINTENANCE_SERVICE)
if (mTimer) {
mTimer->Cancel();
@ -1055,8 +1063,11 @@ nsWindowsShellService::~nsWindowsShellService()
sThread = nsnull;
}
#endif
#endif
}
// See Bug 770883
#if 0
#if defined(MOZ_MAINTENANCE_SERVICE)
class ClearPrefetchEvent : public nsRunnable {
@ -1079,6 +1090,7 @@ public:
}
};
#endif
#endif
/**
* For faster startup we attempt to clear the prefetch if the maintenance
@ -1089,6 +1101,8 @@ public:
* This is done on every update but also there is a one time operation done
* from within the program for first time installs.
*/
// See Bug 770883
#if 0
#if defined(MOZ_MAINTENANCE_SERVICE)
void
nsWindowsShellService::LaunchPrefetchClearCommand(nsITimer *aTimer, void*)
@ -1113,6 +1127,7 @@ nsWindowsShellService::LaunchPrefetchClearCommand(nsITimer *aTimer, void*)
}
}
#endif
#endif
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsIFile* aApplication,

View File

@ -2,7 +2,7 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-codesighs
ac_add_options --enable-signmar
#ac_add_options --enable-profiling
ac_add_options --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics

View File

@ -133,24 +133,15 @@ nsDOMMutationRecord::GetOldValue(nsAString& aPrevValue)
// Observer
NS_IMPL_CYCLE_COLLECTION_CLASS(nsMutationReceiver)
NS_IMPL_ADDREF(nsMutationReceiver)
NS_IMPL_RELEASE(nsMutationReceiver)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsMutationReceiver)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsMutationReceiver)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsMutationReceiver)
NS_INTERFACE_MAP_BEGIN(nsMutationReceiver)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsMutationReceiver)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsMutationReceiver)
tmp->Disconnect(false);
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsMutationReceiver)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
void
nsMutationReceiver::Disconnect(bool aRemoveFromObserver)
{

View File

@ -265,8 +265,7 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMUTATION_OBSERVER_IID)
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsMutationReceiver)
NS_DECL_ISUPPORTS
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE

View File

@ -69,9 +69,6 @@ nsDOMParser::ParseFromString(const PRUnichar *str,
rv = SetUpDocument(DocumentFlavorHTML, getter_AddRefs(domDocument));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDocument);
nsDependentString sourceBuffer(str);
rv = nsContentUtils::ParseDocumentHTML(sourceBuffer, document, false);
NS_ENSURE_SUCCESS(rv, rv);
// Keep the XULXBL state, base URL and principal setting in sync with the
// XML case
@ -85,6 +82,10 @@ nsDOMParser::ParseFromString(const PRUnichar *str,
// And the right principal
document->SetPrincipal(mPrincipal);
nsDependentString sourceBuffer(str);
rv = nsContentUtils::ParseDocumentHTML(sourceBuffer, document, false);
NS_ENSURE_SUCCESS(rv, rv);
domDocument.forget(aResult);
return rv;
}

View File

@ -1750,6 +1750,7 @@ GK_ATOM(svgLinearGradientFrame, "SVGLinearGradientFrame")
GK_ATOM(svgMarkerFrame, "SVGMarkerFrame")
GK_ATOM(svgMaskFrame, "SVGMaskFrame")
GK_ATOM(svgOuterSVGFrame, "SVGOuterSVGFrame")
GK_ATOM(svgOuterSVGAnonChildFrame, "SVGOuterSVGAnonChildFrame")
GK_ATOM(svgPathGeometryFrame, "SVGPathGeometryFrame")
GK_ATOM(svgPatternFrame, "SVGPatternFrame")
GK_ATOM(svgRadialGradientFrame, "SVGRadialGradientFrame")

View File

@ -449,12 +449,12 @@ nsXMLHttpRequest::nsXMLHttpRequest()
mWarnAboutMultipartHtml(false),
mWarnAboutSyncHtml(false),
mLoadLengthComputable(false), mLoadTotal(0),
mIsSystem(false),
mIsAnon(false),
mFirstStartRequestSeen(false),
mInLoadProgressEvent(false),
mResultJSON(JSVAL_VOID),
mResultArrayBuffer(nsnull),
mIsAnon(false),
mIsSystem(false)
mResultArrayBuffer(nsnull)
{
nsLayoutStatics::AddRef();

View File

@ -923,13 +923,14 @@ nsSVGElement::sGraphicsMap[] = {
// PresentationAttributes-TextContentElements
/* static */ const nsGenericElement::MappedAttributeEntry
nsSVGElement::sTextContentElementsMap[] = {
{ &nsGkAtoms::alignment_baseline },
{ &nsGkAtoms::baseline_shift },
// Properties that we don't support are commented out.
// { &nsGkAtoms::alignment_baseline },
// { &nsGkAtoms::baseline_shift },
{ &nsGkAtoms::direction },
{ &nsGkAtoms::dominant_baseline },
{ &nsGkAtoms::glyph_orientation_horizontal },
{ &nsGkAtoms::glyph_orientation_vertical },
{ &nsGkAtoms::kerning },
// { &nsGkAtoms::glyph_orientation_horizontal },
// { &nsGkAtoms::glyph_orientation_vertical },
// { &nsGkAtoms::kerning },
{ &nsGkAtoms::letter_spacing },
{ &nsGkAtoms::text_anchor },
{ &nsGkAtoms::text_decoration },

View File

@ -14,7 +14,7 @@
* http://www.w3.org/TR/DOM-Level-2-Style
*/
[builtinclass, scriptable, uuid(bb40a531-d92b-44d6-a543-cfc25054d5eb)]
[builtinclass, scriptable, uuid(492673d6-039b-4d94-a598-dbf82abc174f)]
interface nsIDOMCSS2Properties : nsISupports
{
attribute DOMString background;
@ -686,6 +686,21 @@ interface nsIDOMCSS2Properties : nsISupports
attribute DOMString MozTextDecorationStyle;
// raises(DOMException) on setting
attribute DOMString transitionProperty;
// raises(DOMException) on setting
attribute DOMString transitionDuration;
// raises(DOMException) on setting
attribute DOMString transitionDelay;
// raises(DOMException) on setting
attribute DOMString transitionTimingFunction;
// raises(DOMException) on setting
attribute DOMString transition;
// raises(DOMException) on setting
attribute DOMString MozTransitionProperty;
// raises(DOMException) on setting
@ -710,6 +725,33 @@ interface nsIDOMCSS2Properties : nsISupports
attribute DOMString resize;
// raises(DOMException) on setting
attribute DOMString animationName;
// raises(DOMException) on setting
attribute DOMString animationDuration;
// raises(DOMException) on setting
attribute DOMString animationDelay;
// raises(DOMException) on setting
attribute DOMString animationTimingFunction;
// raises(DOMException) on setting
attribute DOMString animationDirection;
// raises(DOMException) on setting
attribute DOMString animationFillMode;
// raises(DOMException) on setting
attribute DOMString animationIterationCount;
// raises(DOMException) on setting
attribute DOMString animationPlayState;
// raises(DOMException) on setting
attribute DOMString animation;
// raises(DOMException) on setting
attribute DOMString MozAnimationName;
// raises(DOMException) on setting

View File

@ -255,20 +255,22 @@ SmsDatabaseService.prototype = {
* return Array of keys containing the final result of createMessageList.
*/
keyIntersection: function keyIntersection(keys, filter) {
// Always use keys[FILTER_TIMESTAMP] as base result set to be filtered.
// This ensures the result set is always sorted by timestamp.
let result = keys[FILTER_TIMESTAMP];
if (keys[FILTER_NUMBERS].length || filter.numbers) {
result = keys[FILTER_NUMBERS].filter(function(i) {
return result.indexOf(i) != -1;
result = result.filter(function(i) {
return keys[FILTER_NUMBERS].indexOf(i) != -1;
});
}
if (keys[FILTER_DELIVERY].length || filter.delivery) {
result = keys[FILTER_DELIVERY].filter(function(i) {
return result.indexOf(i) != -1;
result = result.filter(function(i) {
return keys[FILTER_DELIVERY].indexOf(i) != -1;
});
}
if (keys[FILTER_READ].length || filter.read) {
result = keys[FILTER_READ].filter(function(i) {
return result.indexOf(i) != -1;
result = result.filter(function(i) {
return keys[FILTER_READ].indexOf(i) != -1;
});
}
return result;

View File

@ -1603,7 +1603,7 @@ nsEditor::RemoveContainer(nsINode* aNode)
{
NS_ENSURE_TRUE(aNode, NS_ERROR_NULL_POINTER);
nsINode* parent = aNode->GetNodeParent();
nsCOMPtr<nsINode> parent = aNode->GetNodeParent();
NS_ENSURE_STATE(parent);
PRInt32 offset = parent->IndexOf(aNode);
@ -1616,7 +1616,7 @@ nsEditor::RemoveContainer(nsINode* aNode)
nsAutoRemoveContainerSelNotify selNotify(mRangeUpdater, aNode, parent, offset, nodeOrigLen);
while (aNode->HasChildren()) {
nsIContent* child = aNode->GetLastChild();
nsCOMPtr<nsIContent> child = aNode->GetLastChild();
nsresult rv = DeleteNode(child->AsDOMNode());
NS_ENSURE_SUCCESS(rv, rv);
@ -1719,9 +1719,8 @@ nsEditor::MoveNode(nsIDOMNode *aNode, nsIDOMNode *aParent, PRInt32 aOffset)
NS_ENSURE_TRUE(aNode && aParent, NS_ERROR_NULL_POINTER);
nsresult res;
nsCOMPtr<nsIDOMNode> oldParent;
PRInt32 oldOffset;
GetNodeLocation(aNode, address_of(oldParent), &oldOffset);
nsCOMPtr<nsIDOMNode> oldParent = GetNodeLocation(aNode, &oldOffset);
if (aOffset == -1)
{
@ -2932,9 +2931,8 @@ nsEditor::JoinNodesImpl(nsIDOMNode * aNodeToKeep,
PRUint32 firstNodeLength;
result = GetLengthOfDOMNode(leftNode, firstNodeLength);
NS_ENSURE_SUCCESS(result, result);
nsCOMPtr<nsIDOMNode> parent;
GetNodeLocation(aNodeToJoin, address_of(parent), &joinOffset);
GetNodeLocation(aNodeToKeep, address_of(parent), &keepOffset);
nsCOMPtr<nsIDOMNode> parent = GetNodeLocation(aNodeToJoin, &joinOffset);
parent = GetNodeLocation(aNodeToKeep, &keepOffset);
// if selection endpoint is between the nodes, remember it as being
// in the one that is going away instead. This simplifies later selection
@ -3122,18 +3120,21 @@ nsEditor::GetChildOffset(nsIDOMNode* aChild, nsIDOMNode* aParent)
}
// static
void
nsEditor::GetNodeLocation(nsIDOMNode* aChild, nsCOMPtr<nsIDOMNode>* outParent,
PRInt32* outOffset)
already_AddRefed<nsIDOMNode>
nsEditor::GetNodeLocation(nsIDOMNode* aChild, PRInt32* outOffset)
{
MOZ_ASSERT(aChild && outParent && outOffset);
MOZ_ASSERT(aChild && outOffset);
*outOffset = -1;
nsCOMPtr<nsIDOMNode> parent;
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
aChild->GetParentNode(getter_AddRefs(*outParent))));
if (*outParent) {
*outOffset = GetChildOffset(aChild, *outParent);
aChild->GetParentNode(getter_AddRefs(parent))));
if (parent) {
*outOffset = GetChildOffset(aChild, parent);
}
return parent.forget();
}
// returns the number of things inside aNode.

View File

@ -443,12 +443,11 @@ public:
nsIDOMNode *aParent);
/**
* Set outParent to the parent of aChild.
* Set outOffset to the offset of aChild in outParent.
* Set outOffset to the offset of aChild in the parent.
* Returns the parent of aChild.
*/
static void GetNodeLocation(nsIDOMNode* aChild,
nsCOMPtr<nsIDOMNode>* outParent,
PRInt32* outOffset);
static already_AddRefed<nsIDOMNode> GetNodeLocation(nsIDOMNode* aChild,
PRInt32* outOffset);
/** returns the number of things inside aNode in the out-param aCount.
* @param aNode is the node to get the length of.

View File

@ -256,10 +256,8 @@ nsRangeUpdater::SelAdjDeleteNode(nsIDOMNode *aNode)
return;
}
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset = 0;
nsEditor::GetNodeLocation(aNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(aNode, &offset);
// check for range endpoints that are after aNode and in the same parent
nsRangeStore *item;
@ -314,9 +312,8 @@ nsRangeUpdater::SelAdjSplitNode(nsIDOMNode *aOldRightNode, PRInt32 aOffset, nsID
return NS_OK;
}
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
nsEditor::GetNodeLocation(aOldRightNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(aOldRightNode, &offset);
// first part is same as inserting aNewLeftnode
nsresult result = SelAdjInsertNode(parent,offset-1);

View File

@ -541,9 +541,8 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
rv = IsEmptyNode(parentNode, &isEmpty, true);
if (NS_SUCCEEDED(rv) && isEmpty)
{
nsCOMPtr<nsIDOMNode> listNode;
PRInt32 newOffset;
GetNodeLocation(parentNode, address_of(listNode), &newOffset);
nsCOMPtr<nsIDOMNode> listNode = GetNodeLocation(parentNode, &newOffset);
if (listNode)
{
DeleteNode(parentNode);
@ -618,7 +617,7 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
}
if (lastInsertNode)
{
GetNodeLocation(lastInsertNode, address_of(parentNode), &offsetOfNewNode);
parentNode = GetNodeLocation(lastInsertNode, &offsetOfNewNode);
offsetOfNewNode++;
}
}
@ -657,7 +656,7 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
else // we need to find a container for selection. Look up.
{
tmp = selNode;
GetNodeLocation(tmp, address_of(selNode), &selOffset);
selNode = GetNodeLocation(tmp, &selOffset);
++selOffset; // want to be *after* last leaf node in paste
}
@ -677,8 +676,7 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
{
// don't leave selection past an invisible break;
// reset {selNode,selOffset} to point before break
GetNodeLocation(wsRunObj.mStartReasonNode, address_of(selNode),
&selOffset);
selNode = GetNodeLocation(wsRunObj.mStartReasonNode, &selOffset);
// we want to be inside any inline style prior to break
nsWSRunObject wsRunObj(this, selNode, selOffset);
wsRunObj.PriorVisibleNode(selNode, selOffset, address_of(visNode),
@ -693,8 +691,7 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
{
// prior visible thing is an image or some other non-text thingy.
// We want to be right after it.
GetNodeLocation(wsRunObj.mStartReasonNode, address_of(selNode),
&selOffset);
selNode = GetNodeLocation(wsRunObj.mStartReasonNode, &selOffset);
++selOffset;
}
}
@ -713,7 +710,7 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
PRInt32 linkOffset;
rv = SplitNodeDeep(link, selNode, selOffset, &linkOffset, true, address_of(leftLink));
NS_ENSURE_SUCCESS(rv, rv);
GetNodeLocation(leftLink, address_of(selNode), &selOffset);
selNode = GetNodeLocation(leftLink, &selOffset);
selection->Collapse(selNode, selOffset+1);
}
}
@ -2009,9 +2006,8 @@ nsHTMLEditor::InsertAsPlaintextQuotation(const nsAString & aQuotedText,
// Set the selection to just after the inserted node:
if (NS_SUCCEEDED(rv) && newNode)
{
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
GetNodeLocation(newNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = GetNodeLocation(newNode, &offset);
if (parent) {
selection->Collapse(parent, offset + 1);
}
@ -2094,9 +2090,8 @@ nsHTMLEditor::InsertAsCitedQuotation(const nsAString & aQuotedText,
// Set the selection to just after the inserted node:
if (NS_SUCCEEDED(rv) && newNode)
{
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
GetNodeLocation(newNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = GetNodeLocation(newNode, &offset);
if (parent) {
selection->Collapse(parent, offset + 1);
}

View File

@ -755,12 +755,11 @@ nsHTMLEditRules::GetAlignment(bool *aMixed, nsIHTMLEditor::EAlignment *aAlign)
NS_ENSURE_SUCCESS(res, res);
// get selection location
nsCOMPtr<nsIDOMNode> parent;
nsCOMPtr<nsIDOMElement> rootElem = do_QueryInterface(mHTMLEditor->GetRoot());
NS_ENSURE_TRUE(rootElem, NS_ERROR_FAILURE);
PRInt32 offset, rootOffset;
nsEditor::GetNodeLocation(rootElem, address_of(parent), &rootOffset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(rootElem, &rootOffset);
res = mHTMLEditor->GetStartNodeAndOffset(selection, getter_AddRefs(parent), &offset);
NS_ENSURE_SUCCESS(res, res);
@ -1203,7 +1202,7 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, bool *aCancel)
// if we are here then the selection is right after a mozBR
// that is in the same block as the selection. We need to move
// the selection start to be before the mozBR.
nsEditor::GetNodeLocation(priorNode, address_of(selNode), &selOffset);
selNode = nsEditor::GetNodeLocation(priorNode, &selOffset);
res = aSelection->Collapse(selNode,selOffset);
NS_ENSURE_SUCCESS(res, res);
}
@ -1608,7 +1607,7 @@ nsHTMLEditRules::StandardBreakImpl(nsIDOMNode* aNode, PRInt32 aOffset,
address_of(brNode), nsIEditor::eNone);
}
NS_ENSURE_SUCCESS(res, res);
nsEditor::GetNodeLocation(brNode, address_of(node), &aOffset);
node = nsEditor::GetNodeLocation(brNode, &aOffset);
NS_ENSURE_TRUE(node, NS_ERROR_NULL_POINTER);
if (bAfterBlock && bBeforeBlock) {
// we just placed a br between block boundaries. This is the one case
@ -1630,9 +1629,8 @@ nsHTMLEditRules::StandardBreakImpl(nsIDOMNode* aNode, PRInt32 aOffset,
// SetInterlinePosition(). It will also assure that if the user clicks
// away and then clicks back on their new blank line, they will still
// get the style from the line above.
nsCOMPtr<nsIDOMNode> brParent;
PRInt32 brOffset;
nsEditor::GetNodeLocation(secondBR, address_of(brParent), &brOffset);
nsCOMPtr<nsIDOMNode> brParent = nsEditor::GetNodeLocation(secondBR, &brOffset);
if (brParent != node || brOffset != aOffset + 1) {
res = mHTMLEditor->MoveNode(secondBR, node, aOffset+1);
NS_ENSURE_SUCCESS(res, res);
@ -1698,7 +1696,7 @@ nsHTMLEditRules::SplitMailCites(nsISelection *aSelection, bool aPlaintext, bool
if (nsEditorUtils::IsDescendantOf(visNode, citeNode, &unused))
{
// it is. so lets reset our selection to be just after it.
mHTMLEditor->GetNodeLocation(visNode, address_of(selNode), &selOffset);
selNode = mHTMLEditor->GetNodeLocation(visNode, &selOffset);
++selOffset;
}
}
@ -1963,7 +1961,7 @@ nsHTMLEditRules::WillDeleteSelection(Selection* aSelection,
bool moveOnly = true;
nsEditor::GetNodeLocation(visNode, address_of(selNode), &selOffset);
selNode = nsEditor::GetNodeLocation(visNode, &selOffset);
bool interLineIsRight;
res = aSelection->GetInterlinePosition(&interLineIsRight);
@ -2509,7 +2507,7 @@ nsHTMLEditRules::GetGoodSelPointForNode(nsIDOMNode *aNode, nsIEditor::EDirection
}
else
{
nsEditor::GetNodeLocation(aNode, outSelNode, outSelOffset);
*outSelNode = nsEditor::GetNodeLocation(aNode, outSelOffset);
if (!nsTextEditUtils::IsBreak(aNode) || mHTMLEditor->IsVisBreak(aNode))
{
if (aAction == nsIEditor::ePrevious)
@ -2852,9 +2850,9 @@ nsHTMLEditRules::DidDeleteSelection(nsISelection *aSelection,
mHTMLEditor->IsEmptyNodeImpl(cite, &isEmpty, true, true, false, &seenBR);
if (isEmpty)
{
nsCOMPtr<nsIDOMNode> parent, brNode;
nsCOMPtr<nsIDOMNode> brNode;
PRInt32 offset;
nsEditor::GetNodeLocation(citeNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(citeNode, &offset);
res = mHTMLEditor->DeleteNode(citeNode);
NS_ENSURE_SUCCESS(res, res);
if (parent && seenBR)
@ -2993,7 +2991,7 @@ nsHTMLEditRules::WillMakeList(nsISelection* aSelection,
nsCOMPtr<nsIDOMNode> newBlock;
nsCOMPtr<nsIDOMNode> curNode = arrayOfNodes[i];
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// make sure we don't assemble content that is in different table cells
// into the same list. respect table cell boundaries when listifying.
@ -3052,9 +3050,8 @@ nsHTMLEditRules::WillMakeList(nsISelection* aSelection,
res = mHTMLEditor->SplitNode(curParent, offset,
getter_AddRefs(newBlock));
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
nsEditor::GetNodeLocation(curParent, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(curParent, &offset);
res = mHTMLEditor->CreateNode(*aListType, parent, offset,
getter_AddRefs(curList));
NS_ENSURE_SUCCESS(res, res);
@ -3207,7 +3204,7 @@ nsHTMLEditRules::WillRemoveList(nsISelection *aSelection,
// here's where we actually figure out what to do
nsIDOMNode* curNode = arrayOfNodes[i];
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
if (nsHTMLEditUtils::IsListItem(curNode)) // unlist this listitem
{
@ -3511,7 +3508,7 @@ nsHTMLEditRules::WillCSSIndent(nsISelection *aSelection, bool *aCancel, bool * a
if (!mHTMLEditor->IsEditable(curNode)) continue;
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// some logic for putting list items into nested lists...
if (nsHTMLEditUtils::IsList(curParent))
@ -3694,7 +3691,7 @@ nsHTMLEditRules::WillHTMLIndent(nsISelection *aSelection, bool *aCancel, bool *
if (!mHTMLEditor->IsEditable(curNode)) continue;
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// some logic for putting list items into nested lists...
if (nsHTMLEditUtils::IsList(curParent))
@ -3775,7 +3772,7 @@ nsHTMLEditRules::WillHTMLIndent(nsISelection *aSelection, bool *aCancel, bool *
if (listitem)
{
if (indentedLI == listitem) continue; // already indented this list item
nsEditor::GetNodeLocation(listitem, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(listitem, &offset);
// check to see if curList is still appropriate. Which it is if
// curNode is still right after it in the same list.
if (curList)
@ -3883,7 +3880,7 @@ nsHTMLEditRules::WillOutdent(nsISelection *aSelection, bool *aCancel, bool *aHan
// here's where we actually figure out what to do
nsCOMPtr<nsIDOMNode> curNode = arrayOfNodes[i];
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// is it a blockquote?
if (nsHTMLEditUtils::IsBlockquote(curNode))
@ -4091,7 +4088,7 @@ nsHTMLEditRules::WillOutdent(nsISelection *aSelection, bool *aCancel, bool *aHan
((sNode == rememberedLeftBQ) || nsEditorUtils::IsDescendantOf(sNode, rememberedLeftBQ)))
{
// selection is inside rememberedLeftBQ - push it past it.
nsEditor::GetNodeLocation(rememberedLeftBQ, address_of(sNode), &sOffset);
sNode = nsEditor::GetNodeLocation(rememberedLeftBQ, &sOffset);
sOffset++;
aSelection->Collapse(sNode, sOffset);
}
@ -4101,7 +4098,7 @@ nsHTMLEditRules::WillOutdent(nsISelection *aSelection, bool *aCancel, bool *aHan
((sNode == rememberedRightBQ) || nsEditorUtils::IsDescendantOf(sNode, rememberedRightBQ)))
{
// selection is inside rememberedRightBQ - push it before it.
nsEditor::GetNodeLocation(rememberedRightBQ, address_of(sNode), &sOffset);
sNode = nsEditor::GetNodeLocation(rememberedRightBQ, &sOffset);
aSelection->Collapse(sNode, sOffset);
}
}
@ -4144,12 +4141,12 @@ nsHTMLEditRules::SplitBlock(nsIDOMNode *aBlock,
{
NS_ENSURE_TRUE(aBlock && aStartChild && aEndChild, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIDOMNode> startParent, endParent, leftNode, rightNode;
nsCOMPtr<nsIDOMNode> leftNode, rightNode;
PRInt32 startOffset, endOffset, offset;
nsresult res;
// get split point location
nsEditor::GetNodeLocation(aStartChild, address_of(startParent), &startOffset);
nsCOMPtr<nsIDOMNode> startParent = nsEditor::GetNodeLocation(aStartChild, &startOffset);
// do the splits!
res = mHTMLEditor->SplitNodeDeep(aBlock, startParent, startOffset, &offset,
@ -4162,7 +4159,7 @@ nsHTMLEditRules::SplitBlock(nsIDOMNode *aBlock,
*aLeftNode = leftNode;
// get split point location
nsEditor::GetNodeLocation(aEndChild, address_of(endParent), &endOffset);
nsCOMPtr<nsIDOMNode> endParent = nsEditor::GetNodeLocation(aEndChild, &endOffset);
endOffset++; // want to be after lastBQChild
// do the splits!
@ -4551,7 +4548,7 @@ nsHTMLEditRules::WillAlign(nsISelection *aSelection,
if (!mHTMLEditor->IsEditable(curNode)) continue;
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// the node is a table element, an horiz rule, a paragraph, a div
// or a section header; in HTML 4, it can directly carry the ALIGN
@ -4770,9 +4767,8 @@ nsHTMLEditRules::CheckForEmptyBlock(nsIDOMNode *aStartNode,
nsCOMPtr<nsIContent> emptyContent = do_QueryInterface(emptyBlock);
if (emptyBlock && emptyContent->IsEditable())
{
nsCOMPtr<nsIDOMNode> blockParent;
PRInt32 offset;
nsEditor::GetNodeLocation(emptyBlock, address_of(blockParent), &offset);
nsCOMPtr<nsIDOMNode> blockParent = nsEditor::GetNodeLocation(emptyBlock, &offset);
NS_ENSURE_TRUE(blockParent && offset >= 0, NS_ERROR_FAILURE);
if (nsHTMLEditUtils::IsListItem(emptyBlock))
@ -4783,10 +4779,9 @@ nsHTMLEditRules::CheckForEmptyBlock(nsIDOMNode *aStartNode,
NS_ENSURE_SUCCESS(res, res);
if (bIsFirst)
{
nsCOMPtr<nsIDOMNode> listParent;
PRInt32 listOffset;
nsEditor::GetNodeLocation(blockParent, address_of(listParent),
&listOffset);
nsCOMPtr<nsIDOMNode> listParent = nsEditor::GetNodeLocation(blockParent,
&listOffset);
NS_ENSURE_TRUE(listParent && listOffset >= 0, NS_ERROR_FAILURE);
// if we are a sublist, skip the br creation
if (!nsHTMLEditUtils::IsList(listParent))
@ -4834,11 +4829,9 @@ nsHTMLEditRules::CheckForInvisibleBR(nsIDOMNode *aBlock,
if (rightmostNode)
{
nsCOMPtr<nsIDOMNode> nodeParent;
PRInt32 nodeOffset;
nsEditor::GetNodeLocation(rightmostNode, address_of(nodeParent),
&nodeOffset);
nsCOMPtr<nsIDOMNode> nodeParent = nsEditor::GetNodeLocation(rightmostNode,
&nodeOffset);
runTest = true;
testNode = nodeParent;
// use offset + 1, because we want the last node included in our
@ -4979,7 +4972,8 @@ nsHTMLEditRules::ExpandSelectionForDeletion(nsISelection *aSelection)
}
else
{
nsEditor::GetNodeLocation(wsObj.mStartReasonNode, address_of(selStartNode), &selStartOffset);
selStartNode = nsEditor::GetNodeLocation(wsObj.mStartReasonNode,
&selStartOffset);
}
}
else
@ -5011,7 +5005,7 @@ nsHTMLEditRules::ExpandSelectionForDeletion(nsISelection *aSelection)
firstBRParent = selEndNode;
firstBROffset = selEndOffset;
}
nsEditor::GetNodeLocation(wsObj.mEndReasonNode, address_of(selEndNode), &selEndOffset);
selEndNode = nsEditor::GetNodeLocation(wsObj.mEndReasonNode, &selEndOffset);
++selEndOffset;
}
}
@ -5027,7 +5021,7 @@ nsHTMLEditRules::ExpandSelectionForDeletion(nsISelection *aSelection)
}
else
{
nsEditor::GetNodeLocation(wsObj.mEndReasonNode, address_of(selEndNode), &selEndOffset);
selEndNode = nsEditor::GetNodeLocation(wsObj.mEndReasonNode, &selEndOffset);
++selEndOffset;
}
}
@ -5150,7 +5144,7 @@ nsHTMLEditRules::NormalizeSelection(nsISelection *inSelection)
nsCOMPtr<nsIDOMNode> child = mHTMLEditor->GetRightmostChild(wsEndObj.mStartReasonNode, true);
if (child)
{
nsEditor::GetNodeLocation(child, address_of(newEndNode), &newEndOffset);
newEndNode = nsEditor::GetNodeLocation(child, &newEndOffset);
++newEndOffset; // offset *after* child
}
// else block is empty - we can leave selection alone here, i think.
@ -5162,8 +5156,7 @@ nsHTMLEditRules::NormalizeSelection(nsISelection *inSelection)
res = mHTMLEditor->GetPriorHTMLNode(endNode, endOffset, address_of(child));
if (child)
{
nsEditor::GetNodeLocation(child, address_of(newEndNode),
&newEndOffset);
newEndNode = nsEditor::GetNodeLocation(child, &newEndOffset);
++newEndOffset; // offset *after* child
}
// else block is empty - we can leave selection alone here, i think.
@ -5171,8 +5164,8 @@ nsHTMLEditRules::NormalizeSelection(nsISelection *inSelection)
else if (wsEndObj.mStartReason == nsWSRunObject::eBreak)
{
// endpoint is just after break. lets adjust it to before it.
nsEditor::GetNodeLocation(wsEndObj.mStartReasonNode,
address_of(newEndNode), &newEndOffset);
newEndNode = nsEditor::GetNodeLocation(wsEndObj.mStartReasonNode,
&newEndOffset);
}
}
@ -5193,8 +5186,7 @@ nsHTMLEditRules::NormalizeSelection(nsISelection *inSelection)
nsCOMPtr<nsIDOMNode> child = mHTMLEditor->GetLeftmostChild(wsStartObj.mEndReasonNode, true);
if (child)
{
nsEditor::GetNodeLocation(child, address_of(newStartNode),
&newStartOffset);
newStartNode = nsEditor::GetNodeLocation(child, &newStartOffset);
}
// else block is empty - we can leave selection alone here, i think.
}
@ -5205,16 +5197,15 @@ nsHTMLEditRules::NormalizeSelection(nsISelection *inSelection)
res = mHTMLEditor->GetNextHTMLNode(startNode, startOffset, address_of(child));
if (child)
{
nsEditor::GetNodeLocation(child, address_of(newStartNode),
&newStartOffset);
newStartNode = nsEditor::GetNodeLocation(child, &newStartOffset);
}
// else block is empty - we can leave selection alone here, i think.
}
else if (wsStartObj.mEndReason == nsWSRunObject::eBreak)
{
// startpoint is just before a break. lets adjust it to after it.
nsEditor::GetNodeLocation(wsStartObj.mEndReasonNode,
address_of(newStartNode), &newStartOffset);
newStartNode = nsEditor::GetNodeLocation(wsStartObj.mEndReasonNode,
&newStartOffset);
++newStartOffset; // offset *after* break
}
}
@ -6059,8 +6050,7 @@ nsHTMLEditRules::BustUpInlinesAtBRs(nsIDOMNode *inNode,
breakNode = arrayOfBreaks[i];
NS_ENSURE_TRUE(breakNode, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(splitDeepNode, NS_ERROR_NULL_POINTER);
nsEditor::GetNodeLocation(breakNode, address_of(splitParentNode),
&splitOffset);
splitParentNode = nsEditor::GetNodeLocation(breakNode, &splitOffset);
res = mHTMLEditor->SplitNodeDeep(splitDeepNode, splitParentNode, splitOffset,
&resultOffset, false, address_of(leftNode), address_of(rightNode));
NS_ENSURE_SUCCESS(res, res);
@ -6260,9 +6250,8 @@ nsHTMLEditRules::ReturnInHeader(nsISelection *aSelection,
NS_ENSURE_TRUE(aSelection && aHeader && aNode, NS_ERROR_NULL_POINTER);
// remeber where the header is
nsCOMPtr<nsIDOMNode> headerParent;
PRInt32 offset;
nsEditor::GetNodeLocation(aHeader, address_of(headerParent), &offset);
nsCOMPtr<nsIDOMNode> headerParent = nsEditor::GetNodeLocation(aHeader, &offset);
// get ws code to adjust any ws
nsCOMPtr<nsIDOMNode> selNode = aNode;
@ -6321,7 +6310,7 @@ nsHTMLEditRules::ReturnInHeader(nsISelection *aSelection,
}
else
{
nsEditor::GetNodeLocation(sibling, address_of(headerParent), &offset);
headerParent = nsEditor::GetNodeLocation(sibling, &offset);
// put selection after break
res = aSelection->Collapse(headerParent,offset+1);
}
@ -6352,9 +6341,8 @@ nsHTMLEditRules::ReturnInParagraph(nsISelection* aSelection,
*aHandled = false;
nsresult res;
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
nsEditor::GetNodeLocation(aNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(aNode, &offset);
bool doesCRCreateNewP = mHTMLEditor->GetReturnInParagraphCreatesNewParagraph();
@ -6481,9 +6469,8 @@ nsHTMLEditRules::SplitParagraph(nsIDOMNode *aPara,
}
else
{
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
nsEditor::GetNodeLocation(child, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(child, &offset);
aSelection->Collapse(parent,offset);
}
return res;
@ -6513,9 +6500,8 @@ nsHTMLEditRules::ReturnInListItem(nsISelection *aSelection,
// get the listitem parent and the active editing host.
nsIContent* rootContent = mHTMLEditor->GetActiveEditingHost();
nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(rootContent);
nsCOMPtr<nsIDOMNode> list;
PRInt32 itemOffset;
nsEditor::GetNodeLocation(aListItem, address_of(list), &itemOffset);
nsCOMPtr<nsIDOMNode> list = nsEditor::GetNodeLocation(aListItem, &itemOffset);
// if we are in an empty listitem, then we want to pop up out of the list
// but only if prefs says it's ok and if the parent isn't the active editing host.
@ -6525,9 +6511,8 @@ nsHTMLEditRules::ReturnInListItem(nsISelection *aSelection,
if (isEmpty && (rootNode != list) && mReturnInEmptyLIKillsList)
{
// get the list offset now -- before we might eventually split the list
nsCOMPtr<nsIDOMNode> listparent;
PRInt32 offset;
nsEditor::GetNodeLocation(list, address_of(listparent), &offset);
nsCOMPtr<nsIDOMNode> listparent = nsEditor::GetNodeLocation(list, &offset);
// are we the last list item in the list?
bool bIsLast;
@ -6603,9 +6588,8 @@ nsHTMLEditRules::ReturnInListItem(nsISelection *aSelection,
nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(aListItem);
if (nodeAtom == nsEditProperty::dd || nodeAtom == nsEditProperty::dt)
{
nsCOMPtr<nsIDOMNode> list;
PRInt32 itemOffset;
nsEditor::GetNodeLocation(aListItem, address_of(list), &itemOffset);
nsCOMPtr<nsIDOMNode> list = nsEditor::GetNodeLocation(aListItem, &itemOffset);
nsAutoString listTag((nodeAtom == nsEditProperty::dt) ? NS_LITERAL_STRING("dd") : NS_LITERAL_STRING("dt"));
nsCOMPtr<nsIDOMNode> newListItem;
@ -6621,9 +6605,8 @@ nsHTMLEditRules::ReturnInListItem(nsISelection *aSelection,
NS_ENSURE_SUCCESS(res, res);
if (brNode)
{
nsCOMPtr<nsIDOMNode> brParent;
PRInt32 offset;
nsEditor::GetNodeLocation(brNode, address_of(brParent), &offset);
nsCOMPtr<nsIDOMNode> brParent = nsEditor::GetNodeLocation(brNode, &offset);
return aSelection->Collapse(brParent, offset);
}
}
@ -6639,9 +6622,8 @@ nsHTMLEditRules::ReturnInListItem(nsISelection *aSelection,
(wsType==nsWSRunObject::eBreak) ||
nsHTMLEditUtils::IsHR(visNode) )
{
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
nsEditor::GetNodeLocation(visNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(visNode, &offset);
return aSelection->Collapse(parent, offset);
}
else
@ -6680,7 +6662,7 @@ nsHTMLEditRules::MakeBlockquote(nsCOMArray<nsIDOMNode>& arrayOfNodes)
{
// get the node to act on, and its location
curNode = arrayOfNodes[i];
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// if the node is a table element or list item, dive inside
if (nsHTMLEditUtils::IsTableElementButNotTable(curNode) ||
@ -6878,7 +6860,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsCOMArray<nsIDOMNode>& arrayOfNodes, const nsA
{
// get the node to act on, and its location
curNode = arrayOfNodes[i];
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
nsAutoString curNodeTag;
nsEditor::GetTagString(curNode, curNodeTag);
ToLowerCase(curNodeTag);
@ -7070,8 +7052,8 @@ nsHTMLEditRules::JoinNodesSmart( nsIDOMNode *aNodeLeft,
// caller responsible for:
// left & right node are same type
PRInt32 parOffset;
nsCOMPtr<nsIDOMNode> parent, rightParent;
nsEditor::GetNodeLocation(aNodeLeft, address_of(parent), &parOffset);
nsCOMPtr<nsIDOMNode> rightParent;
nsCOMPtr<nsIDOMNode> parent = nsEditor::GetNodeLocation(aNodeLeft, &parOffset);
aNodeRight->GetParentNode(getter_AddRefs(rightParent));
// if they don't have the same parent, first move the 'right' node
@ -7342,9 +7324,7 @@ nsHTMLEditRules::PinSelectionToNewBlock(nsISelection *aSelection)
}
else
{
nsCOMPtr<nsIDOMNode> tmp2;
nsEditor::GetNodeLocation(tmp, address_of(tmp2), (PRInt32*)&endPoint);
tmp = tmp2;
tmp = nsEditor::GetNodeLocation(tmp, (PRInt32*)&endPoint);
endPoint++; // want to be after this node
}
return aSelection->Collapse(tmp, (PRInt32)endPoint);
@ -7357,9 +7337,7 @@ nsHTMLEditRules::PinSelectionToNewBlock(nsISelection *aSelection)
PRInt32 offset;
if (!(mHTMLEditor->IsTextNode(tmp) || mHTMLEditor->IsContainer(tmp)))
{
nsCOMPtr<nsIDOMNode> tmp2;
nsEditor::GetNodeLocation(tmp, address_of(tmp2), &offset);
tmp = tmp2;
tmp = nsEditor::GetNodeLocation(tmp, &offset);
}
return aSelection->Collapse(tmp, 0);
}
@ -7433,7 +7411,7 @@ nsHTMLEditRules::AdjustSelection(nsISelection *aSelection, nsIEditor::EDirection
while (!mHTMLEditor->IsEditable(selNode))
{
// scan up the tree until we find an editable place to be
nsEditor::GetNodeLocation(temp, address_of(selNode), &selOffset);
selNode = nsEditor::GetNodeLocation(temp, &selOffset);
NS_ENSURE_TRUE(selNode, NS_ERROR_FAILURE);
temp = selNode;
}
@ -7496,7 +7474,7 @@ nsHTMLEditRules::AdjustSelection(nsISelection *aSelection, nsIEditor::EDirection
nsCOMPtr<nsIDOMNode> brNode;
res = CreateMozBR(selNode, selOffset, getter_AddRefs(brNode));
NS_ENSURE_SUCCESS(res, res);
nsEditor::GetNodeLocation(brNode, address_of(selNode), &selOffset);
selNode = nsEditor::GetNodeLocation(brNode, &selOffset);
// selection stays *before* moz-br, sticking to it
selPriv->SetInterlinePosition(true);
res = aSelection->Collapse(selNode,selOffset);
@ -7552,7 +7530,7 @@ nsHTMLEditRules::AdjustSelection(nsISelection *aSelection, nsIEditor::EDirection
}
else // must be break or image
{
nsEditor::GetNodeLocation(nearNode, address_of(selNode), &selOffset);
selNode = nsEditor::GetNodeLocation(nearNode, &selOffset);
if (aAction == nsIEditor::ePrevious) selOffset++; // want to be beyond it if we backed up to it
res = aSelection->Collapse(selNode, selOffset);
}
@ -7783,7 +7761,7 @@ nsHTMLEditRules::RemoveEmptyNodes()
// but preserve br.
nsCOMPtr<nsIDOMNode> parent, brNode;
PRInt32 offset;
nsEditor::GetNodeLocation(delNode, address_of(parent), &offset);
parent = nsEditor::GetNodeLocation(delNode, &offset);
res = mHTMLEditor->CreateBR(parent, offset, address_of(brNode));
NS_ENSURE_SUCCESS(res, res);
}
@ -7909,19 +7887,17 @@ nsHTMLEditRules::PopListItem(nsIDOMNode *aListItem, bool *aOutOfList)
// init out params
*aOutOfList = false;
nsCOMPtr<nsIDOMNode> curParent;
nsCOMPtr<nsIDOMNode> curNode( do_QueryInterface(aListItem));
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
nsCOMPtr<nsIDOMNode> curParent = nsEditor::GetNodeLocation(curNode, &offset);
if (!nsHTMLEditUtils::IsListItem(curNode))
return NS_ERROR_FAILURE;
// if it's first or last list item, don't need to split the list
// otherwise we do.
nsCOMPtr<nsIDOMNode> curParPar;
PRInt32 parOffset;
nsEditor::GetNodeLocation(curParent, address_of(curParPar), &parOffset);
nsCOMPtr<nsIDOMNode> curParPar = nsEditor::GetNodeLocation(curParent, &parOffset);
bool bIsFirstListItem;
nsresult res = mHTMLEditor->IsFirstEditableChild(curNode, &bIsFirstListItem);
@ -8702,7 +8678,7 @@ nsHTMLEditRules::WillAbsolutePosition(nsISelection *aSelection, bool *aCancel, b
if (!mHTMLEditor->IsEditable(curNode)) continue;
PRInt32 offset;
nsEditor::GetNodeLocation(curNode, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(curNode, &offset);
// some logic for putting list items into nested lists...
if (nsHTMLEditUtils::IsList(curParent))
@ -8725,9 +8701,7 @@ nsHTMLEditRules::WillAbsolutePosition(nsISelection *aSelection, bool *aCancel, b
NS_ENSURE_SUCCESS(res, res);
if (!curPositionedDiv) {
PRInt32 parentOffset;
nsCOMPtr<nsIDOMNode> curParentParent;
nsEditor::GetNodeLocation(curParent, address_of(curParentParent),
&parentOffset);
nsCOMPtr<nsIDOMNode> curParentParent = nsEditor::GetNodeLocation(curParent, &parentOffset);
res = mHTMLEditor->CreateNode(divType, curParentParent, parentOffset, getter_AddRefs(curPositionedDiv));
mNewBlock = curPositionedDiv;
}
@ -8756,7 +8730,7 @@ nsHTMLEditRules::WillAbsolutePosition(nsISelection *aSelection, bool *aCancel, b
if (listitem)
{
if (indentedLI == listitem) continue; // already indented this list item
nsEditor::GetNodeLocation(listitem, address_of(curParent), &offset);
curParent = nsEditor::GetNodeLocation(listitem, &offset);
// check to see if curList is still appropriate. Which it is if
// curNode is still right after it in the same list.
if (curList)
@ -8775,9 +8749,7 @@ nsHTMLEditRules::WillAbsolutePosition(nsISelection *aSelection, bool *aCancel, b
NS_ENSURE_SUCCESS(res, res);
if (!curPositionedDiv) {
PRInt32 parentOffset;
nsCOMPtr<nsIDOMNode> curParentParent;
nsEditor::GetNodeLocation(curParent, address_of(curParentParent),
&parentOffset);
nsCOMPtr<nsIDOMNode> curParentParent = nsEditor::GetNodeLocation(curParent, &parentOffset);
res = mHTMLEditor->CreateNode(divType, curParentParent, parentOffset, getter_AddRefs(curPositionedDiv));
mNewBlock = curPositionedDiv;
}

View File

@ -526,7 +526,7 @@ nsHTMLEditor::BeginningOfDocument()
else if ((visType==nsWSRunObject::eBreak) ||
(visType==nsWSRunObject::eSpecial))
{
GetNodeLocation(visNode, address_of(selNode), &selOffset);
selNode = GetNodeLocation(visNode, &selOffset);
done = true;
}
else if (visType==nsWSRunObject::eOtherBlock)
@ -546,7 +546,7 @@ nsHTMLEditor::BeginningOfDocument()
// like a <hr>
// We want to place the caret in front of that block.
GetNodeLocation(visNode, address_of(selNode), &selOffset);
selNode = GetNodeLocation(visNode, &selOffset);
done = true;
}
else
@ -556,7 +556,7 @@ nsHTMLEditor::BeginningOfDocument()
isEmptyBlock)
{
// skip the empty block
GetNodeLocation(visNode, address_of(curNode), &curOffset);
curNode = GetNodeLocation(visNode, &curOffset);
++curOffset;
}
else
@ -941,7 +941,7 @@ bool nsHTMLEditor::IsVisBreak(nsIDOMNode *aNode)
// determine what is going on
nsCOMPtr<nsIDOMNode> selNode, tmp;
PRInt32 selOffset;
GetNodeLocation(aNode, address_of(selNode), &selOffset);
selNode = GetNodeLocation(aNode, &selOffset);
selOffset++; // lets look after the break
nsWSRunObject wsObj(this, selNode, selOffset);
nsCOMPtr<nsIDOMNode> visNode;
@ -1468,10 +1468,8 @@ nsHTMLEditor::NormalizeEOLInsertPosition(nsIDOMNode *firstNodeToInsert,
if (prevVisType & nsWSRunObject::eThisBlock)
return;
nsCOMPtr<nsIDOMNode> brNode;
PRInt32 brOffset=0;
GetNodeLocation(nextVisNode, address_of(brNode), &brOffset);
nsCOMPtr<nsIDOMNode> brNode = GetNodeLocation(nextVisNode, &brOffset);
*insertParentNode = brNode;
*insertOffset = brOffset + 1;

View File

@ -937,13 +937,13 @@ nsresult nsHTMLEditor::PromoteRangeIfStartsOrEndsInNamedAnchor(nsIDOMRange *inRa
!nsTextEditUtils::IsBody(tmp) &&
!nsHTMLEditUtils::IsNamedAnchor(tmp))
{
GetNodeLocation(tmp, address_of(parent), &tmpOffset);
parent = GetNodeLocation(tmp, &tmpOffset);
tmp = parent;
}
NS_ENSURE_TRUE(tmp, NS_ERROR_NULL_POINTER);
if (nsHTMLEditUtils::IsNamedAnchor(tmp))
{
GetNodeLocation(tmp, address_of(parent), &tmpOffset);
parent = GetNodeLocation(tmp, &tmpOffset);
startNode = parent;
startOffset = tmpOffset;
}
@ -953,13 +953,13 @@ nsresult nsHTMLEditor::PromoteRangeIfStartsOrEndsInNamedAnchor(nsIDOMRange *inRa
!nsTextEditUtils::IsBody(tmp) &&
!nsHTMLEditUtils::IsNamedAnchor(tmp))
{
GetNodeLocation(tmp, address_of(parent), &tmpOffset);
parent = GetNodeLocation(tmp, &tmpOffset);
tmp = parent;
}
NS_ENSURE_TRUE(tmp, NS_ERROR_NULL_POINTER);
if (nsHTMLEditUtils::IsNamedAnchor(tmp))
{
GetNodeLocation(tmp, address_of(parent), &tmpOffset);
parent = GetNodeLocation(tmp, &tmpOffset);
endNode = parent;
endOffset = tmpOffset + 1;
}
@ -991,7 +991,7 @@ nsresult nsHTMLEditor::PromoteInlineRange(nsIDOMRange *inRange)
IsEditable(startNode) &&
IsAtFrontOfNode(startNode, startOffset) )
{
GetNodeLocation(startNode, address_of(parent), &startOffset);
parent = GetNodeLocation(startNode, &startOffset);
startNode = parent;
}
NS_ENSURE_TRUE(startNode, NS_ERROR_NULL_POINTER);
@ -1001,7 +1001,7 @@ nsresult nsHTMLEditor::PromoteInlineRange(nsIDOMRange *inRange)
IsEditable(endNode) &&
IsAtEndOfNode(endNode, endOffset) )
{
GetNodeLocation(endNode, address_of(parent), &endOffset);
parent = GetNodeLocation(endNode, &endOffset);
endNode = parent;
endOffset++; // we are AFTER this node
}

View File

@ -116,9 +116,8 @@ nsWSRunObject::PrepareToDeleteNode(nsHTMLEditor *aHTMLEd,
{
NS_ENSURE_TRUE(aNode && aHTMLEd, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
aHTMLEd->GetNodeLocation(aNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = aHTMLEd->GetNodeLocation(aNode, &offset);
nsWSRunObject leftWSObj(aHTMLEd, parent, offset);
nsWSRunObject rightWSObj(aHTMLEd, parent, offset+1);

View File

@ -228,8 +228,7 @@ nsresult nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
// The decision for dropping before or after the
// subtree should really be done based on coordinates.
GetNodeLocation(userSelectNode, address_of(newSelectionParent),
&newSelectionOffset);
newSelectionParent = GetNodeLocation(userSelectNode, &newSelectionOffset);
NS_ENSURE_TRUE(newSelectionParent, NS_ERROR_FAILURE);
}

View File

@ -427,11 +427,10 @@ nsPlaintextEditor::CreateBRImpl(nsCOMPtr<nsIDOMNode>* aInOutParent,
nsCOMPtr<nsIDOMNode> brNode;
if (nodeAsText)
{
nsCOMPtr<nsIDOMNode> tmp;
PRInt32 offset;
PRUint32 len;
nodeAsText->GetLength(&len);
GetNodeLocation(node, address_of(tmp), &offset);
nsCOMPtr<nsIDOMNode> tmp = GetNodeLocation(node, &offset);
NS_ENSURE_TRUE(tmp, NS_ERROR_FAILURE);
if (!theOffset)
{
@ -447,7 +446,7 @@ nsPlaintextEditor::CreateBRImpl(nsCOMPtr<nsIDOMNode>* aInOutParent,
// split the text node
res = SplitNode(node, theOffset, getter_AddRefs(tmp));
NS_ENSURE_SUCCESS(res, res);
GetNodeLocation(node, address_of(tmp), &offset);
tmp = GetNodeLocation(node, &offset);
}
// create br
res = CreateNode(brType, tmp, offset, getter_AddRefs(brNode));
@ -465,9 +464,8 @@ nsPlaintextEditor::CreateBRImpl(nsCOMPtr<nsIDOMNode>* aInOutParent,
*outBRNode = brNode;
if (*outBRNode && (aSelect != eNone))
{
nsCOMPtr<nsIDOMNode> parent;
PRInt32 offset;
GetNodeLocation(*outBRNode, address_of(parent), &offset);
nsCOMPtr<nsIDOMNode> parent = GetNodeLocation(*outBRNode, &offset);
nsCOMPtr<nsISelection> selection;
res = GetSelection(getter_AddRefs(selection));
@ -524,7 +522,7 @@ nsPlaintextEditor::InsertBR(nsCOMPtr<nsIDOMNode>* outBRNode)
NS_ENSURE_SUCCESS(res, res);
// position selection after br
GetNodeLocation(*outBRNode, address_of(selNode), &selOffset);
selNode = GetNodeLocation(*outBRNode, &selOffset);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
selPriv->SetInterlinePosition(true);
return selection->Collapse(selNode, selOffset+1);
@ -1565,9 +1563,8 @@ nsPlaintextEditor::SelectEntireDocument(nsISelection *aSelection)
nsCOMPtr<nsIDOMNode> childNode = GetChildAt(selNode, selOffset - 1);
if (childNode && nsTextEditUtils::IsMozBR(childNode)) {
nsCOMPtr<nsIDOMNode> parentNode;
PRInt32 parentOffset;
GetNodeLocation(childNode, address_of(parentNode), &parentOffset);
nsCOMPtr<nsIDOMNode> parentNode = GetNodeLocation(childNode, &parentOffset);
return aSelection->Extend(parentNode, parentOffset);
}

View File

@ -417,9 +417,8 @@ nsTextEditRules::CollapseSelectionToTrailingBRIfNeeded(nsISelection* aSelection)
if (selOffset != PRInt32(length))
return NS_OK;
nsCOMPtr<nsIDOMNode> parentNode;
PRInt32 parentOffset;
nsEditor::GetNodeLocation(selNode, address_of(parentNode), &parentOffset);
nsCOMPtr<nsIDOMNode> parentNode = nsEditor::GetNodeLocation(selNode, &parentOffset);
nsCOMPtr<nsIDOMNode> root = do_QueryInterface(mEditor->GetRoot());
NS_ENSURE_TRUE(root, NS_ERROR_NULL_POINTER);

View File

@ -139,6 +139,8 @@ NS_NewHTMLVideoFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
@ -2407,25 +2409,30 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
#endif
if (aDocElement->IsSVG()) {
if (aDocElement->Tag() == nsGkAtoms::svg) {
contentFrame = NS_NewSVGOuterSVGFrame(mPresShell, styleContext);
if (NS_UNLIKELY(!contentFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(state, aDocElement,
state.GetGeometricParent(display,
mDocElementContainingBlock),
nsnull, contentFrame);
// We're going to call the right function ourselves, so no need to give a
// function to this FrameConstructionData.
// XXXbz on the other hand, if we converted this whole function to
// FrameConstructionData/Item, then we'd need the right function
// here... but would probably be able to get away with less code in this
// function in general.
// Use a null PendingBinding, since our binding is not in fact pending.
static const FrameConstructionData rootSVGData = FCDATA_DECL(0, nsnull);
nsRefPtr<nsStyleContext> extraRef(styleContext);
FrameConstructionItem item(&rootSVGData, aDocElement,
aDocElement->Tag(), kNameSpaceID_SVG,
nsnull, extraRef.forget(), true);
// AddChild takes care of transforming the frame tree for fixed-pos
// or abs-pos situations
nsFrameItems frameItems;
rv = state.AddChild(contentFrame, frameItems, aDocElement,
styleContext, mDocElementContainingBlock);
if (NS_FAILED(rv) || frameItems.IsEmpty()) {
rv = ConstructOuterSVG(state, item, mDocElementContainingBlock,
styleContext->GetStyleDisplay(),
frameItems, &contentFrame);
if (NS_FAILED(rv))
return rv;
}
if (!contentFrame || frameItems.IsEmpty())
return NS_ERROR_FAILURE;
*aNewFrame = frameItems.FirstChild();
processChildren = true;
NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames");
} else {
return NS_ERROR_FAILURE;
}
@ -2498,8 +2505,9 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
// Still need to process the child content
nsFrameItems childItems;
NS_ASSERTION(!nsLayoutUtils::GetAsBlock(contentFrame),
"Only XUL and SVG frames should reach here");
NS_ASSERTION(!nsLayoutUtils::GetAsBlock(contentFrame) &&
!contentFrame->IsFrameOfType(nsIFrame::eSVG),
"Only XUL frames should reach here");
// Use a null PendingBinding, since our binding is not in fact pending.
ProcessChildren(state, aDocElement, styleContext, contentFrame, true,
childItems, false, nsnull);
@ -4702,6 +4710,82 @@ nsCSSFrameConstructor::FindMathMLData(Element* aElement,
ArrayLength(sMathMLData));
}
// Construct an nsSVGOuterSVGFrame, the anonymous child that wraps its real
// children, and its descendant frames.
nsresult
nsCSSFrameConstructor::ConstructOuterSVG(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aDisplay,
nsFrameItems& aFrameItems,
nsIFrame** aNewFrame)
{
nsIContent* const content = aItem.mContent;
nsStyleContext* const styleContext = aItem.mStyleContext;
nsresult rv = NS_OK;
// Create the nsSVGOuterSVGFrame:
nsIFrame* newFrame = NS_NewSVGOuterSVGFrame(mPresShell, styleContext);
nsIFrame* geometricParent =
aState.GetGeometricParent(styleContext->GetStyleDisplay(),
aParentFrame);
InitAndRestoreFrame(aState, content, geometricParent, nsnull, newFrame);
// Create the pseudo SC for the anonymous wrapper child as a child of the SC:
nsRefPtr<nsStyleContext> scForAnon;
scForAnon = mPresShell->StyleSet()->
ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozSVGOuterSVGAnonChild,
styleContext);
// Create the anonymous inner wrapper frame
nsIFrame* innerFrame = NS_NewSVGOuterSVGAnonChildFrame(mPresShell, scForAnon);
if (!innerFrame) {
newFrame->Destroy();
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, content, newFrame, nsnull, innerFrame);
// Put the newly created frames into the right child list
SetInitialSingleChild(newFrame, innerFrame);
rv = aState.AddChild(newFrame, aFrameItems, content, styleContext,
aParentFrame);
if (NS_FAILED(rv)) {
return rv;
}
if (!mRootElementFrame) {
// The frame we're constructing will be the root element frame.
// Set mRootElementFrame before processing children.
mRootElementFrame = newFrame;
}
nsFrameItems childItems;
// Process children
if (aItem.mFCData->mBits & FCDATA_USE_CHILD_ITEMS) {
rv = ConstructFramesFromItemList(aState, aItem.mChildItems,
innerFrame, childItems);
} else {
rv = ProcessChildren(aState, content, styleContext, innerFrame,
true, childItems, false, aItem.mPendingBinding);
}
// XXXbz what about cleaning up?
if (NS_FAILED(rv)) return rv;
// Set the inner wrapper frame's initial primary list
innerFrame->SetInitialChildList(kPrincipalList, childItems);
*aNewFrame = newFrame;
return rv;
}
// Only outer <svg> elements can be floated or positioned. All other SVG
// should be in-flow.
#define SIMPLE_SVG_FCDATA(_func) \
@ -4789,8 +4873,7 @@ nsCSSFrameConstructor::FindSVGData(Element* aElement,
// and do the PassesConditionalProcessingTests call in
// nsSVGOuterSVGFrame::Init.
static const FrameConstructionData sOuterSVGData =
FCDATA_DECL(FCDATA_SKIP_ABSPOS_PUSH | FCDATA_DISALLOW_GENERATED_CONTENT,
NS_NewSVGOuterSVGFrame);
FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructOuterSVG);
return &sOuterSVGData;
}

View File

@ -1351,6 +1351,18 @@ private:
nsStyleContext* aStyleContext);
// SVG - rods
/**
* Construct an nsSVGOuterSVGFrame, the anonymous child that wraps its real
* children, and its descendant frames. This is the FrameConstructionData
* callback used for the job.
*/
nsresult ConstructOuterSVG(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aDisplay,
nsFrameItems& aFrameItems,
nsIFrame** aNewFrame);
static const FrameConstructionData* FindSVGData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,

View File

@ -25,7 +25,7 @@
background-color: #844BCA;
-moz-transform: rotateY(91deg) translateX(0px) translateZ(0px);
-moz-transition: 5s;
transition: 5s;
}
</style>

View File

@ -147,6 +147,7 @@ FRAME_ID(nsSVGLinearGradientFrame)
FRAME_ID(nsSVGMarkerFrame)
FRAME_ID(nsSVGMaskFrame)
FRAME_ID(nsSVGOuterSVGFrame)
FRAME_ID(nsSVGOuterSVGAnonChildFrame)
FRAME_ID(nsSVGPaintServerFrame)
FRAME_ID(nsSVGPathGeometryFrame)
FRAME_ID(nsSVGPatternFrame)

View File

@ -596,7 +596,6 @@ nsHTMLReflowState::InitFrameType(nsIAtom* aFrameType)
// takes precedence over float which takes precedence over display.
// XXXldb nsRuleNode::ComputeDisplayData should take care of this, right?
// Make sure the frame was actually moved out of the flow, and don't
// just assume what the style says, because we might not have had a
// useful float/absolute containing block
@ -1642,6 +1641,7 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState* aCBReflowState)
// Make sure not to return a negative height here!
return NS_MAX(result, 0);
}
// Called by InitConstraints() to compute the containing block rectangle for
// the element. Handles the special logic for absolutely positioned elements
void
@ -1672,7 +1672,7 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(nsPresContext* aPres
nsMargin computedBorder = aContainingBlockRS->mComputedBorderPadding -
aContainingBlockRS->mComputedPadding;
aContainingBlockWidth = aContainingBlockRS->frame->GetRect().width -
computedBorder.LeftRight();;
computedBorder.LeftRight();
NS_ASSERTION(aContainingBlockWidth >= 0,
"Negative containing block width!");
aContainingBlockHeight = aContainingBlockRS->frame->GetRect().height -

View File

@ -901,7 +901,7 @@ public:
// The initial overflow area passed to FinishAndStoreOverflow. This is only set
// on frames that Preserve3D(), and when at least one of the overflow areas
// differs from the frame bound rect.
NS_DECLARE_FRAME_PROPERTY(InitialOverflowProperty, DestroyOverflowAreas);
NS_DECLARE_FRAME_PROPERTY(InitialOverflowProperty, DestroyOverflowAreas)
NS_DECLARE_FRAME_PROPERTY(UsedMarginProperty, DestroyMargin)
NS_DECLARE_FRAME_PROPERTY(UsedPaddingProperty, DestroyMargin)
@ -2975,7 +2975,7 @@ protected:
* Input: mDirection
* Output: mResultContent, mContentOffset
*/
nsresult PeekOffsetParagraph(nsPeekOffsetStruct *aPos);
nsresult PeekOffsetParagraph(nsPeekOffsetStruct *aPos);
private:
nsOverflowAreas* GetOverflowAreasProperty();

View File

@ -396,7 +396,7 @@ public:
struct TrimmedOffsets {
PRInt32 mStart;
PRInt32 mLength;
PRInt32 GetEnd() { return mStart + mLength; }
PRInt32 GetEnd() const { return mStart + mLength; }
};
TrimmedOffsets GetTrimmedOffsets(const nsTextFragment* aFrag,
bool aTrimAfter);

View File

@ -5349,6 +5349,7 @@ nsTextFrame::GetCaretColorAt(PRInt32 aOffset)
{
NS_PRECONDITION(aOffset >= 0, "aOffset must be positive");
nscolor result = nsFrame::GetCaretColorAt(aOffset);
gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated);
PropertyProvider provider(this, iter, nsTextFrame::eInflated);
PRInt32 contentOffset = provider.GetStart().GetOriginalOffset();
@ -5358,13 +5359,12 @@ nsTextFrame::GetCaretColorAt(PRInt32 aOffset)
"aOffset must be in the frame's range");
PRInt32 offsetInFrame = aOffset - contentOffset;
if (offsetInFrame < 0 || offsetInFrame >= contentLength) {
return nsFrame::GetCaretColorAt(aOffset);
return result;
}
nsTextPaintStyle textPaintStyle(this);
SelectionDetails* details = GetSelectionDetails();
SelectionDetails* sdptr = details;
nscolor result = nsFrame::GetCaretColorAt(aOffset);
SelectionType type = 0;
while (sdptr) {
PRInt32 start = NS_MAX(0, sdptr->mStart - contentOffset);

View File

@ -1,7 +1,7 @@
<html class="reftest-wait">
<title>Test for CSS transitions and re-wrapping of inlines</title>
<style type="text/css">
#test { -moz-transition: 5s color linear 200s; }
#test { transition: 5s color linear 200s; }
</style>
<script type="text/javascript">

View File

@ -1,7 +1,7 @@
<html class="reftest-wait">
<title>Test for CSS transitions and re-wrapping of inlines</title>
<style type="text/css">
#test { -moz-transition: 20ms color linear 0; }
#test { transition: 20ms color linear 0; }
</style>
<script type="text/javascript">

View File

@ -1,7 +1,7 @@
<html class="reftest-wait">
<title>Test for CSS transitions and re-wrapping of inlines</title>
<style type="text/css">
#test { -moz-transition: 5s color linear 200s; }
#test { transition: 5s color linear 200s; }
</style>
<script type="text/javascript">

View File

@ -1,7 +1,7 @@
<html class="reftest-wait">
<title>Test for CSS transitions and re-wrapping of inlines</title>
<style type="text/css">
#test { -moz-transition: 20ms color linear 0; }
#test { transition: 20ms color linear 0; }
</style>
<script type="text/javascript">

View File

@ -11,6 +11,8 @@
# http://www.w3.org/TR/SVGMobile12/coords.html#IntrinsicSizing
# http://www.w3.org/TR/CSS21/visudet.html
!= scrollbars-01.svg scrollbars-01-anti-ref.svg
!= scrollbars-02.svg scrollbars-01-anti-ref.svg
# Standalone tests
#

View File

@ -0,0 +1,11 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=771935 -->
<rect width="100%" height="100%" fill="blue"/>
</svg>

After

Width:  |  Height:  |  Size: 311 B

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="101%">
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=771935 -->
<title>Test that we're given scrollbars if wider than the browser's content area</title>
<rect width="100%" height="100%" fill="blue"/>
</svg>

After

Width:  |  Height:  |  Size: 418 B

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="101%">
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=771935 -->
<title>Test that we're given scrollbars if wider than the browser's content area</title>
<rect width="100%" height="100%" fill="blue"/>
</svg>

After

Width:  |  Height:  |  Size: 419 B

View File

@ -5,8 +5,8 @@ function boom()
{
var r = document.documentElement;
r.style.display = "table-cell";
r.style.MozTransitionProperty = "x";
window.getComputedStyle(r).MozTransitionProperty;
r.style.transitionProperty = "x";
window.getComputedStyle(r).transitionProperty;
}
</script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
<body style="-moz-transition-duration: 1ms"></body>
<body style="transition-duration: 1ms"></body>
<script>
var body = document.body;
/* flush */ getComputedStyle(body, "").background;

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
<body style="background-size: cover; -moz-transition-duration: 1ms"></body>
<body style="background-size: cover; transition-duration: 1ms"></body>
<script>
var body = document.body;
/* flush */ getComputedStyle(body, "").backgroundSize;

View File

@ -81,4 +81,5 @@ CSS_ANON_BOX(moztreeprogressmeter, ":-moz-tree-progressmeter")
CSS_ANON_BOX(moztreedropfeedback, ":-moz-tree-drop-feedback")
#endif
CSS_ANON_BOX(mozSVGOuterSVGAnonChild, ":-moz-svg-outer-svg-anon-child")
CSS_ANON_BOX(mozSVGForeignContent, ":-moz-svg-foreign-content")

View File

@ -1498,7 +1498,8 @@ CSSParserImpl::ParseAtRule(RuleAppendFunc aAppendFunc,
parseFunc = &CSSParserImpl::ParsePageRule;
newSection = eCSSSection_General;
} else if (mToken.mIdent.LowerCaseEqualsLiteral("-moz-keyframes")) {
} else if (mToken.mIdent.LowerCaseEqualsLiteral("-moz-keyframes") ||
mToken.mIdent.LowerCaseEqualsLiteral("keyframes")) {
parseFunc = &CSSParserImpl::ParseKeyframesRule;
newSection = eCSSSection_General;

View File

@ -42,3 +42,17 @@ CSS_PROP_ALIAS(-moz-perspective, perspective, MozPerspective, "")
CSS_PROP_ALIAS(-moz-transform-style, transform_style, MozTransformStyle, "")
CSS_PROP_ALIAS(-moz-backface-visibility, backface_visibility, MozBackfaceVisibility, "")
CSS_PROP_ALIAS(-moz-border-image, border_image, MozBorderImage, "")
CSS_PROP_ALIAS(-moz-transition, transition, MozTransition, "")
CSS_PROP_ALIAS(-moz-transition-delay, transition_delay, MozTransitionDelay, "")
CSS_PROP_ALIAS(-moz-transition-duration, transition_duration, MozTransitionDuration, "")
CSS_PROP_ALIAS(-moz-transition-property, transition_property, MozTransitionProperty, "")
CSS_PROP_ALIAS(-moz-transition-timing-function, transition_timing_function, MozTransitionTimingFunction, "")
CSS_PROP_ALIAS(-moz-animation, animation, MozAnimation, "")
CSS_PROP_ALIAS(-moz-animation-delay, animation_delay, MozAnimationDelay, "")
CSS_PROP_ALIAS(-moz-animation-direction, animation_direction, MozAnimationDirection, "")
CSS_PROP_ALIAS(-moz-animation-duration, animation_duration, MozAnimationDuration, "")
CSS_PROP_ALIAS(-moz-animation-fill-mode, animation_fill_mode, MozAnimationFillMode, "")
CSS_PROP_ALIAS(-moz-animation-iteration-count, animation_iteration_count, MozAnimationIterationCount, "")
CSS_PROP_ALIAS(-moz-animation-name, animation_name, MozAnimationName, "")
CSS_PROP_ALIAS(-moz-animation-play-state, animation_play_state, MozAnimationPlayState, "")
CSS_PROP_ALIAS(-moz-animation-timing-function, animation_timing_function, MozAnimationTimingFunction, "")

View File

@ -348,15 +348,15 @@ CSS_PROP_FONT(
eStyleAnimType_None)
#endif
CSS_PROP_SHORTHAND(
-moz-animation,
animation,
CSS_PROP_DOMPROP_PREFIXED(Animation),
animation,
Animation,
CSS_PROPERTY_PARSE_FUNCTION,
"")
CSS_PROP_DISPLAY(
-moz-animation-delay,
animation-delay,
animation_delay,
CSS_PROP_DOMPROP_PREFIXED(AnimationDelay),
AnimationDelay,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -365,9 +365,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-direction,
animation-direction,
animation_direction,
CSS_PROP_DOMPROP_PREFIXED(AnimationDirection),
AnimationDirection,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -376,9 +376,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-duration,
animation-duration,
animation_duration,
CSS_PROP_DOMPROP_PREFIXED(AnimationDuration),
AnimationDuration,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -387,9 +387,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-fill-mode,
animation-fill-mode,
animation_fill_mode,
CSS_PROP_DOMPROP_PREFIXED(AnimationFillMode),
AnimationFillMode,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -398,9 +398,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-iteration-count,
animation-iteration-count,
animation_iteration_count,
CSS_PROP_DOMPROP_PREFIXED(AnimationIterationCount),
AnimationIterationCount,
CSS_PROPERTY_PARSE_VALUE_LIST |
// nonnegative per
// http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
@ -412,9 +412,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-name,
animation-name,
animation_name,
CSS_PROP_DOMPROP_PREFIXED(AnimationName),
AnimationName,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -425,9 +425,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-play-state,
animation-play-state,
animation_play_state,
CSS_PROP_DOMPROP_PREFIXED(AnimationPlayState),
AnimationPlayState,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -436,9 +436,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-animation-timing-function,
animation-timing-function,
animation_timing_function,
CSS_PROP_DOMPROP_PREFIXED(AnimationTimingFunction),
AnimationTimingFunction,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -2666,15 +2666,15 @@ CSS_PROP_POSITION(
offsetof(nsStylePosition, mOffset),
eStyleAnimType_Sides_Top)
CSS_PROP_SHORTHAND(
-moz-transition,
transition,
CSS_PROP_DOMPROP_PREFIXED(Transition),
transition,
Transition,
CSS_PROPERTY_PARSE_FUNCTION,
"")
CSS_PROP_DISPLAY(
-moz-transition-delay,
transition-delay,
transition_delay,
CSS_PROP_DOMPROP_PREFIXED(TransitionDelay),
TransitionDelay,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -2683,9 +2683,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-transition-duration,
transition-duration,
transition_duration,
CSS_PROP_DOMPROP_PREFIXED(TransitionDuration),
TransitionDuration,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -2694,9 +2694,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-transition-property,
transition-property,
transition_property,
CSS_PROP_DOMPROP_PREFIXED(TransitionProperty),
TransitionProperty,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
@ -2705,9 +2705,9 @@ CSS_PROP_DISPLAY(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_DISPLAY(
-moz-transition-timing-function,
transition-timing-function,
transition_timing_function,
CSS_PROP_DOMPROP_PREFIXED(TransitionTimingFunction),
TransitionTimingFunction,
CSS_PROPERTY_PARSE_VALUE_LIST |
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",

View File

@ -2017,7 +2017,7 @@ nsCSSKeyframesRule::GetType(PRUint16* aType)
NS_IMETHODIMP
nsCSSKeyframesRule::GetCssText(nsAString& aCssText)
{
aCssText.AssignLiteral("@-moz-keyframes ");
aCssText.AssignLiteral("@keyframes ");
aCssText.Append(mName);
aCssText.AppendLiteral(" {\n");
nsAutoString tmp;

View File

@ -4618,6 +4618,15 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
* Implementations of CSS styles *
\* ***************************** */
//// COMPUTED_STYLE_MAP_ENTRY(animation, Animation),
COMPUTED_STYLE_MAP_ENTRY(animation_delay, AnimationDelay),
COMPUTED_STYLE_MAP_ENTRY(animation_direction, AnimationDirection),
COMPUTED_STYLE_MAP_ENTRY(animation_duration, AnimationDuration),
COMPUTED_STYLE_MAP_ENTRY(animation_fill_mode, AnimationFillMode),
COMPUTED_STYLE_MAP_ENTRY(animation_iteration_count, AnimationIterationCount),
COMPUTED_STYLE_MAP_ENTRY(animation_name, AnimationName),
COMPUTED_STYLE_MAP_ENTRY(animation_play_state, AnimationPlayState),
COMPUTED_STYLE_MAP_ENTRY(animation_timing_function, AnimationTimingFunction),
COMPUTED_STYLE_MAP_ENTRY(backface_visibility, BackfaceVisibility),
//// COMPUTED_STYLE_MAP_ENTRY(background, Background),
COMPUTED_STYLE_MAP_ENTRY(background_attachment, BackgroundAttachment),
@ -4740,6 +4749,11 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
COMPUTED_STYLE_MAP_ENTRY_LAYOUT(transform, Transform),
COMPUTED_STYLE_MAP_ENTRY_LAYOUT(transform_origin, TransformOrigin),
COMPUTED_STYLE_MAP_ENTRY(transform_style, TransformStyle),
//// COMPUTED_STYLE_MAP_ENTRY(transition, Transition),
COMPUTED_STYLE_MAP_ENTRY(transition_delay, TransitionDelay),
COMPUTED_STYLE_MAP_ENTRY(transition_duration, TransitionDuration),
COMPUTED_STYLE_MAP_ENTRY(transition_property, TransitionProperty),
COMPUTED_STYLE_MAP_ENTRY(transition_timing_function, TransitionTimingFunction),
COMPUTED_STYLE_MAP_ENTRY(unicode_bidi, UnicodeBidi),
COMPUTED_STYLE_MAP_ENTRY_LAYOUT(vertical_align, VerticalAlign),
COMPUTED_STYLE_MAP_ENTRY(visibility, Visibility),
@ -4759,14 +4773,6 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
COMPUTED_STYLE_MAP_ENTRY(align_items, AlignItems),
COMPUTED_STYLE_MAP_ENTRY(align_self, AlignSelf),
#endif // MOZ_FLEXBOX
COMPUTED_STYLE_MAP_ENTRY(animation_delay, AnimationDelay),
COMPUTED_STYLE_MAP_ENTRY(animation_direction, AnimationDirection),
COMPUTED_STYLE_MAP_ENTRY(animation_duration, AnimationDuration),
COMPUTED_STYLE_MAP_ENTRY(animation_fill_mode, AnimationFillMode),
COMPUTED_STYLE_MAP_ENTRY(animation_iteration_count, AnimationIterationCount),
COMPUTED_STYLE_MAP_ENTRY(animation_name, AnimationName),
COMPUTED_STYLE_MAP_ENTRY(animation_play_state, AnimationPlayState),
COMPUTED_STYLE_MAP_ENTRY(animation_timing_function, AnimationTimingFunction),
COMPUTED_STYLE_MAP_ENTRY(appearance, Appearance),
COMPUTED_STYLE_MAP_ENTRY(_moz_background_inline_policy, BackgroundInlinePolicy),
COMPUTED_STYLE_MAP_ENTRY(binding, Binding),
@ -4817,10 +4823,6 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
COMPUTED_STYLE_MAP_ENTRY(text_decoration_line, TextDecorationLine),
COMPUTED_STYLE_MAP_ENTRY(text_decoration_style, TextDecorationStyle),
COMPUTED_STYLE_MAP_ENTRY(text_size_adjust, TextSizeAdjust),
COMPUTED_STYLE_MAP_ENTRY(transition_delay, TransitionDelay),
COMPUTED_STYLE_MAP_ENTRY(transition_duration, TransitionDuration),
COMPUTED_STYLE_MAP_ENTRY(transition_property, TransitionProperty),
COMPUTED_STYLE_MAP_ENTRY(transition_timing_function, TransitionTimingFunction),
COMPUTED_STYLE_MAP_ENTRY(user_focus, UserFocus),
COMPUTED_STYLE_MAP_ENTRY(user_input, UserInput),
COMPUTED_STYLE_MAP_ENTRY(user_modify, UserModify),

View File

@ -43,49 +43,49 @@ function initial_font_family_is_sans_serif()
var gInitialFontFamilyIsSansSerif = initial_font_family_is_sans_serif();
var gCSSProperties = {
"-moz-animation": {
domProp: "MozAnimation",
"animation": {
domProp: "animation",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "-moz-animation-name", "-moz-animation-duration", "-moz-animation-timing-function", "-moz-animation-delay", "-moz-animation-direction", "-moz-animation-fill-mode", "-moz-animation-iteration-count" ],
subproperties: [ "animation-name", "animation-duration", "animation-timing-function", "animation-delay", "animation-direction", "animation-fill-mode", "animation-iteration-count" ],
initial_values: [ "none none 0s 0s ease normal 1.0", "none", "0s", "ease", "normal", "1.0" ],
other_values: [ "bounce 1s linear 2s", "bounce 1s 2s linear", "bounce linear 1s 2s", "linear bounce 1s 2s", "linear 1s bounce 2s", "linear 1s 2s bounce", "1s bounce linear 2s", "1s bounce 2s linear", "1s 2s bounce linear", "1s linear bounce 2s", "1s linear 2s bounce", "1s 2s linear bounce", "bounce linear 1s", "bounce 1s linear", "linear bounce 1s", "linear 1s bounce", "1s bounce linear", "1s linear bounce", "1s 2s bounce", "1s bounce 2s", "bounce 1s 2s", "1s 2s linear", "1s linear 2s", "linear 1s 2s", "bounce 1s", "1s bounce", "linear 1s", "1s linear", "1s 2s", "2s 1s", "bounce", "linear", "1s", "height", "2s", "ease-in-out", "2s ease-in", "opacity linear", "ease-out 2s", "2s color, 1s bounce, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", "1s \\32bounce linear 2s", "1s -bounce linear 2s", "1s -\\32bounce linear 2s", "1s \\32 0bounce linear 2s", "1s -\\32 0bounce linear 2s", "1s \\2bounce linear 2s", "1s -\\2bounce linear 2s", "2s, 1s bounce", "1s bounce, 2s", "2s all, 1s bounce", "1s bounce, 2s all", "1s bounce, 2s none", "2s none, 1s bounce", "2s bounce, 1s all", "2s all, 1s bounce" ],
invalid_values: [ "2s inherit", "inherit 2s", "2s bounce, 1s inherit", "2s inherit, 1s bounce", "2s initial" ]
},
"-moz-animation-delay": {
domProp: "MozAnimationDelay",
"animation-delay": {
domProp: "animationDelay",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "0s", "0ms" ],
other_values: [ "1s", "250ms", "-100ms", "-1s", "1s, 250ms, 2.3s"],
invalid_values: [ "0", "0px" ]
},
"-moz-animation-direction": {
domProp: "MozAnimationDirection",
"animation-direction": {
domProp: "animationDirection",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "normal" ],
other_values: [ "alternate", "normal, alternate", "alternate, normal", "normal, normal", "normal, normal, normal", "reverse", "alternate-reverse", "normal, reverse, alternate-reverse, alternate" ],
invalid_values: [ "normal normal", "inherit, normal", "reverse-alternate" ]
},
"-moz-animation-duration": {
domProp: "MozAnimationDuration",
"animation-duration": {
domProp: "animationDuration",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "0s", "0ms" ],
other_values: [ "1s", "250ms", "-1ms", "-2s", "1s, 250ms, 2.3s"],
invalid_values: [ "0", "0px" ]
},
"-moz-animation-fill-mode": {
domProp: "MozAnimationFillMode",
"animation-fill-mode": {
domProp: "animationFillMode",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "forwards", "backwards", "both", "none, none", "forwards, backwards", "forwards, none", "none, both" ],
invalid_values: [ "all"]
},
"-moz-animation-iteration-count": {
domProp: "MozAnimationIterationCount",
"animation-iteration-count": {
domProp: "animationIterationCount",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1" ],
@ -94,24 +94,24 @@ var gCSSProperties = {
// http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
invalid_values: [ "none", "-1", "-0.5", "-1, infinite", "infinite, -3" ]
},
"-moz-animation-name": {
domProp: "MozAnimationName",
"animation-name": {
domProp: "animationName",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "all", "ball", "mall", "color", "bounce, bubble, opacity", "foobar", "auto", "\\32bounce", "-bounce", "-\\32bounce", "\\32 0bounce", "-\\32 0bounce", "\\2bounce", "-\\2bounce" ],
invalid_values: [ "bounce, initial", "initial, bounce", "bounce, inherit", "inherit, bounce" ]
},
"-moz-animation-play-state": {
domProp: "MozAnimationPlayState",
"animation-play-state": {
domProp: "animationPlayState",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "running" ],
other_values: [ "paused", "running, running", "paused, running", "paused, paused", "running, paused", "paused, running, running, running, paused, running" ],
invalid_values: [ "0" ]
},
"-moz-animation-timing-function": {
domProp: "MozAnimationTimingFunction",
"animation-timing-function": {
domProp: "animationTimingFunction",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "ease", "cubic-bezier(0.25, 0.1, 0.25, 1.0)" ],
@ -3143,41 +3143,41 @@ var gCSSProperties = {
],
invalid_values: []
},
"-moz-transition": {
domProp: "MozTransition",
"transition": {
domProp: "transition",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "-moz-transition-property", "-moz-transition-duration", "-moz-transition-timing-function", "-moz-transition-delay" ],
subproperties: [ "transition-property", "transition-duration", "transition-timing-function", "transition-delay" ],
initial_values: [ "all 0s ease 0s", "all", "0s", "0s 0s", "ease" ],
other_values: [ "width 1s linear 2s", "width 1s 2s linear", "width linear 1s 2s", "linear width 1s 2s", "linear 1s width 2s", "linear 1s 2s width", "1s width linear 2s", "1s width 2s linear", "1s 2s width linear", "1s linear width 2s", "1s linear 2s width", "1s 2s linear width", "width linear 1s", "width 1s linear", "linear width 1s", "linear 1s width", "1s width linear", "1s linear width", "1s 2s width", "1s width 2s", "width 1s 2s", "1s 2s linear", "1s linear 2s", "linear 1s 2s", "width 1s", "1s width", "linear 1s", "1s linear", "1s 2s", "2s 1s", "width", "linear", "1s", "height", "2s", "ease-in-out", "2s ease-in", "opacity linear", "ease-out 2s", "2s color, 1s width, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", "1s \\32width linear 2s", "1s -width linear 2s", "1s -\\32width linear 2s", "1s \\32 0width linear 2s", "1s -\\32 0width linear 2s", "1s \\2width linear 2s", "1s -\\2width linear 2s" ],
invalid_values: [ "2s, 1s width", "1s width, 2s", "2s all, 1s width", "1s width, 2s all", "1s width, 2s none", "2s none, 1s width", "2s inherit", "inherit 2s", "2s width, 1s inherit", "2s inherit, 1s width", "2s initial", "2s all, 1s width", "2s width, 1s all" ]
},
"-moz-transition-delay": {
domProp: "MozTransitionDelay",
"transition-delay": {
domProp: "transitionDelay",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "0s", "0ms" ],
other_values: [ "1s", "250ms", "-100ms", "-1s", "1s, 250ms, 2.3s"],
invalid_values: [ "0", "0px" ]
},
"-moz-transition-duration": {
domProp: "MozTransitionDuration",
"transition-duration": {
domProp: "transitionDuration",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "0s", "0ms" ],
other_values: [ "1s", "250ms", "-1ms", "-2s", "1s, 250ms, 2.3s"],
invalid_values: [ "0", "0px" ]
},
"-moz-transition-property": {
domProp: "MozTransitionProperty",
"transition-property": {
domProp: "transitionProperty",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "all" ],
other_values: [ "none", "left", "top", "color", "width, height, opacity", "foobar", "auto", "\\32width", "-width", "-\\32width", "\\32 0width", "-\\32 0width", "\\2width", "-\\2width" ],
invalid_values: [ "none, none", "all, all", "color, none", "none, color", "all, color", "color, all", "inherit, color", "color, inherit", "initial, color", "color, initial", "none, color", "color, none", "all, color", "color, all" ]
},
"-moz-transition-timing-function": {
domProp: "MozTransitionTimingFunction",
"transition-timing-function": {
domProp: "transitionTimingFunction",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "ease", "cubic-bezier(0.25, 0.1, 0.25, 1.0)" ],

View File

@ -9,39 +9,39 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=435442
<script type="application/javascript" src="animation_utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style type="text/css">
@-moz-keyframes anim1 {
@keyframes anim1 {
0% { margin-left: 0px }
50% { margin-left: 80px }
100% { margin-left: 100px }
}
@-moz-keyframes anim2 {
@keyframes anim2 {
from { margin-right: 0 } to { margin-right: 100px }
}
@-moz-keyframes anim3 {
@keyframes anim3 {
from { margin-top: 0 } to { margin-top: 100px }
}
@-moz-keyframes anim4 {
@keyframes anim4 {
from { margin-bottom: 0 } to { margin-bottom: 100px }
}
@-moz-keyframes anim5 {
@keyframes anim5 {
from { margin-left: 0 } to { margin-left: 100px }
}
@-moz-keyframes kf1 {
@keyframes kf1 {
50% { margin-top: 50px }
to { margin-top: 150px }
}
@-moz-keyframes kf2 {
@keyframes kf2 {
from { margin-top: 150px }
50% { margin-top: 50px }
}
@-moz-keyframes kf3 {
@keyframes kf3 {
25% { margin-top: 100px }
}
@-moz-keyframes kf4 {
@keyframes kf4 {
to, from { display: inline; margin-top: 37px }
}
@-moz-keyframes kf_cascade1 {
@keyframes kf_cascade1 {
from { padding-top: 50px }
50%, from { padding-top: 30px } /* wins: 0% */
75%, 85%, 50% { padding-top: 20px } /* wins: 75%, 50% */
@ -49,54 +49,54 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=435442
85.1% { padding-top: 60px } /* wins: 85.1% */
85% { padding-top: 30px } /* wins: 85% */
}
@-moz-keyframes kf_cascade2 { from, to { margin-top: 100px } }
@-moz-keyframes kf_cascade2 { from, to { margin-left: 200px } }
@-moz-keyframes kf_cascade2 { from, to { margin-left: 300px } }
@-moz-keyframes kf_tf1 {
0% { padding-bottom: 20px; -moz-animation-timing-function: ease }
@keyframes kf_cascade2 { from, to { margin-top: 100px } }
@keyframes kf_cascade2 { from, to { margin-left: 200px } }
@keyframes kf_cascade2 { from, to { margin-left: 300px } }
@keyframes kf_tf1 {
0% { padding-bottom: 20px; animation-timing-function: ease }
25% { padding-bottom: 60px; }
50% { padding-bottom: 160px; -moz-animation-timing-function: steps(5) }
75% { padding-bottom: 120px; -moz-animation-timing-function: linear }
100% { padding-bottom: 20px; -moz-animation-timing-function: ease-out }
50% { padding-bottom: 160px; animation-timing-function: steps(5) }
75% { padding-bottom: 120px; animation-timing-function: linear }
100% { padding-bottom: 20px; animation-timing-function: ease-out }
}
#withbefore::before, #withafter::after {
content: "";
-moz-animation: anim2 1s linear alternate infinite;
animation: anim2 1s linear alternate infinite;
}
@-moz-keyframes multiprop {
@keyframes multiprop {
0% {
padding-top: 10px; padding-left: 30px;
-moz-animation-timing-function: ease;
animation-timing-function: ease;
}
25% {
padding-left: 50px;
-moz-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
50% {
padding-top: 40px;
}
75% {
padding-top: 80px; padding-left: 60px;
-moz-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
}
@-moz-keyframes uaoverride {
@keyframes uaoverride {
0%, 100% { line-height: 3; margin-top: 20px }
50% { margin-top: 120px }
}
@-moz-keyframes cascade {
@keyframes cascade {
0%, 25%, 100% { top: 0 }
50%, 75% { top: 100px }
0%, 75%, 100% { left: 0 }
25%, 50% { left: 100px }
}
@-moz-keyframes cascade2 {
@keyframes cascade2 {
0% { text-indent: 0 }
25% { text-indent: 30px; -moz-animation-timing-function: ease-in } /* beaten by rule below */
25% { text-indent: 30px; animation-timing-function: ease-in } /* beaten by rule below */
50% { text-indent: 0 }
25% { text-indent: 50px }
100% { text-indent: 100px }
@ -194,7 +194,7 @@ advance_clock(0);
// animation-fill-mode.
function test_fill_mode(fill_mode, fills_backwards, fills_forwards)
{
var style = "margin-left: 30px; -moz-animation: 10s 3s anim1 linear";
var style = "margin-left: 30px; animation: 10s 3s anim1 linear";
var desc;
if (fill_mode.length > 0) {
style += " " + fill_mode;
@ -254,7 +254,7 @@ test_fill_mode("both", true, true);
// Test that animations continue running when the animation name
// list is changed.
new_div("-moz-animation: anim1 linear 10s");
new_div("animation: anim1 linear 10s");
is(cs.getPropertyValue("margin-top"), "0px",
"just anim1, margin-top at start");
is(cs.getPropertyValue("margin-right"), "0px",
@ -273,7 +273,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "16px",
"just anim1, margin-left at 1s");
// append anim2
div.style.MozAnimation = "anim1 linear 10s, anim2 linear 10s";
div.style.animation = "anim1 linear 10s, anim2 linear 10s";
is(cs.getPropertyValue("margin-top"), "0px",
"anim1 + anim2, margin-top at 1s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -292,7 +292,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "32px",
"anim1 + anim2, margin-left at 2s");
// prepend anim3
div.style.MozAnimation = "anim3 linear 10s, anim1 linear 10s, anim2 linear 10s";
div.style.animation = "anim3 linear 10s, anim1 linear 10s, anim2 linear 10s";
is(cs.getPropertyValue("margin-top"), "0px",
"anim3 + anim1 + anim2, margin-top at 2s");
is(cs.getPropertyValue("margin-right"), "10px",
@ -311,7 +311,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "48px",
"anim3 + anim1 + anim2, margin-left at 3s");
// remove anim2 from end
div.style.MozAnimation = "anim3 linear 10s, anim1 linear 10s";
div.style.animation = "anim3 linear 10s, anim1 linear 10s";
is(cs.getPropertyValue("margin-top"), "10px",
"anim3 + anim1, margin-top at 3s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -330,7 +330,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "64px",
"anim3 + anim1, margin-left at 4s");
// swap anim1 and anim3, change duration of anim3
div.style.MozAnimation = "anim1 linear 10s, anim3 linear 5s";
div.style.animation = "anim1 linear 10s, anim3 linear 5s";
is(cs.getPropertyValue("margin-top"), "40px",
"anim1 + anim3, margin-top at 4s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -349,7 +349,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "80px",
"anim1 + anim3, margin-left at 5s");
// list anim1 twice, last duration wins, original start time still applies
div.style.MozAnimation = "anim1 linear 10s, anim3 linear 5s, anim1 linear 20s";
div.style.animation = "anim1 linear 10s, anim3 linear 5s, anim1 linear 20s";
is(cs.getPropertyValue("margin-top"), "60px",
"anim1 + anim3 + anim1, margin-top at 5s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -360,7 +360,7 @@ div.style.MozAnimation = "anim1 linear 10s, anim3 linear 5s, anim1 linear 20s";
"anim1 + anim3 + anim1, margin-left at 5s");
// drop one of the anim1, and list anim5 as well, which animates
// the same property as anim1
div.style.MozAnimation = "anim3 linear 5s, anim1 linear 20s, anim5 linear 10s";
div.style.animation = "anim3 linear 5s, anim1 linear 20s, anim5 linear 10s";
is(cs.getPropertyValue("margin-top"), "60px",
"anim3 + anim1 + anim5, margin-top at 5s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -379,7 +379,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "10px",
"anim3 + anim1 + anim5, margin-left at 6s");
// now swap the anim5 and anim1 order
div.style.MozAnimation = "anim3 linear 5s, anim5 linear 10s, anim1 linear 20s";
div.style.animation = "anim3 linear 5s, anim5 linear 10s, anim1 linear 20s";
is(cs.getPropertyValue("margin-top"), "80px",
"anim3 + anim1 + anim5, margin-top at 6s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -398,7 +398,7 @@ advance_clock(1000);
is(cs.getPropertyValue("margin-left"), "56px",
"anim3 + anim1 + anim5, margin-left at 7s");
// swap anim1 and anim5 back
div.style.MozAnimation = "anim3 linear 5s, anim1 linear 20s, anim5 linear 10s";
div.style.animation = "anim3 linear 5s, anim1 linear 20s, anim5 linear 10s";
is(cs.getPropertyValue("margin-top"), "0px",
"anim3 + anim1 + anim5, margin-top at 7s");
is(cs.getPropertyValue("margin-right"), "0px",
@ -411,7 +411,7 @@ advance_clock(100);
is(cs.getPropertyValue("margin-top"), "0px",
"anim3 + anim1 + anim5, margin-top at 7.1s");
// Change the animation fill mode on the completed animation.
div.style.MozAnimation = "anim3 linear 5s forwards, anim1 linear 20s, anim5 linear 10s";
div.style.animation = "anim3 linear 5s forwards, anim1 linear 20s, anim5 linear 10s";
is(cs.getPropertyValue("margin-top"), "100px",
"anim3 + anim1 + anim5, margin-top at 7.1s, with fill mode");
advance_clock(900);
@ -419,7 +419,7 @@ advance_clock(900);
"anim3 + anim1 + anim5, margin-top at 8s, with fill mode");
// Change the animation duration on the completed animation, so it is
// no longer completed.
div.style.MozAnimation = "anim3 linear 10s, anim1 linear 20s, anim5 linear 10s";
div.style.animation = "anim3 linear 10s, anim1 linear 20s, anim5 linear 10s";
is(cs.getPropertyValue("margin-top"), "60px",
"anim3 + anim1 + anim5, margin-top at 8s, with fill mode");
is(cs.getPropertyValue("margin-left"), "30px",
@ -438,7 +438,7 @@ done_div();
// run backwards)
// 100px at 0%, 50px at 50%, 150px at 100%
new_div("margin-top: 100px; -moz-animation: kf1 ease 1s alternate infinite");
new_div("margin-top: 100px; animation: kf1 ease 1s alternate infinite");
is(cs.marginTop, "100px", "no-0% at 0.0s");
advance_clock(100);
is_approx(px_to_num(cs.marginTop), 100 - 50 * gTF.ease(0.2), 0.01,
@ -473,7 +473,7 @@ is(cs.marginTop, "100px", "no-0% at 2.0s");
done_div();
// 150px at 0%, 50px at 50%, 100px at 100%
new_div("margin-top: 100px; -moz-animation: kf2 ease-in 1s alternate infinite");
new_div("margin-top: 100px; animation: kf2 ease-in 1s alternate infinite");
is(cs.marginTop, "150px", "no-100% at 0.0s");
advance_clock(100);
is_approx(px_to_num(cs.marginTop), 150 - 100 * gTF.ease_in(0.2), 0.01,
@ -509,7 +509,7 @@ done_div();
// 50px at 0%, 100px at 25%, 50px at 100%
new_div("margin-top: 50px; -moz-animation: kf3 ease-out 1s alternate infinite");
new_div("margin-top: 50px; animation: kf3 ease-out 1s alternate infinite");
is(cs.marginTop, "50px", "no-0%-no-100% at 0.0s");
advance_clock(50);
is_approx(px_to_num(cs.marginTop), 50 + 50 * gTF.ease_out(0.2), 0.01,
@ -547,7 +547,7 @@ done_div();
// Simultaneously, test that the block is still honored, and that
// we still override the value when two consecutive keyframes have
// the same value.
new_div("-moz-animation: kf4 ease 10s");
new_div("animation: kf4 ease 10s");
is(cs.display, "block",
"non-animatable properties should be ignored (linear, 0s)");
is(cs.marginTop, "37px",
@ -558,7 +558,7 @@ is(cs.display, "block",
is(cs.marginTop, "37px",
"animatable properties should still apply (linear, 1s)");
done_div();
new_div("-moz-animation: kf4 step-start 10s");
new_div("animation: kf4 step-start 10s");
is(cs.display, "block",
"non-animatable properties should be ignored (step-start, 0s)");
is(cs.marginTop, "37px",
@ -571,7 +571,7 @@ is(cs.marginTop, "37px",
done_div();
// Test cascading of the keyframes within an @keyframes rule.
new_div("-moz-animation: kf_cascade1 linear 10s");
new_div("animation: kf_cascade1 linear 10s");
// 0%: 30px
// 50%: 20px
// 75%: 20px
@ -598,7 +598,7 @@ is(cs.paddingTop, "65px", "kf_cascade1 at 9.2505s");
done_div();
// Test cascading of the @keyframes rules themselves.
new_div("-moz-animation: kf_cascade2 linear 10s");
new_div("animation: kf_cascade2 linear 10s");
is(cs.marginTop, "0px", "@keyframes rule with margin-top should be ignored");
is(cs.marginLeft, "300px", "last @keyframes rule with margin-left should win");
done_div();
@ -607,7 +607,7 @@ done_div();
* css3-animations: 3.1. Timing functions for keyframes
* http://dev.w3.org/csswg/css3-animations/#timing-functions-for-keyframes-
*/
new_div("-moz-animation: kf_tf1 ease-in 10s alternate infinite");
new_div("animation: kf_tf1 ease-in 10s alternate infinite");
is(cs.paddingBottom, "20px",
"keyframe timing functions test at 0s (test needed for flush)");
advance_clock(1000);
@ -676,7 +676,7 @@ is(cs.paddingBottom, "20px",
done_div();
// spot-check the same thing without alternate
new_div("-moz-animation: kf_tf1 ease-in 10s infinite");
new_div("animation: kf_tf1 ease-in 10s infinite");
is(cs.paddingBottom, "20px",
"keyframe timing functions test at 0s (test needed for flush)");
advance_clock(11000);
@ -706,21 +706,21 @@ done_div();
// it again starts a new one.
new_div("");
div.style.MozAnimation = "anim2 ease-in-out 10s";
div.style.animation = "anim2 ease-in-out 10s";
is(cs.marginRight, "0px", "after setting animation-name to anim2");
advance_clock(1000);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in_out(0.1), 0.01,
"before changing animation-name to none");
div.style.MozAnimationName = "none";
div.style.animationName = "none";
is(cs.marginRight, "0px", "after changing animation-name to none");
advance_clock(1000);
is(cs.marginRight, "0px", "after changing animation-name to none plus 1s");
div.style.MozAnimationName = "anim2";
div.style.animationName = "anim2";
is(cs.marginRight, "0px", "after changing animation-name to anim2");
advance_clock(1000);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in_out(0.1), 0.01,
"at 1s in animation when animation-name no longer none again");
div.style.MozAnimationName = "none";
div.style.animationName = "none";
is(cs.marginRight, "0px", "after changing animation-name to none");
advance_clock(1000);
is(cs.marginRight, "0px", "after changing animation-name to none plus 1s");
@ -746,7 +746,7 @@ done_div();
* css3-animations: 3.5. The 'animation-iteration-count' Property
* http://dev.w3.org/csswg/css3-animations/#the-animation-iteration-count-property-
*/
new_div("-moz-animation: anim2 ease-in 10s 0.3 forwards");
new_div("animation: anim2 ease-in 10s 0.3 forwards");
is(cs.marginRight, "0px", "animation-iteration-count test 1 at 0s");
advance_clock(2000);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
@ -765,7 +765,7 @@ is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.3), 0.01,
"animation-iteration-count test 1 at 8.1s");
done_div();
new_div("-moz-animation: anim2 ease-in 10s 0.3, anim3 ease-out 20s 1.2 alternate forwards, anim4 ease-in-out 5s 1.6 forwards");
new_div("animation: anim2 ease-in 10s 0.3, anim3 ease-out 20s 1.2 alternate forwards, anim4 ease-in-out 5s 1.6 forwards");
is(cs.marginRight, "0px", "animation-iteration-count test 2 at 0s");
is(cs.marginTop, "0px", "animation-iteration-count test 3 at 0s");
is(cs.marginBottom, "0px", "animation-iteration-count test 4 at 0s");
@ -826,78 +826,78 @@ done_div();
// Tested in tests for sections 3.1 and 3.5.
new_div("-moz-animation: anim2 ease-in 10s infinite");
div.style.MozAnimationDirection = "normal";
new_div("animation: anim2 ease-in 10s infinite");
div.style.animationDirection = "normal";
is(cs.marginRight, "0px", "animation-direction test 1 (normal) at 0s");
div.style.MozAnimationDirection = "reverse";
div.style.animationDirection = "reverse";
is(cs.marginRight, "100px", "animation-direction test 1 (reverse) at 0s");
div.style.MozAnimationDirection = "alternate";
div.style.animationDirection = "alternate";
is(cs.marginRight, "0px", "animation-direction test 1 (alternate) at 0s");
div.style.MozAnimationDirection = "alternate-reverse";
div.style.animationDirection = "alternate-reverse";
is(cs.marginRight, "100px", "animation-direction test 1 (alternate-reverse) at 0s");
advance_clock(2000);
div.style.MozAnimationDirection = "normal";
div.style.animationDirection = "normal";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (normal) at 2s");
div.style.MozAnimationDirection = "reverse";
div.style.animationDirection = "reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (reverse) at 2s");
div.style.MozAnimationDirection = "alternate";
div.style.animationDirection = "alternate";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (alternate) at 2s");
div.style.MozAnimationDirection = "alternate-reverse";
div.style.animationDirection = "alternate-reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (alternate-reverse) at 2s");
advance_clock(5000);
div.style.MozAnimationDirection = "normal";
div.style.animationDirection = "normal";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.7), 0.01,
"animation-direction test 1 (normal) at 7s");
div.style.MozAnimationDirection = "reverse";
div.style.animationDirection = "reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.3), 0.01,
"animation-direction test 1 (reverse) at 7s");
div.style.MozAnimationDirection = "alternate";
div.style.animationDirection = "alternate";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.7), 0.01,
"animation-direction test 1 (alternate) at 7s");
div.style.MozAnimationDirection = "alternate-reverse";
div.style.animationDirection = "alternate-reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.3), 0.01,
"animation-direction test 1 (alternate-reverse) at 7s");
advance_clock(5000);
div.style.MozAnimationDirection = "normal";
div.style.animationDirection = "normal";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (normal) at 12s");
div.style.MozAnimationDirection = "reverse";
div.style.animationDirection = "reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (reverse) at 12s");
div.style.MozAnimationDirection = "alternate";
div.style.animationDirection = "alternate";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (alternate) at 12s");
div.style.MozAnimationDirection = "alternate-reverse";
div.style.animationDirection = "alternate-reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (alternate-reverse) at 12s");
advance_clock(10000);
div.style.MozAnimationDirection = "normal";
div.style.animationDirection = "normal";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (normal) at 22s");
div.style.MozAnimationDirection = "reverse";
div.style.animationDirection = "reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (reverse) at 22s");
div.style.MozAnimationDirection = "alternate";
div.style.animationDirection = "alternate";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (alternate) at 22s");
div.style.MozAnimationDirection = "alternate-reverse";
div.style.animationDirection = "alternate-reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (alternate-reverse) at 22s");
advance_clock(30000);
div.style.MozAnimationDirection = "normal";
div.style.animationDirection = "normal";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (normal) at 52s");
div.style.MozAnimationDirection = "reverse";
div.style.animationDirection = "reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (reverse) at 52s");
div.style.MozAnimationDirection = "alternate";
div.style.animationDirection = "alternate";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.8), 0.01,
"animation-direction test 1 (alternate) at 52s");
div.style.MozAnimationDirection = "alternate-reverse";
div.style.animationDirection = "alternate-reverse";
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.2), 0.01,
"animation-direction test 1 (alternate-reverse) at 52s");
done_div();
@ -909,22 +909,22 @@ done_div();
// simple test with just one animation
new_div("");
div.style.MozAnimationTimingFunction = "ease";
div.style.MozAnimationName = "anim1";
div.style.MozAnimationDuration = "1s";
div.style.MozAnimationDirection = "alternate";
div.style.MozAnimationIterationCount = "2";
div.style.animationTimingFunction = "ease";
div.style.animationName = "anim1";
div.style.animationDuration = "1s";
div.style.animationDirection = "alternate";
div.style.animationIterationCount = "2";
is(cs.marginLeft, "0px", "animation-play-state test 1, at 0s");
advance_clock(250);
is_approx(px_to_num(cs.marginLeft), 80 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 at 250ms");
div.style.MozAnimationPlayState = "paused";
div.style.animationPlayState = "paused";
is_approx(px_to_num(cs.marginLeft), 80 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 at 250ms");
advance_clock(250);
is_approx(px_to_num(cs.marginLeft), 80 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 still at 500ms");
div.style.MozAnimationPlayState = "running";
div.style.animationPlayState = "running";
is_approx(px_to_num(cs.marginLeft), 80 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 still at 500ms");
advance_clock(500);
@ -935,7 +935,7 @@ is(cs.marginLeft, "100px", "animation-play-state test 1 at 1250ms");
advance_clock(250);
is_approx(px_to_num(cs.marginLeft), 80 + 20 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 at 1500ms");
div.style.MozAnimationPlayState = "paused";
div.style.animationPlayState = "paused";
is_approx(px_to_num(cs.marginLeft), 80 + 20 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 at 1500ms");
advance_clock(2000);
@ -944,7 +944,7 @@ is_approx(px_to_num(cs.marginLeft), 80 + 20 * gTF.ease(0.5), 0.01,
advance_clock(500);
is_approx(px_to_num(cs.marginLeft), 80 + 20 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 at 4000ms");
div.style.MozAnimationPlayState = "";
div.style.animationPlayState = "";
is_approx(px_to_num(cs.marginLeft), 80 + 20 * gTF.ease(0.5), 0.01,
"animation-play-state test 1 at 4000ms");
advance_clock(500);
@ -959,16 +959,16 @@ done_div();
// more complicated test with multiple animations (and different directions
// and iteration counts)
new_div("");
div.style.MozAnimationTimingFunction = "ease-out, ease-in, ease-in-out";
div.style.MozAnimationName = "anim2, anim3, anim4";
div.style.MozAnimationDuration = "1s, 2s, 1s";
div.style.MozAnimationDirection = "alternate, normal, normal";
div.style.MozAnimationIterationCount = "4, 2, infinite";
div.style.animationTimingFunction = "ease-out, ease-in, ease-in-out";
div.style.animationName = "anim2, anim3, anim4";
div.style.animationDuration = "1s, 2s, 1s";
div.style.animationDirection = "alternate, normal, normal";
div.style.animationIterationCount = "4, 2, infinite";
is(cs.marginRight, "0px", "animation-play-state test 2, at 0s");
is(cs.marginTop, "0px", "animation-play-state test 3, at 0s");
is(cs.marginBottom, "0px", "animation-play-state test 4, at 0s");
advance_clock(250);
div.style.MozAnimationPlayState = "paused, running"; // pause 1 and 3
div.style.animationPlayState = "paused, running"; // pause 1 and 3
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.25), 0.01,
"animation-play-state test 2 at 250ms");
is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.125), 0.01,
@ -982,7 +982,7 @@ is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.25), 0.01,
"animation-play-state test 3 at 500ms");
is_approx(px_to_num(cs.marginBottom), 100 * gTF.ease_in_out(0.25), 0.01,
"animation-play-state test 4 at 500ms");
div.style.MozAnimationPlayState = "paused, running, running"; // unpause 3
div.style.animationPlayState = "paused, running, running"; // unpause 3
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.25), 0.01,
"animation-play-state test 2 at 500ms");
is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.25), 0.01,
@ -996,7 +996,7 @@ is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.375), 0.01,
"animation-play-state test 3 at 750ms");
is_approx(px_to_num(cs.marginBottom), 100 * gTF.ease_in_out(0.5), 0.01,
"animation-play-state test 4 at 750ms");
div.style.MozAnimationPlayState = "running, paused"; // unpause 1, pause 2
div.style.animationPlayState = "running, paused"; // unpause 1, pause 2
advance_clock(0); // notify refresh observers
advance_clock(250);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.5), 0.01,
@ -1005,7 +1005,7 @@ is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.375), 0.01,
"animation-play-state test 3 at 1000ms");
is_approx(px_to_num(cs.marginBottom), 100 * gTF.ease_in_out(0.75), 0.01,
"animation-play-state test 4 at 1000ms");
div.style.MozAnimationPlayState = "paused"; // pause all
div.style.animationPlayState = "paused"; // pause all
advance_clock(0); // notify refresh observers
advance_clock(3000);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.5), 0.01,
@ -1014,7 +1014,7 @@ is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.375), 0.01,
"animation-play-state test 3 at 4000ms");
is_approx(px_to_num(cs.marginBottom), 100 * gTF.ease_in_out(0.75), 0.01,
"animation-play-state test 4 at 4000ms");
div.style.MozAnimationPlayState = "running, paused"; // pause 2
div.style.animationPlayState = "running, paused"; // pause 2
advance_clock(0); // notify refresh observers
advance_clock(850);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.65), 0.01,
@ -1043,7 +1043,7 @@ is_approx(px_to_num(cs.marginTop), 100 * gTF.ease_in(0.375), 0.01,
"animation-play-state test 3 at 7550ms");
is_approx(px_to_num(cs.marginBottom), 100 * gTF.ease_in_out(0.3), 0.01,
"animation-play-state test 4 at 7550ms");
div.style.MozAnimationPlayState = "running"; // unpause 2
div.style.animationPlayState = "running"; // unpause 2
advance_clock(0); // notify refresh observers
advance_clock(1000);
is(cs.marginRight, "0px", "animation-play-state test 2 at 7550ms");
@ -1082,7 +1082,7 @@ done_div();
*/
// test positive delay
new_div("-moz-animation: anim2 1s 0.5s ease-out");
new_div("animation: anim2 1s 0.5s ease-out");
is(cs.marginRight, "0px", "positive delay test at 0ms");
advance_clock(400);
is(cs.marginRight, "0px", "positive delay test at 400ms");
@ -1095,18 +1095,18 @@ done_div();
// test dynamic changes to delay (i.e., that we only check delay once,
// at the very start of the animation)
new_div("-moz-animation: anim2 1s 0.5s ease-out");
new_div("animation: anim2 1s 0.5s ease-out");
is(cs.marginRight, "0px", "dynamic delay delay test at 0ms");
advance_clock(400);
is(cs.marginRight, "0px", "dynamic delay delay test at 400ms");
div.style.MozAnimationDelay = "0.2s";
div.style.animationDelay = "0.2s";
advance_clock(0);
advance_clock(100);
is(cs.marginRight, "0px", "dynamic delay delay test at 500ms");
advance_clock(100);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.1), 0.01,
"dynamic delay delay test at 500ms");
div.style.MozAnimationDelay = "1s";
div.style.animationDelay = "1s";
advance_clock(0);
advance_clock(100);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.2), 0.01,
@ -1114,24 +1114,24 @@ is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.2), 0.01,
done_div();
// test delay and play-state interaction
new_div("-moz-animation: anim2 1s 0.5s ease-out");
new_div("animation: anim2 1s 0.5s ease-out");
is(cs.marginRight, "0px", "delay and play-state delay test at 0ms");
advance_clock(400);
is(cs.marginRight, "0px", "delay and play-state delay test at 400ms");
div.style.MozAnimationPlayState = "paused";
div.style.animationPlayState = "paused";
advance_clock(0);
advance_clock(100);
is(cs.marginRight, "0px", "delay and play-state delay test at 500ms");
advance_clock(500);
is(cs.marginRight, "0px", "delay and play-state delay test at 1000ms");
div.style.MozAnimationPlayState = "running";
div.style.animationPlayState = "running";
advance_clock(0);
advance_clock(100);
is(cs.marginRight, "0px", "delay and play-state delay test at 1100ms");
advance_clock(100);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.1), 0.01,
"delay and play-state delay test at 1200ms");
div.style.MozAnimationPlayState = "paused";
div.style.animationPlayState = "paused";
advance_clock(0);
advance_clock(100);
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_out(0.1), 0.01,
@ -1142,14 +1142,14 @@ done_div();
new_div("margin-top: 1000px");
advance_clock(300);
div.style.marginTop = "100px";
div.style.MozAnimation = "kf1 1s -0.1s ease-in";
div.style.animation = "kf1 1s -0.1s ease-in";
is_approx(px_to_num(cs.marginTop), 100 - 50 * gTF.ease_in(0.2), 0.01,
"delay and implicit starting values test");
done_div();
// test large negative delay that causes the animation to start
// in the fourth iteration
new_div("-moz-animation: anim2 1s -3.6s ease-in 5 alternate forwards");
new_div("animation: anim2 1s -3.6s ease-in 5 alternate forwards");
listen(); // rely on no flush having happened yet
is_approx(px_to_num(cs.marginRight), 100 * gTF.ease_in(0.4), 0.01,
"large negative delay test at 0ms");
@ -1232,7 +1232,7 @@ done_div();
* Test handling of properties that are present in only some of the
* keyframes.
*/
new_div("-moz-animation: multiprop 1s ease-in-out alternate infinite");
new_div("animation: multiprop 1s ease-in-out alternate infinite");
is(cs.paddingTop, "10px", "multiprop top at 0ms");
is(cs.paddingLeft, "30px", "multiprop top at 0ms");
advance_clock(100);
@ -1280,7 +1280,7 @@ done_div();
// Test for https://bugzilla.mozilla.org/show_bug.cgi?id=651456 -- make
// sure that refreshing of animations doesn't break when we get two
// refreshes with the same timestamp.
new_div("-moz-animation: anim2 1s linear");
new_div("animation: anim2 1s linear");
is(cs.marginRight, "0px", "bug 651456 at 0ms");
advance_clock(100);
is(cs.marginRight, "10px", "bug 651456 at 100ms (1)");
@ -1297,7 +1297,7 @@ done_div();
new_element("select", "");
var default_line_height = cs.lineHeight;
done_div();
new_element("select", "-moz-animation: uaoverride 2s linear infinite");
new_element("select", "animation: uaoverride 2s linear infinite");
is(cs.lineHeight, default_line_height,
"animations should not override UA !important at 0ms");
is(cs.marginTop, "20px",
@ -1313,7 +1313,7 @@ done_div();
// This test depends on kf3 getting its 0% and 100% values from the
// rules below it in the cascade; we're checking that the animation
// isn't rebuilt when the restyles happen.
new_div("-moz-animation: kf3 1s linear forwards");
new_div("animation: kf3 1s linear forwards");
is(cs.marginTop, "0px", "bug 686656 test 1 at 0ms");
advance_clock(250);
display.style.color = "blue";
@ -1330,7 +1330,7 @@ display.style.color = "";
// This test depends on kf3 getting its 0% and 100% values from the
// rules below it in the cascade; we're checking that the animation
// isn't rebuilt when the restyles happen.
new_div("-moz-animation: kf3 1s linear forwards");
new_div("animation: kf3 1s linear forwards");
is(cs.marginTop, "0px", "bug 686656 test 2 at 0ms");
advance_clock(250);
display.style.overflow = "scroll";
@ -1345,7 +1345,7 @@ display.style.overflow = "";
// Test that cascading between keyframes rules is per-property rather
// than per-rule (bug ), and that the timing function isn't taken from a
// rule that's skipped. (Bug 738003)
new_div("-moz-animation: cascade 1s linear forwards; position: relative");
new_div("animation: cascade 1s linear forwards; position: relative");
is(cs.top, "0px", "cascade test (top) at 0ms");
is(cs.left, "0px", "cascade test (top) at 0ms");
advance_clock(125);
@ -1374,7 +1374,7 @@ is(cs.top, "0px", "cascade test (top) at 1000ms");
is(cs.left, "0px", "cascade test (top) at 1000ms");
done_div();
new_div("-moz-animation: cascade2 8s linear forwards");
new_div("animation: cascade2 8s linear forwards");
is(cs.textIndent, "0px", "cascade2 test at 0s");
advance_clock(1000);
is(cs.textIndent, "25px", "cascade2 test at 1s");

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=716226
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style id="s">
@-moz-keyframes foo { }
@keyframes foo { }
</style>
</head>
<body>

View File

@ -55,22 +55,22 @@ var gAllowsExtra = {
/* These are the reverse of the above list; they're the unusual values
that do allow extra keywords afterwards */
var gAllowsExtraUnusual = {
"-moz-transition": { "all": true, "0s": true, "0s 0s": true, "ease": true,
"1s 2s linear": true, "1s linear 2s": true,
"linear 1s 2s": true, "linear 1s": true,
"1s linear": true, "1s 2s": true, "2s 1s": true,
"linear": true, "1s": true, "2s": true,
"ease-in-out": true, "2s ease-in": true,
"ease-out 2s": true },
"-moz-animation": { "none": true, "0s": true, "ease": true,
"normal": true, "running": true, "1.0": true,
"1s 2s linear": true, "1s linear 2s": true,
"linear 1s 2s": true, "linear 1s": true,
"1s linear": true, "1s 2s": true, "2s 1s": true,
"linear": true, "1s": true, "2s": true,
"ease-in-out": true, "2s ease-in": true,
"ease-out 2s": true, "1s bounce, 2s": true,
"1s bounce, 2s none": true },
"transition": { "all": true, "0s": true, "0s 0s": true, "ease": true,
"1s 2s linear": true, "1s linear 2s": true,
"linear 1s 2s": true, "linear 1s": true,
"1s linear": true, "1s 2s": true, "2s 1s": true,
"linear": true, "1s": true, "2s": true,
"ease-in-out": true, "2s ease-in": true,
"ease-out 2s": true },
"animation": { "none": true, "0s": true, "ease": true,
"normal": true, "running": true, "1.0": true,
"1s 2s linear": true, "1s linear 2s": true,
"linear 1s 2s": true, "linear 1s": true,
"1s linear": true, "1s 2s": true, "2s 1s": true,
"linear": true, "1s": true, "2s": true,
"ease-in-out": true, "2s ease-in": true,
"ease-out 2s": true, "1s bounce, 2s": true,
"1s bounce, 2s none": true },
};
function test_property(property)

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=577974
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style id="style">
@-moz-keyframes bounce {
@keyframes bounce {
from {
margin-left: 0
}
@ -75,7 +75,7 @@ is(bounce.cssRules[0].style.marginLeft, "0px", "keyframe rule style");
is(bounce.cssRules[1].style.marginLeft, "25px", "keyframe rule style");
is(bounce.cssRules[0].cssText, "0% { margin-left: 0px; }");
is(bounce.cssText, "@-moz-keyframes bouncier {\n" +
is(bounce.cssText, "@keyframes bouncier {\n" +
"0% { margin-left: 0px; }\n" +
"25% { margin-left: 25px; }\n" +
"75%, 85% { margin-left: 90px; }\n" +

View File

@ -101,7 +101,7 @@ try {
rule.style.color = "fuchsia";
} catch(ex) {}
rule = make_rule_and_remove_sheet("@-moz-keyframes a { from { color: blue } }");
rule = make_rule_and_remove_sheet("@keyframes a { from { color: blue } }");
rule.insertRule("from { color: fuchsia}");
rule.deleteRule("from");
rule.name = "b";

View File

@ -153,18 +153,18 @@ e.setAttribute("style", "background-clip: border-box, padding-box, border-box; b
is(e.style.background, "", "should not have background shorthand (background-size too long)");
// Check that we only serialize transition when the lists are the same length.
e.setAttribute("style", "-moz-transition-property: color, width; -moz-transition-duration: 1s, 200ms; -moz-transition-timing-function: ease-in, linear; -moz-transition-delay: 0s, 1s");
isnot(e.style.MozTransition, "", "should have -moz-transition shorthand (lists same length)");
e.setAttribute("style", "-moz-transition-property: color, width, left; -moz-transition-duration: 1s, 200ms; -moz-transition-timing-function: ease-in, linear; -moz-transition-delay: 0s, 1s");
is(e.style.MozTransition, "", "should not have -moz-transition shorthand (lists different lengths)");
e.setAttribute("style", "-moz-transition-property: all; -moz-transition-duration: 1s, 200ms; -moz-transition-timing-function: ease-in, linear; -moz-transition-delay: 0s, 1s");
is(e.style.MozTransition, "", "should not have -moz-transition shorthand (lists different lengths)");
e.setAttribute("style", "-moz-transition-property: color, width; -moz-transition-duration: 1s, 200ms, 300ms; -moz-transition-timing-function: ease-in, linear; -moz-transition-delay: 0s, 1s");
is(e.style.MozTransition, "", "should not have -moz-transition shorthand (lists different lengths)");
e.setAttribute("style", "-moz-transition-property: color, width; -moz-transition-duration: 1s, 200ms; -moz-transition-timing-function: ease-in, linear, ease-out; -moz-transition-delay: 0s, 1s");
is(e.style.MozTransition, "", "should not have -moz-transition shorthand (lists different lengths)");
e.setAttribute("style", "-moz-transition-property: color, width; -moz-transition-duration: 1s, 200ms; -moz-transition-timing-function: ease-in, linear; -moz-transition-delay: 0s, 1s, 0s");
is(e.style.MozTransition, "", "should not have -moz-transition shorthand (lists different lengths)");
e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
isnot(e.style.transition, "", "should have transition shorthand (lists same length)");
e.setAttribute("style", "transition-property: color, width, left; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
e.setAttribute("style", "transition-property: all; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms, 300ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear, ease-out; transition-delay: 0s, 1s");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s, 0s");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
// Check that the 'border' shorthand resets 'border-image' and
// '-moz-border-*-colors', but that other 'border-*' shorthands don't

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=435441
#display .before.started::before, #display .after.started::after {
width: 100px;
text-indent: 100px;
-moz-transition: 8s width ease-in-out, 8s text-indent ease-in-out;
transition: 8s width ease-in-out, 8s text-indent ease-in-out;
}
#display .before::before {
content: "Before";
@ -125,7 +125,7 @@ function make_reference_p() {
var p = document.createElement("p");
p.appendChild(document.createTextNode("reference"));
p.style.textIndent = "0px";
p.style.MozTransition = "8s text-indent linear";
p.style.transition = "8s text-indent linear";
div.appendChild(p);
return p;
}
@ -140,8 +140,8 @@ for (var tf in timingFunctions) {
var t = document.createTextNode("transition-timing-function: " + tf);
p.appendChild(t);
p.style.textIndent = "0px";
p.style.MozTransition = "8s text-indent linear";
p.style.MozTransitionTimingFunction = tf;
p.style.transition = "8s text-indent linear";
p.style.transitionTimingFunction = tf;
div.appendChild(p);
is(getComputedStyle(p, "").textIndent, "0px",
"should be zero before changing value");
@ -159,7 +159,7 @@ for each (var restyleParent in [true, false]) {
" at " + itime + "s");
p.appendChild(t);
p.style.textIndent = "0px";
p.style.MozTransition = "8s text-indent cubic-bezier(0, 1, 1, 0)";
p.style.transition = "8s text-indent cubic-bezier(0, 1, 1, 0)";
if (restyleParent) {
var d = document.createElement("div");
d.appendChild(p);
@ -186,7 +186,7 @@ for (var d = -4; d <= 4; ++d) {
var t = document.createTextNode("transition-delay: " + delay);
p.appendChild(t);
p.style.marginLeft = "0px";
p.style.MozTransition = "4s margin-left ease-out " + delay;
p.style.transition = "4s margin-left ease-out " + delay;
div.appendChild(p);
is(getComputedStyle(p, "").marginLeft, "0px",
"should be zero before changing value");
@ -202,7 +202,7 @@ for (var d = -4; d <= 4; ++d) {
var t = document.createTextNode("transition-delay: " + delay);
p.appendChild(t);
p.style.marginLeft = "0px";
p.style.MozTransition = "0s margin-left linear " + delay;
p.style.transition = "0s margin-left linear " + delay;
div.appendChild(p);
is(getComputedStyle(p, "").marginLeft, "0px",
"should be zero before changing value");
@ -217,7 +217,7 @@ function make_reset_test(transition, description)
var t = document.createTextNode(description);
p.appendChild(t);
p.style.marginLeft = "0px";
p.style.MozTransition = transition;
p.style.transition = transition;
div.appendChild(p);
is(getComputedStyle(p, "").marginLeft, "0px",
"should be zero before changing value");
@ -266,8 +266,8 @@ for (var i in descendant_tests) {
test.childNode.appendChild(document.createTextNode(
"parent with \"" + test.parent_transition + "\" and " +
"child with \"" + test.child_transition + "\""));
test.parentNode.style.MozTransition = test.parent_transition;
test.childNode.style.MozTransition = test.child_transition;
test.parentNode.style.transition = test.parent_transition;
test.childNode.style.transition = test.child_transition;
test.parentNode.style.textIndent = "50px"; // transition from 50 to 150
test.parentNode.style.letterSpacing = "10px"; // transition from 10 to 5
div.appendChild(test.parentNode);
@ -290,26 +290,26 @@ for (var i in descendant_tests) {
// This is because we're implementing the proposal in
// http://lists.w3.org/Archives/Public/www-style/2009Aug/0109.html
var number_tests = [
{ style: "-moz-transition: 4s margin, 8s margin-left" },
{ style: "-moz-transition: 4s margin-left, 8s margin" },
{ style: "-moz-transition-property: margin-left; " +
"-moz-transition-duration: 8s, 2s" },
{ style: "-moz-transition-property: margin-left, margin-left; " +
"-moz-transition-duration: 2s, 8s" },
{ style: "-moz-transition-property: margin-left, margin-left, margin-left; " +
"-moz-transition-duration: 8s, 2s" },
{ style: "-moz-transition-property: margin-left; " +
"-moz-transition-duration: 8s, 16s" },
{ style: "-moz-transition-property: margin-left, margin-left; " +
"-moz-transition-duration: 16s, 8s" },
{ style: "-moz-transition-property: margin-left, margin-left, margin-left; " +
"-moz-transition-duration: 8s, 16s" },
{ style: "-moz-transition-property: text-indent,word-spacing,margin-left; " +
"-moz-transition-duration: 8s; " +
"-moz-transition-delay: 0, 8s" },
{ style: "-moz-transition-property: text-indent,word-spacing,margin-left; " +
"-moz-transition-duration: 8s, 16s; " +
"-moz-transition-delay: 8s, 8s, 0, 8s, 8s, 8s" },
{ style: "transition: 4s margin, 8s margin-left" },
{ style: "transition: 4s margin-left, 8s margin" },
{ style: "transition-property: margin-left; " +
"transition-duration: 8s, 2s" },
{ style: "transition-property: margin-left, margin-left; " +
"transition-duration: 2s, 8s" },
{ style: "transition-property: margin-left, margin-left, margin-left; " +
"transition-duration: 8s, 2s" },
{ style: "transition-property: margin-left; " +
"transition-duration: 8s, 16s" },
{ style: "transition-property: margin-left, margin-left; " +
"transition-duration: 16s, 8s" },
{ style: "transition-property: margin-left, margin-left, margin-left; " +
"transition-duration: 8s, 16s" },
{ style: "transition-property: text-indent,word-spacing,margin-left; " +
"transition-duration: 8s; " +
"transition-delay: 0, 8s" },
{ style: "transition-property: text-indent,word-spacing,margin-left; " +
"transition-duration: 8s, 16s; " +
"transition-delay: 8s, 8s, 0, 8s, 8s, 8s" },
];
for (var i in number_tests) {
@ -333,7 +333,7 @@ function make_display_test(initially_none, text)
var p = document.createElement("p");
p.appendChild(document.createTextNode(text));
p.style.textIndent = "0px";
p.style.MozTransition = "8s text-indent ease-in-out";
p.style.transition = "8s text-indent ease-in-out";
if (initially_none)
p.style.display = "none";
div.appendChild(p);

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=583219
<style type="text/css">
#display {
-moz-transition: margin-left 1s linear;
transition: margin-left 1s linear;
}
</style>

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=537151
<style type="text/css">
#display {
-moz-transition: margin-left 200ms;
transition: margin-left 200ms;
}
</style>

View File

@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=613888
#animated-elements-container > span {
color: black;
background: white;
-moz-transition:
transition:
color 10s ease-out,
background 1s ease-out;
}

View File

@ -38,7 +38,7 @@ function myrand()
// Each of these values will also have a "computed" property filled in
// below, so that we ensure it always computes to the same value.
var values = {
"-moz-transition-duration":
"transition-duration":
[
{ lone: true, specified: "-moz-initial" },
{ lone: false, specified: "2s" },
@ -46,7 +46,7 @@ var values = {
{ lone: false, specified: "430ms" },
{ lone: false, specified: "-1s" },
],
"-moz-transition-property":
"transition-property":
[
{ lone: true, specified: "-moz-initial" },
{ lone: true, specified: "none" },
@ -57,7 +57,7 @@ var values = {
{ lone: false, specified: "unsupported-property" },
{ lone: false, specified: "-other-unsupported-property" },
],
"-moz-transition-timing-function":
"transition-timing-function":
[
{ lone: true, specified: "-moz-initial" },
{ lone: false, specified: "linear" },
@ -65,7 +65,7 @@ var values = {
{ lone: false, specified: "ease-in-out" },
{ lone: false, specified: "cubic-bezier(0, 0, 0.63, 1.00)" },
],
"-moz-transition-delay":
"transition-delay":
[
{ lone: true, specified: "-moz-initial" },
{ lone: false, specified: "2s" },

View File

@ -27,85 +27,85 @@ var c = document.createElement("div");
p.appendChild(c);
var cs = getComputedStyle(c, "");
p.style.MozTransitionProperty = "margin-left, margin-right";
c.style.MozTransitionProperty = "inherit";
is(cs.MozTransitionProperty, "margin-left, margin-right",
p.style.transitionProperty = "margin-left, margin-right";
c.style.transitionProperty = "inherit";
is(cs.transitionProperty, "margin-left, margin-right",
"computed style match with no other properties");
c.style.MozTransitionDuration = "5s";
is(cs.MozTransitionProperty, "margin-left, margin-right",
c.style.transitionDuration = "5s";
is(cs.transitionProperty, "margin-left, margin-right",
"computed style match with shorter property");
is(cs.MozTransitionDuration, "5s",
is(cs.transitionDuration, "5s",
"shorter property not extended");
c.style.MozTransitionDuration = "5s, 4s, 3s, 2000ms";
is(cs.MozTransitionProperty, "margin-left, margin-right",
c.style.transitionDuration = "5s, 4s, 3s, 2000ms";
is(cs.transitionProperty, "margin-left, margin-right",
"computed style match with longer property");
is(cs.MozTransitionDuration, "5s, 4s, 3s, 2s",
is(cs.transitionDuration, "5s, 4s, 3s, 2s",
"longer property computed correctly");
p.style.MozTransitionProperty = "";
c.style.MozTransitionProperty = "";
c.style.MozTransitionDuration = "";
p.style.transitionProperty = "";
c.style.transitionProperty = "";
c.style.transitionDuration = "";
// and repeat the above set of tests with property and duration swapped
p.style.MozTransitionDuration = "5s, 4s";
c.style.MozTransitionDuration = "inherit";
is(cs.MozTransitionDuration, "5s, 4s",
p.style.transitionDuration = "5s, 4s";
c.style.transitionDuration = "inherit";
is(cs.transitionDuration, "5s, 4s",
"computed style match with no other properties");
c.style.MozTransitionProperty = "margin-left";
is(cs.MozTransitionDuration, "5s, 4s",
c.style.transitionProperty = "margin-left";
is(cs.transitionDuration, "5s, 4s",
"computed style match with shorter property");
is(cs.MozTransitionProperty, "margin-left",
is(cs.transitionProperty, "margin-left",
"shorter property not extended");
c.style.MozTransitionProperty =
c.style.transitionProperty =
"margin-left, margin-right, margin-top, margin-bottom";
is(cs.MozTransitionDuration, "5s, 4s",
is(cs.transitionDuration, "5s, 4s",
"computed style match with longer property");
is(cs.MozTransitionProperty,
is(cs.transitionProperty,
"margin-left, margin-right, margin-top, margin-bottom",
"longer property computed correctly");
p.style.MozTransitionDuration = "";
c.style.MozTransitionDuration = "";
c.style.MozTransitionProperty = "";
p.style.transitionDuration = "";
c.style.transitionDuration = "";
c.style.transitionProperty = "";
// And do the same pair of tests for animations:
p.style.MozAnimationName = "bounce, roll";
c.style.MozAnimationName = "inherit";
is(cs.MozAnimationName, "bounce, roll",
p.style.animationName = "bounce, roll";
c.style.animationName = "inherit";
is(cs.animationName, "bounce, roll",
"computed style match with no other properties");
c.style.MozAnimationDuration = "5s";
is(cs.MozAnimationName, "bounce, roll",
c.style.animationDuration = "5s";
is(cs.animationName, "bounce, roll",
"computed style match with shorter property");
is(cs.MozAnimationDuration, "5s",
is(cs.animationDuration, "5s",
"shorter property not extended");
c.style.MozAnimationDuration = "5s, 4s, 3s, 2000ms";
is(cs.MozAnimationName, "bounce, roll",
c.style.animationDuration = "5s, 4s, 3s, 2000ms";
is(cs.animationName, "bounce, roll",
"computed style match with longer property");
is(cs.MozAnimationDuration, "5s, 4s, 3s, 2s",
is(cs.animationDuration, "5s, 4s, 3s, 2s",
"longer property computed correctly");
p.style.MozAnimationName = "";
c.style.MozAnimationName = "";
c.style.MozAnimationDuration = "";
p.style.animationName = "";
c.style.animationName = "";
c.style.animationDuration = "";
// and repeat the above set of tests with name and duration swapped
p.style.MozAnimationDuration = "5s, 4s";
c.style.MozAnimationDuration = "inherit";
is(cs.MozAnimationDuration, "5s, 4s",
p.style.animationDuration = "5s, 4s";
c.style.animationDuration = "inherit";
is(cs.animationDuration, "5s, 4s",
"computed style match with no other properties");
c.style.MozAnimationName = "bounce";
is(cs.MozAnimationDuration, "5s, 4s",
c.style.animationName = "bounce";
is(cs.animationDuration, "5s, 4s",
"computed style match with shorter property");
is(cs.MozAnimationName, "bounce",
is(cs.animationName, "bounce",
"shorter property not extended");
c.style.MozAnimationName =
c.style.animationName =
"bounce, roll, wiggle, spin";
is(cs.MozAnimationDuration, "5s, 4s",
is(cs.animationDuration, "5s, 4s",
"computed style match with longer property");
is(cs.MozAnimationName,
is(cs.animationName,
"bounce, roll, wiggle, spin",
"longer property computed correctly");
p.style.MozAnimationDuration = "";
c.style.MozAnimationDuration = "";
c.style.MozAnimationName = "";
p.style.animationDuration = "";
c.style.animationDuration = "";
c.style.animationName = "";
</script>
</pre>

View File

@ -19,34 +19,34 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=525530
var p = document.getElementById("display");
var cs = getComputedStyle(p, "");
p.style.MozTransitionProperty = "all";
p.style.MozTransitionDuration = "4s";
p.style.MozTransitionDelay = "-2s";
p.style.MozTransitionTimingFunction = "linear";
p.style.transitionProperty = "all";
p.style.transitionDuration = "4s";
p.style.transitionDelay = "-2s";
p.style.transitionTimingFunction = "linear";
is(cs.textIndent, "100px", "initial value");
p.style.textIndent = "0";
is(cs.textIndent, "50px", "transition is halfway");
p.style.MozTransitionDuration = "0s";
p.style.transitionDuration = "0s";
is(cs.textIndent, "50px", "changing duration doesn't change transitioning");
p.style.MozTransitionDelay = "0s";
p.style.transitionDelay = "0s";
is(cs.textIndent, "50px", "changing delay doesn't change transitioning");
p.style.MozTransitionProperty = "text-indent";
p.style.transitionProperty = "text-indent";
is(cs.textIndent, "50px",
"irrelevant change to transition property doesn't change transitioning");
p.style.MozTransitionProperty = "font";
p.style.transitionProperty = "font";
is(cs.textIndent, "0px",
"relevant change to transition property does change transitioning");
/** Test for Bug 522643 */
p.style.MozTransitionDuration = "4s";
p.style.MozTransitionDelay = "-2s";
p.style.MozTransitionProperty = "text-indent";
p.style.transitionDuration = "4s";
p.style.transitionDelay = "-2s";
p.style.transitionProperty = "text-indent";
p.style.textIndent = "100px";
is(cs.textIndent, "50px", "transition is halfway");
p.style.MozTransitionDuration = "0s";
p.style.MozTransitionDelay = "0s";
p.style.transitionDuration = "0s";
p.style.transitionDelay = "0s";
is(cs.textIndent, "50px",
"changing duration and delay doesn't change transitioning");
p.style.textIndent = "0px";

View File

@ -12,12 +12,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=531585
.bar { margin: 10px; }
#one { -moz-transition-duration: 500ms; -moz-transition-property: all; }
#two { -moz-transition: margin-left 1s; }
#three { -moz-transition: margin 0.5s 0.25s; }
#one { transition-duration: 500ms; transition-property: all; }
#two { transition: margin-left 1s; }
#three { transition: margin 0.5s 0.25s; }
#four, #five, #six, #seven::before, #seven::after {
-moz-transition: 500ms color;
transition: 500ms color;
border-color: black; /* don't derive from color */
-moz-column-rule-color: black; /* don't derive from color */
-moz-text-decoration-color: black; /* don't derive from color */
@ -26,14 +26,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=531585
#four {
/* give the reversing transition a long duration; the reversing will
still be quick */
-moz-transition-duration: 30s;
-moz-transition-timing-function: cubic-bezier(0, 1, 1, 0);
transition-duration: 30s;
transition-timing-function: cubic-bezier(0, 1, 1, 0);
}
/* make sure we don't get events for the pseudo-elements */
#seven::before, #seven::after {
content: "x";
-moz-transition-duration: 50ms;
transition-duration: 50ms;
}
#seven[foo]::before, #seven[foo]::after { color: lime; }
@ -272,9 +272,9 @@ setTimeout(function() {
// The transition hasn't finished already.
did_stops = true;
}
$("five").style.MozTransitionProperty = "margin-left";
$("six").style.MozTransitionDuration = "0s";
$("six").style.MozTransitionDelay = "0s";
$("five").style.transitionProperty = "margin-left";
$("six").style.transitionDuration = "0s";
$("six").style.transitionDelay = "0s";
$("six").style.color = "blue";
}, 100);
function poll_start_reversal() {

View File

@ -268,7 +268,7 @@ for (prop in gCSSProperties) {
var info = gCSSProperties[prop];
if (!(prop in supported_properties) &&
info.type != CSS_TYPE_TRUE_SHORTHAND &&
!prop.match(/^-moz-transition-/) &&
!prop.match(/^transition-/) &&
// FIXME (Bug 119078): THIS SHOULD REALLY NOT BE NEEDED!
prop != "-moz-binding") {
@ -288,7 +288,7 @@ for (prop in gCSSProperties) {
}
div.style.removeProperty(prop);
div.style.setProperty("-moz-transition", prop + " 20s linear", "");
div.style.setProperty("transition", prop + " 20s linear", "");
for (var i = 0; i < all_values.length; ++i) {
for (var j = i + 1; j < all_values.length; ++j) {
div.style.setProperty(prop, all_values[i], "");
@ -302,7 +302,7 @@ for (prop in gCSSProperties) {
}
}
div.style.removeProperty("-moz-transition");
div.style.removeProperty("transition");
div.style.removeProperty(prop);
if ("prerequisites" in info) {
var prereqs = info.prerequisites;
@ -317,9 +317,9 @@ for (prop in gCSSProperties) {
// linear timing function so that we can expect the transition to be
// one quarter of the way through the value space right after changing
// the property.
div.style.setProperty("-moz-transition-duration", "4s", "");
div.style.setProperty("-moz-transition-delay", "-1s", "");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-duration", "4s", "");
div.style.setProperty("transition-delay", "-1s", "");
div.style.setProperty("transition-timing-function", "linear", "");
for (prop in supported_properties) {
var tinfo = supported_properties[prop];
var info = gCSSProperties[prop];
@ -342,7 +342,7 @@ for (prop in supported_properties) {
}
// Make sure to unset the property and stop transitions on it.
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.removeProperty(prop);
cs.getPropertyValue(prop);
@ -353,7 +353,7 @@ for (prop in supported_properties) {
}
}
}
div.style.removeProperty("-moz-transition");
div.style.removeProperty("transition");
function get_distance(prop, v1, v2)
{
@ -377,11 +377,11 @@ function check_distance(prop, start, quarter, end)
}
function test_length_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "4px", "");
is(cs.getPropertyValue(prop), "4px",
"length-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "12px", "");
is(cs.getPropertyValue(prop), "6px",
"length-valued property " + prop + ": interpolation of lengths");
@ -397,25 +397,25 @@ function test_length_unclamped(prop) {
}
function test_length_clamped_or_unclamped(prop, is_clamped) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0px", "");
is(cs.getPropertyValue(prop), "0px",
"length-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "100px", "");
(is_clamped ? is : isnot)(cs.getPropertyValue(prop), "0px",
"length-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
// Test using float values in the range [0, 1] (e.g. opacity)
function test_float_zeroToOne_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0.3", "");
is(cs.getPropertyValue(prop), "0.3",
"float-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "0.8", "");
is(cs.getPropertyValue(prop), "0.425",
"float-valued property " + prop + ": interpolation of floats");
@ -430,25 +430,25 @@ function test_float_zeroToOne_unclamped(prop) {
}
function test_float_zeroToOne_clamped_or_unclamped(prop, is_clamped) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0", "");
is(cs.getPropertyValue(prop), "0",
"float-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "1", "");
(is_clamped ? is : isnot)(cs.getPropertyValue(prop), "0",
"float-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
// Test using float values in the range [1, infinity) (e.g. stroke-miterlimit)
function test_float_aboveOne_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "1", "");
is(cs.getPropertyValue(prop), "1",
"float-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "2.1", "");
is(cs.getPropertyValue(prop), "1.275",
"float-valued property " + prop + ": interpolation of floats");
@ -456,20 +456,20 @@ function test_float_aboveOne_transition(prop) {
}
function test_float_aboveOne_clamped(prop) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "1", "");
is(cs.getPropertyValue(prop), "1",
"float-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "5", "");
is(cs.getPropertyValue(prop), "1",
"float-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_percent_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "25%", "");
var av = cs.getPropertyValue(prop);
var a = any_unit_to_num(av);
@ -478,7 +478,7 @@ function test_percent_transition(prop) {
var b = any_unit_to_num(bv);
isnot(b, a, "different percentages (" + av + " and " + bv +
") should be different for " + prop);
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "25%", "");
var res = cs.getPropertyValue(prop);
is(any_unit_to_num(res) * 4, 3 * b + a,
@ -498,19 +498,19 @@ function test_percent_unclamped(prop) {
}
function test_percent_clamped_or_unclamped(prop, is_clamped) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0%", "");
var zero_val = cs.getPropertyValue(prop); // flushes too
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "150%", "");
(is_clamped ? is : isnot)(cs.getPropertyValue(prop), zero_val,
"percent-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_length_percent_calc_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0%", "");
var av = cs.getPropertyValue(prop);
var a = any_unit_to_num(av);
@ -529,31 +529,31 @@ function test_length_percent_calc_transition(prop) {
"computed value before transition for " + prop + ": '" +
v1v + "' should be halfway " +
"between '" + av + "' + and '" + bv + "'.");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "200px", "");
var v2v = cs.getPropertyValue(prop);
is(any_unit_to_num(v2v) * 8, 5*a + 3*b + 4*c,
"interpolation between length and percent for " + prop + ": '"
+ v2v + "'");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "-moz-calc(25% + 100px)", "");
v1v = cs.getPropertyValue(prop);
is(any_unit_to_num(v1v) * 4, b + 4*c,
"computed value before transition for " + prop + ": '" + v1v + "'");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "75%", "");
v2v = cs.getPropertyValue(prop);
is(any_unit_to_num(v2v) * 8, 5*a + 3*b + 6*c,
"interpolation between calc() and percent for " + prop + ": '" +
v2v + "'");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "150px", "");
v1v = cs.getPropertyValue(prop);
is(any_unit_to_num(v1v) * 2, c * 3,
"computed value before transition for " + prop + ": '" + v1v + "'");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "-moz-calc(50% + 50px)", "");
v2v = cs.getPropertyValue(prop);
is(any_unit_to_num(v2v) * 8, 7 * a + b + 10*c,
@ -568,22 +568,22 @@ function test_length_percent_calc_transition(prop) {
}
function test_color_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "rgb(255, 28, 0)", "");
is(cs.getPropertyValue(prop), "rgb(255, 28, 0)",
"color-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "rgb(75, 84, 128)", "");
is(cs.getPropertyValue(prop), "rgb(210, 42, 32)",
"color-valued property " + prop + ": interpolation of colors");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "rgb(128, 64, 0)", "");
(prop == "color" ? div.parentNode : div).style.
setProperty("color", "rgb(0, 0, 128)", "");
is(cs.getPropertyValue(prop), "rgb(128, 64, 0)",
"color-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "currentColor", "");
is(cs.getPropertyValue(prop), "rgb(96, 48, 32)",
"color-valued property " + prop + ": interpolation of currentColor");
@ -594,8 +594,8 @@ function test_color_transition(prop) {
(prop == "color" ? div.parentNode : div).style.removeProperty("color");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "rgb(0, 255, 0)", "");
var vals = cs.getPropertyValue(prop).match(/rgb\(([^, ]*), ([^, ]*), ([^, ]*)\)/);
is(vals.length, 4,
@ -606,7 +606,7 @@ function test_color_transition(prop) {
"color-valued property " + prop + ": flush before clamping test (green)");
is(vals[3], "0",
"color-valued property " + prop + ": flush before clamping test (blue)");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "rgb(255, 0, 128)", "");
// FIXME: Once we support non-sRGB colors, these tests will need fixing.
vals = cs.getPropertyValue(prop).match(/rgb\(([^, ]*), ([^, ]*), ([^, ]*)\)/);
@ -618,16 +618,16 @@ function test_color_transition(prop) {
"color-valued property " + prop + ": clamping of above-range (green)");
is(vals[3], "0",
"color-valued property " + prop + ": clamping of negatives (blue)");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_border_color_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "rgb(128, 64, 0)", "");
div.style.setProperty("color", "rgb(0, 0, 128)", "");
is(cs.getPropertyValue(prop), "rgb(128, 64, 0)",
"color-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.removeProperty(prop);
is(cs.getPropertyValue(prop), "rgb(96, 48, 32)",
"color-valued property " + prop + ": interpolation of initial value");
@ -640,22 +640,22 @@ function test_border_color_transition(prop) {
function test_shadow_transition(prop) {
var spreadStr = (prop == "box-shadow") ? " 0px" : "";
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "none", "");
is(cs.getPropertyValue(prop), "none",
"shadow-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "4px 8px 3px red", "");
is(cs.getPropertyValue(prop), "rgba(255, 0, 0, 0.25) 1px 2px 0.75px" + spreadStr,
"shadow-valued property " + prop + ": interpolation of shadows");
check_distance(prop, "none", "rgba(255, 0, 0, 0.25) 1px 2px 0.75px",
"4px 8px 3px red");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "#038000 4px 4px, 2px 2px blue", "");
is(cs.getPropertyValue(prop), "rgb(3, 128, 0) 4px 4px 0px" + spreadStr + ", rgb(0, 0, 255) 2px 2px 0px" + spreadStr,
"shadow-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "8px 8px 8px red", "");
is(cs.getPropertyValue(prop), "rgb(66, 96, 0) 5px 5px 2px" + spreadStr + ", rgba(0, 0, 255, 0.75) 1.5px 1.5px 0px" + spreadStr,
"shadow-valued property " + prop + ": interpolation of shadows");
@ -688,12 +688,12 @@ function test_shadow_transition(prop) {
"shadow-valued property " + prop + ": interpolation without color");
check_distance(prop, "2px 2px 2px", "3px 5px 4px", "6px 14px 10px");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0px 0px 0px black", "");
is(cs.getPropertyValue(prop), "rgb(0, 0, 0) 0px 0px 0px" + spreadStr,
"shadow-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "10px 10px 10px black", "");
var vals = cs.getPropertyValue(prop).split(" ");
is(vals.length, 6 + (prop == "box-shadow"), "unexpected number of values");
@ -706,11 +706,11 @@ function test_shadow_transition(prop) {
is(vals[5], "0px",
"shadow-valued property " + prop + " (radius): clamping of negatives");
if (prop == "box-shadow") {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0px 0px 0px 0px black", "");
is(cs.getPropertyValue(prop), "rgb(0, 0, 0) 0px 0px 0px 0px",
"shadow-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "10px 10px 10px 10px black", "");
var vals = cs.getPropertyValue(prop).split(" ");
is(vals.length, 7, "unexpected number of values");
@ -725,16 +725,16 @@ function test_shadow_transition(prop) {
isnot(vals[6], "0px",
"shadow-valued property " + prop + " (spread): clamping of negatives");
}
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_dasharray_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "3", "");
is(cs.getPropertyValue(prop), "3",
"dasharray-valued property " + prop +
": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "15px", "");
is(cs.getPropertyValue(prop), "6",
"dasharray-valued property " + prop + ": interpolation of dasharray");
@ -770,20 +770,20 @@ function test_dasharray_transition(prop) {
"dasharray-valued property " + prop + ": interpolation of dasharray");
check_distance(prop, "2,50%,6,10", "3, 45%, 5, 8", "6,30%,2,2");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0,0%", "");
is(cs.getPropertyValue(prop), "0, 0%",
"dasharray-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "5, 25%", "");
is(cs.getPropertyValue(prop), "0, 0%",
"dasharray-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_radius_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
// FIXME: Test a square for now, since we haven't updated to the spec
// for vertical components being relative to the height.
@ -798,43 +798,43 @@ function test_radius_transition(prop) {
is(cs.getPropertyValue(prop), "3px",
"radius-valued property " + prop +
": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "15px", "");
is(cs.getPropertyValue(prop), "6px",
"radius-valued property " + prop + ": interpolation of radius");
check_distance(prop, "3px", "6px", "15px");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "12.5%", "");
is(cs.getPropertyValue(prop), "32px",
"radius-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "25%", "");
is(cs.getPropertyValue(prop), "40px",
"radius-valued property " + prop + ": interpolation of radius");
check_distance(prop, "12.5%", "15.625%", "25%");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "3px 8px", "");
is(cs.getPropertyValue(prop), "3px 8px",
"radius-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "15px 12px", "");
is(cs.getPropertyValue(prop), "6px 9px",
"radius-valued property " + prop + ": interpolation of radius");
check_distance(prop, "3px 8px", "6px 9px", "15px 12px");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "12.5% 6.25%", "");
is(cs.getPropertyValue(prop), "32px 16px",
"radius-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "25%", "");
is(cs.getPropertyValue(prop), "40px 28px",
"radius-valued property " + prop + ": interpolation of radius");
check_distance(prop, "12.5% 6.25%", "15.625% 10.9375%", "25%");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "6.25% 12.5%", "");
is(cs.getPropertyValue(prop), "16px 32px",
"radius-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "64px 16px", "");
is(cs.getPropertyValue(prop), "28px",
"radius-valued property " + prop + ": interpolation of radius with mixed units");
@ -842,16 +842,16 @@ function test_radius_transition(prop) {
"-moz-calc(4.6875% + 16px) -moz-calc(9.375% + 4px)",
"64px 16px");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0px 0px", "");
is(cs.getPropertyValue(prop), "0px",
"radius-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "10px 20px", "");
is(cs.getPropertyValue(prop), "0px",
"radius-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
test_length_percent_calc_transition(prop);
@ -862,129 +862,129 @@ function test_radius_transition(prop) {
}
function test_integer_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "4", "");
is(cs.getPropertyValue(prop), "4",
"integer-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "-14", "");
is(cs.getPropertyValue(prop), "-1",
"integer-valued property " + prop + ": interpolation of integers");
check_distance(prop, "6", "1", "-14");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "-4", "");
is(cs.getPropertyValue(prop), "-4",
"integer-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "8", "");
is(cs.getPropertyValue(prop), "-1",
"integer-valued property " + prop + ": interpolation of integers");
check_distance(prop, "-4", "-1", "8");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0", "");
is(cs.getPropertyValue(prop), "0",
"integer-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "100", "");
isnot(cs.getPropertyValue(prop), "0",
"integer-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_font_stretch(prop) {
is(prop, "font-stretch", "only designed for one property");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "normal", "");
is(cs.getPropertyValue(prop), "normal",
"font-stretch property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "ultra-expanded", "");
is(cs.getPropertyValue(prop), "semi-expanded",
"font-stretch property " + prop + ": interpolation of font-stretches");
check_distance(prop, "normal", "semi-expanded", "ultra-expanded");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "expanded", "");
is(cs.getPropertyValue(prop), "expanded",
"font-stretch property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "extra-condensed", "");
is(cs.getPropertyValue(prop), "normal",
"font-stretch property " + prop + ": interpolation of font-stretches");
check_distance(prop, "expanded", "semi-expanded", "condensed");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "ultra-condensed", "");
is(cs.getPropertyValue(prop), "ultra-condensed",
"font-stretch property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "ultra-expanded", "");
is(cs.getPropertyValue(prop), "ultra-condensed",
"font-stretch property " + prop + ": clamping of values");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "ultra-expanded", "");
is(cs.getPropertyValue(prop), "ultra-expanded",
"font-stretch property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "ultra-condensed", "");
is(cs.getPropertyValue(prop), "ultra-expanded",
"font-stretch property " + prop + ": clamping of values");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_font_weight(prop) {
is(prop, "font-weight", "only designed for one property");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "normal", "");
is(cs.getPropertyValue(prop), "400",
"font-weight property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "900", "");
is(cs.getPropertyValue(prop), "500",
"font-weight property " + prop + ": interpolation of font-weights");
check_distance(prop, "400", "500", "800");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "900", "");
is(cs.getPropertyValue(prop), "900",
"font-weight property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "100", "");
is(cs.getPropertyValue(prop), "700",
"font-weight property " + prop + ": interpolation of font-weights");
check_distance(prop, "900", "700", "100");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "100", "");
is(cs.getPropertyValue(prop), "100",
"font-weight property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "900", "");
is(cs.getPropertyValue(prop), "100",
"font-weight property " + prop + ": clamping of values");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "900", "");
is(cs.getPropertyValue(prop), "900",
"font-weight property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "100", "");
is(cs.getPropertyValue(prop), "900",
"font-weight property " + prop + ": clamping of values");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_pos_integer_or_auto_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "4", "");
is(cs.getPropertyValue(prop), "4",
"integer-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "11", "");
is(cs.getPropertyValue(prop), "5",
"integer-valued property " + prop + ": interpolation of integers");
@ -1002,24 +1002,24 @@ function test_pos_integer_or_auto_transition(prop) {
}
function test_integer_at_least_one_clamping(prop) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "1", "");
is(cs.getPropertyValue(prop), "1",
"integer-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "5", "");
is(cs.getPropertyValue(prop), "1",
"integer-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_length_pair_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "4px 6px", "");
is(cs.getPropertyValue(prop), "4px 6px",
"length-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "12px 10px", "");
is(cs.getPropertyValue(prop), "6px 7px",
"length-valued property " + prop + ": interpolation of lengths");
@ -1027,24 +1027,24 @@ function test_length_pair_transition(prop) {
}
function test_length_pair_transition_clamped(prop) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0px 0px", "");
is(cs.getPropertyValue(prop), "0px 0px",
"length-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "30px 50px", "");
is(cs.getPropertyValue(prop), "0px 0px",
"length-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_length_percent_pair_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "4px 50%", "");
is(cs.getPropertyValue(prop), "4px 5px",
"length-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "12px 70%", "");
is(cs.getPropertyValue(prop), "6px 5.5px",
"length-valued property " + prop + ": interpolation of lengths");
@ -1060,24 +1060,24 @@ function test_length_percent_pair_unclamped(prop) {
}
function test_length_percent_pair_clamped_or_unclamped(prop, is_clamped) {
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0px 0%", "");
is(cs.getPropertyValue(prop), "0px 0px",
"length+percent-valued property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "30px 25%", "");
(is_clamped ? is : isnot)(cs.getPropertyValue(prop), "0px 0px",
"length+percent-valued property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_rect_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "rect(4px, 16px, 12px, 6px)", "");
is(cs.getPropertyValue(prop), "rect(4px, 16px, 12px, 6px)",
"rect-valued property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "rect(0px, 4px, 4px, 2px)", "");
is(cs.getPropertyValue(prop), "rect(3px, 13px, 10px, 5px)",
"rect-valued property " + prop + ": interpolation of rects");
@ -1094,8 +1094,8 @@ function test_rect_transition(prop) {
is(cs.getPropertyValue(prop), "auto",
"rect-valued property " + prop + ": can't interpolate auto components");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "rect(-10px, 30px, 0px, 0px)", "");
var vals = cs.getPropertyValue(prop).match(/rect\(([^, ]*), ([^, ]*), ([^, ]*), ([^, ]*)\)/);
is(vals.length, 5,
@ -1108,7 +1108,7 @@ function test_rect_transition(prop) {
"rect-valued property " + prop + ": flush before clamping test (bottom)");
is(vals[4], "0px",
"rect-valued property " + prop + ": flush before clamping test (left)");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "rect(0px, 40px, 10px, 10px)", "");
vals = cs.getPropertyValue(prop).match(/rect\(([^, ]*), ([^, ]*), ([^, ]*), ([^, ]*)\)/);
is(vals.length, 5,
@ -1121,15 +1121,15 @@ function test_rect_transition(prop) {
"rect-valued property " + prop + ": clamping of negatives (bottom)");
isnot(vals[4], "0px",
"rect-valued property " + prop + ": clamping of negatives (left)");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_visibility_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "visible", "");
is(cs.getPropertyValue(prop), "visible",
"visibility property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "hidden", "");
is(cs.getPropertyValue(prop), "visible",
"visibility property " + prop + ": interpolation of visibility");
@ -1140,32 +1140,32 @@ function test_visibility_transition(prop) {
is(get_distance(prop, "hidden", "hidden"), 0,
"distance between hidden and hidden should not be zero");
div.style.setProperty("-moz-transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "visible", "");
is(cs.getPropertyValue(prop), "visible",
"visibility property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "hidden", "");
is(cs.getPropertyValue(prop), "visible",
"visibility property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "hidden", "");
is(cs.getPropertyValue(prop), "hidden",
"visibility property " + prop + ": flush before clamping test");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "visible", "");
is(cs.getPropertyValue(prop), "hidden",
"visibility property " + prop + ": clamping of negatives");
div.style.setProperty("-moz-transition-timing-function", "linear", "");
div.style.setProperty("transition-timing-function", "linear", "");
}
function test_background_size_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "50% 80%", "");
is(cs.getPropertyValue(prop), "50% 80%",
"property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "100% 100%", "");
is(cs.getPropertyValue(prop), "62.5% 85%",
"property " + prop + ": interpolation of percents");
@ -1177,11 +1177,11 @@ function test_background_size_transition(prop) {
}
function test_background_position_transition(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "center 80%", "");
is(cs.getPropertyValue(prop), "50% 80%",
"property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "bottom right", "");
is(cs.getPropertyValue(prop), "62.5% 85%",
"property " + prop + ": interpolation of percents");
@ -1190,31 +1190,31 @@ function test_background_position_transition(prop) {
}
function test_background_position_size_common(prop) {
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "40% 0%", "");
is(cs.getPropertyValue(prop), "40% 0%",
"property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "0% 0%", "");
is(cs.getPropertyValue(prop), "30% 0%",
"property " + prop + ": interpolation of percentages");
check_distance(prop, "40% 0%", "30% 0%", "0% 0%");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "0% 40%", "");
is(cs.getPropertyValue(prop), "0% 40%",
"property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "0% 0%", "");
is(cs.getPropertyValue(prop), "0% 30%",
"property " + prop + ": interpolation of percentages");
check_distance(prop, "0% 40%", "0% 30%", "0% 0%");
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "10px 40px", "");
is(cs.getPropertyValue(prop), "10px 40px",
"property " + prop + ": computed value before transition");
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "50px 0", "");
is(cs.getPropertyValue(prop), "20px 30px",
"property " + prop + ": interpolation of lengths");
@ -1589,10 +1589,10 @@ function test_transform_transition(prop) {
if (test.requires_3d && !transform3D_enabled()) {
continue;
}
div.style.setProperty("-moz-transition-property", "none", "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, test.start, "");
cs.getPropertyValue(prop);
div.style.setProperty("-moz-transition-property", prop, "");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, test.end, "");
var actual = cs.getPropertyValue(prop);
if (!test.round_error_ok || actual == test.expected) {

View File

@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=435441
<style type="text/css">
p.transition {
-moz-transition: margin-top 100s linear;
transition: margin-top 100s linear;
}
</style>
@ -33,8 +33,8 @@ function run_test(tf, percent, value)
p.className = "transition";
p.style.marginTop = "0px";
// be this percent of the way through a 100s transition
p.style.MozTransitionDelay = (percent * -100) + "s";
p.style.MozTransitionTimingFunction = tf;
p.style.transitionDelay = (percent * -100) + "s";
p.style.transitionTimingFunction = tf;
display.appendChild(p);
var cs = getComputedStyle(p, "");
var flush1 = cs.marginTop;

View File

@ -211,16 +211,16 @@ var declarations = [
"content: attr(| ",
"content: attr(|href",
"content: attr(|href ",
"-moz-transition-timing-function: cubic-bezier(",
"-moz-transition-timing-function: cubic-bezier( ",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1 ",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1,",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1, ",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1, 1",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1, 1 ",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1, 1,",
"-moz-transition-timing-function: cubic-bezier(0, 0, 1, 1, ",
"transition-timing-function: cubic-bezier(",
"transition-timing-function: cubic-bezier( ",
"transition-timing-function: cubic-bezier(0, 0, 1",
"transition-timing-function: cubic-bezier(0, 0, 1 ",
"transition-timing-function: cubic-bezier(0, 0, 1,",
"transition-timing-function: cubic-bezier(0, 0, 1, ",
"transition-timing-function: cubic-bezier(0, 0, 1, 1",
"transition-timing-function: cubic-bezier(0, 0, 1, 1 ",
"transition-timing-function: cubic-bezier(0, 0, 1, 1,",
"transition-timing-function: cubic-bezier(0, 0, 1, 1, ",
"border-top-width: -moz-calc(",
"border-top-width: -moz-calc( ",
"border-top-width: -moz-calc(2em",

View File

@ -29,14 +29,14 @@ var tests = {
var p = document.getElementById("display");
for (var test in tests) {
p.setAttribute("style", "-moz-transition-duration: " + test);
is(p.style.getPropertyValue("-moz-transition-duration"), test,
p.setAttribute("style", "transition-duration: " + test);
is(p.style.getPropertyValue("transition-duration"), test,
test + " serializes to exactly itself");
var equiv = tests[test];
if (equiv) {
var cm1 = getComputedStyle(p, "").MozTransitionDuration;
p.style.MozTransitionDuration = equiv;
var cm2 = getComputedStyle(p, "").MozTransitionDuration;
var cm1 = getComputedStyle(p, "").transitionDuration;
p.style.transitionDuration = equiv;
var cm2 = getComputedStyle(p, "").transitionDuration;
is(cm1, cm2, test + " should compute to the same as " + equiv);
}
}

View File

@ -391,29 +391,32 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
NotifyViewportOrTransformChanged(changeBits);
}
// Now that we've marked the necessary children as dirty, call
// UpdateBounds() on them:
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(GetFirstPrincipalChild());
mCallingUpdateBounds = true;
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
// Now that we've marked the necessary children as dirty, call
// UpdateBounds() on them:
if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
nsIFrame* kid = mFrames.FirstChild();
while (kid) {
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
if (SVGFrame && !(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
SVGFrame->UpdateBounds();
}
kid = kid->GetNextSibling();
}
mCallingUpdateBounds = true;
// Update the mRects and visual overflow rects of all our descendants,
// including our anonymous wrapper kid:
anonKid->UpdateBounds();
NS_ABORT_IF_FALSE(!anonKid->GetNextSibling(),
"We should have one anonymous child frame wrapping our real children");
mCallingUpdateBounds = false;
}
mCallingUpdateBounds = false;
// Make sure we scroll if we're too big:
// XXX Use the bounding box of our descendants? (See bug 353460 comment 14.)
aDesiredSize.SetOverflowAreasToDesiredBounds();
FinishAndStoreOverflow(&aDesiredSize);
// Set our anonymous kid's offset from our border box:
anonKid->SetPosition(GetContentRectRelativeToSelf().TopLeft());
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsSVGOuterSVGFrame::Reflow: size=%d,%d",
aDesiredSize.width, aDesiredSize.height));
@ -471,9 +474,12 @@ nsDisplayOuterSVG::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
nsPoint rectCenter(rectAtOrigin.x + rectAtOrigin.width / 2,
rectAtOrigin.y + rectAtOrigin.height / 2);
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(
outerSVGFrame->GetFirstPrincipalChild());
nsIFrame* frame = nsSVGUtils::HitTestChildren(
outerSVGFrame, rectCenter + outerSVGFrame->GetPosition() -
outerSVGFrame->GetContentRect().TopLeft());
anonKid, rectCenter + outerSVGFrame->GetPosition() -
outerSVGFrame->GetContentRect().TopLeft());
if (frame) {
aOutFrames->AppendElement(frame);
}
@ -546,8 +552,8 @@ nsSVGOuterSVGFrame::AttributeChanged(PRInt32 aNameSpaceID,
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nsnull;
nsSVGUtils::NotifyChildrenOfSVGChange(
this, aAttribute == nsGkAtoms::viewBox ?
nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(),
aAttribute == nsGkAtoms::viewBox ?
TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED);
static_cast<nsSVGSVGElement*>(mContent)->ChildrenOnlyTransformChanged();
@ -600,15 +606,13 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
new (aBuilder) nsDisplayOuterSVG(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
if (GetStyleDisplay()->IsScrollableOverflow()) {
// Clip to our _content_ box:
nsRect clipRect =
GetContentRectRelativeToSelf() + aBuilder->ToReferenceFrame(this);
nsDisplayClip* item =
new (aBuilder) nsDisplayClip(aBuilder, this, &childItems, clipRect);
rv = childItems.AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
}
// Clip to our _content_ box:
nsRect clipRect =
GetContentRectRelativeToSelf() + aBuilder->ToReferenceFrame(this);
nsDisplayClip* item =
new (aBuilder) nsDisplayClip(aBuilder, this, &childItems, clipRect);
rv = childItems.AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
WrapReplacedContentForBorderRadius(aBuilder, &childItems, aLists);
@ -678,7 +682,38 @@ nsSVGOuterSVGFrame::NotifyViewportOrTransformChanged(PRUint32 aFlags)
}
}
nsSVGUtils::NotifyChildrenOfSVGChange(this, aFlags);
nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(), aFlags);
}
//----------------------------------------------------------------------
// nsISVGChildFrame methods:
NS_IMETHODIMP
nsSVGOuterSVGFrame::PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect)
{
NS_ASSERTION(GetFirstPrincipalChild()->GetType() ==
nsGkAtoms::svgOuterSVGAnonChildFrame &&
!GetFirstPrincipalChild()->GetNextSibling(),
"We should have a single, anonymous, child");
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(GetFirstPrincipalChild());
return anonKid->PaintSVG(aContext, aDirtyRect);
}
SVGBBox
nsSVGOuterSVGFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
PRUint32 aFlags)
{
NS_ASSERTION(GetFirstPrincipalChild()->GetType() ==
nsGkAtoms::svgOuterSVGAnonChildFrame &&
!GetFirstPrincipalChild()->GetNextSibling(),
"We should have a single, anonymous, child");
// We must defer to our child so that we don't include our
// content->PrependLocalTransformsTo() transforms.
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(GetFirstPrincipalChild());
return anonKid->GetBBoxContribution(aToBBoxUserspace, aFlags);
}
//----------------------------------------------------------------------
@ -707,24 +742,6 @@ nsSVGOuterSVGFrame::GetCanvasTM(PRUint32 aFor)
return *mCanvasTM;
}
bool
nsSVGOuterSVGFrame::HasChildrenOnlyTransform(gfxMatrix *aTransform) const
{
nsSVGSVGElement *content = static_cast<nsSVGSVGElement*>(mContent);
bool hasTransform = content->HasChildrenOnlyTransform();
if (hasTransform && aTransform) {
// Outer-<svg> doesn't use x/y, so we can pass eChildToUserSpace here.
gfxMatrix identity;
*aTransform =
content->PrependLocalTransformsTo(identity,
nsSVGElement::eChildToUserSpace);
}
return hasTransform;
}
//----------------------------------------------------------------------
// Implementation helpers
@ -779,3 +796,55 @@ nsSVGOuterSVGFrame::VerticalScrollbarNotNeeded() const
mLengthAttributes[nsSVGSVGElement::HEIGHT];
return height.IsPercentage() && height.GetBaseValInSpecifiedUnits() <= 100;
}
//----------------------------------------------------------------------
// Implementation of nsSVGOuterSVGAnonChildFrame
nsIFrame*
NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
return new (aPresShell) nsSVGOuterSVGAnonChildFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsSVGOuterSVGAnonChildFrame)
#ifdef DEBUG
NS_IMETHODIMP
nsSVGOuterSVGAnonChildFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
NS_ABORT_IF_FALSE(aParent->GetType() == nsGkAtoms::svgOuterSVGFrame,
"Unexpected parent");
return nsSVGOuterSVGAnonChildFrameBase::Init(aContent, aParent, aPrevInFlow);
}
#endif
nsIAtom *
nsSVGOuterSVGAnonChildFrame::GetType() const
{
return nsGkAtoms::svgOuterSVGAnonChildFrame;
}
bool
nsSVGOuterSVGAnonChildFrame::HasChildrenOnlyTransform(gfxMatrix *aTransform) const
{
// We must claim our nsSVGOuterSVGFrame's children-only transforms as our own
// so that the children we are used to wrap are transformed properly.
nsSVGSVGElement *content = static_cast<nsSVGSVGElement*>(mContent);
bool hasTransform = content->HasChildrenOnlyTransform();
if (hasTransform && aTransform) {
// Outer-<svg> doesn't use x/y, so we can pass eChildToUserSpace here.
gfxMatrix identity;
*aTransform =
content->PrependLocalTransformsTo(identity,
nsSVGElement::eChildToUserSpace);
}
return hasTransform;
}

View File

@ -76,6 +76,15 @@ public:
nsIAtom* aAttribute,
PRInt32 aModType);
virtual nsIFrame* GetContentInsertionFrame() {
// Any children must be added to our single anonymous inner frame kid.
NS_ABORT_IF_FALSE(GetFirstPrincipalChild() &&
GetFirstPrincipalChild()->GetType() ==
nsGkAtoms::svgOuterSVGAnonChildFrame,
"Where is our anonymous child?");
return GetFirstPrincipalChild()->GetContentInsertionFrame();
}
virtual bool IsSVGTransformed(gfxMatrix *aOwnTransform,
gfxMatrix *aFromParentTransform) const {
// Outer-<svg> can transform its children with viewBox, currentScale and
@ -86,10 +95,23 @@ public:
// nsISVGSVGFrame interface:
virtual void NotifyViewportOrTransformChanged(PRUint32 aFlags);
// nsISVGChildFrame methods:
NS_IMETHOD PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect);
virtual SVGBBox GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
PRUint32 aFlags);
// nsSVGContainerFrame methods:
virtual gfxMatrix GetCanvasTM(PRUint32 aFor);
virtual bool HasChildrenOnlyTransform(gfxMatrix *aTransform) const;
virtual bool HasChildrenOnlyTransform(gfxMatrix *aTransform) const {
// Our anonymous wrapper child must claim our children-only transforms as
// its own so that our real children (the frames it wraps) are transformed
// by them, and we must pretend we don't have any children-only transforms
// so that our anonymous child is _not_ transformed by them.
return false;
}
/**
* Return true only if the height is unspecified (defaulting to 100%) or else
@ -124,4 +146,81 @@ protected:
bool mIsRootContent;
};
////////////////////////////////////////////////////////////////////////
// nsSVGOuterSVGAnonChildFrame class
typedef nsSVGDisplayContainerFrame nsSVGOuterSVGAnonChildFrameBase;
/**
* nsSVGOuterSVGFrames have a single direct child that is an instance of this
* class, and which is used to wrap their real child frames. Such anonymous
* wrapper frames created from this class exist because SVG frames need their
* GetPosition() offset to be their offset relative to "user space" (in app
* units) so that they can play nicely with nsDisplayTransform. This is fine
* for all SVG frames except for direct children of an nsSVGOuterSVGFrame,
* since an nsSVGOuterSVGFrame can have CSS border and padding (unlike other
* SVG frames). The direct children can't include the offsets due to any such
* border/padding in their mRects since that would break nsDisplayTransform,
* but not including these offsets would break other parts of the Mozilla code
* that assume a frame's mRect contains its border-box-to-parent-border-box
* offset, in particular nsIFrame::GetOffsetTo and the functions that depend on
* it. Wrapping an nsSVGOuterSVGFrame's children in an instance of this class
* with its GetPosition() set to its nsSVGOuterSVGFrame's border/padding offset
* keeps both nsDisplayTransform and nsIFrame::GetOffsetTo happy.
*
* The reason that this class inherit from nsSVGDisplayContainerFrame rather
* than simply from nsContainerFrame is so that we can avoid having special
* handling for these inner wrappers in multiple parts of the SVG code. For
* example, the implementations of IsSVGTransformed and GetCanvasTM assume
* nsSVGContainerFrame instances all the way up to the nsSVGOuterSVGFrame.
*/
class nsSVGOuterSVGAnonChildFrame
: public nsSVGOuterSVGAnonChildFrameBase
{
friend nsIFrame*
NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
nsSVGOuterSVGAnonChildFrame(nsStyleContext* aContext)
: nsSVGOuterSVGAnonChildFrameBase(aContext)
{}
public:
NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD GetFrameName(nsAString& aResult) const {
return MakeFrameName(NS_LITERAL_STRING("SVGOuterSVGAnonChild"), aResult);
}
#endif
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::svgOuterSVGAnonChildFrame
*/
virtual nsIAtom* GetType() const;
virtual bool IsSVGTransformed(gfxMatrix *aOwnTransform,
gfxMatrix *aFromParentTransform) const {
// Outer-<svg> can transform its children with viewBox, currentScale and
// currentTranslate, but it itself is not transformed by _SVG_ transforms.
return false;
}
// nsSVGContainerFrame methods:
virtual gfxMatrix GetCanvasTM(PRUint32 aFor) {
// GetCanvasTM returns the transform from an SVG frame to the frame's
// nsSVGOuterSVGFrame's content box, so we do not include any x/y offset
// set on us for any CSS border or padding on our nsSVGOuterSVGFrame.
return static_cast<nsSVGOuterSVGFrame*>(mParent)->GetCanvasTM(aFor);
}
virtual bool HasChildrenOnlyTransform(gfxMatrix *aTransform) const;
};
#endif

View File

@ -46,7 +46,6 @@ nsSVGTextPathFrame::Init(nsIContent* aContent,
nsCOMPtr<nsIDOMSVGTextPathElement> textPath = do_QueryInterface(aContent);
NS_ASSERTION(textPath, "Content is not an SVG textPath");
return nsSVGTextPathFrameBase::Init(aContent, aParent, aPrevInFlow);
}
#endif /* DEBUG */

View File

@ -703,7 +703,6 @@ nsSVGUtils::InvalidateBounds(nsIFrame *aFrame, bool aDuringUpdate,
NS_ASSERTION(aFrame->GetStateBits() & NS_STATE_IS_OUTER_SVG,
"SVG frames must always have an nsSVGOuterSVGFrame ancestor!");
invalidArea.MoveBy(aFrame->GetContentRect().TopLeft() - aFrame->GetPosition());
static_cast<nsSVGOuterSVGFrame*>(aFrame)->InvalidateWithFlags(invalidArea,
aFlags);

View File

@ -14,7 +14,7 @@ switch {
-moz-binding: none !important;
}
svg, symbol, image, marker, pattern, foreignObject {
svg:not(:root), symbol, image, marker, pattern, foreignObject {
overflow: hidden;
}

View File

@ -6,19 +6,12 @@
package org.mozilla.gecko;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.BufferedCairoImage;
import org.mozilla.gecko.gfx.FloatSize;
import org.mozilla.gecko.gfx.GeckoLayerClient;
import org.mozilla.gecko.gfx.IntSize;
import org.mozilla.gecko.gfx.Layer;
import org.mozilla.gecko.gfx.LayerController;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.gfx.PluginLayer;
import org.mozilla.gecko.gfx.RectUtils;
import org.mozilla.gecko.gfx.SurfaceTextureLayer;
import org.mozilla.gecko.gfx.ViewportMetrics;
import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
import java.io.*;
import java.util.*;
@ -27,7 +20,6 @@ import java.util.regex.Matcher;
import java.util.zip.*;
import java.net.URL;
import java.nio.*;
import java.nio.channels.FileChannel;
import java.util.concurrent.*;
import java.lang.reflect.*;
import java.net.*;
@ -40,7 +32,6 @@ import android.text.*;
import android.text.format.Time;
import android.view.*;
import android.view.inputmethod.*;
import android.view.ViewGroup.LayoutParams;
import android.content.*;
import android.content.res.*;
import android.graphics.*;
@ -94,7 +85,7 @@ abstract public class GeckoApp
public static boolean mDOMFullScreen = false;
protected MenuPanel mMenuPanel;
protected Menu mMenu;
private static GeckoThread sGeckoThread = null;
private static GeckoThread sGeckoThread;
public Handler mMainHandler;
private GeckoProfile mProfile;
public static boolean sIsGeckoReady = false;
@ -3220,6 +3211,28 @@ abstract public class GeckoApp
return false;
}
public static void assertOnUiThread() {
Thread uiThread = mAppContext.getMainLooper().getThread();
assertOnThread(uiThread);
}
public static void assertOnGeckoThread() {
assertOnThread(sGeckoThread);
}
private static void assertOnThread(Thread expectedThread) {
Thread currentThread = Thread.currentThread();
long currentThreadId = currentThread.getId();
long expectedThreadId = expectedThread.getId();
if (currentThreadId != expectedThreadId) {
throw new IllegalThreadStateException("Expected thread " + expectedThreadId + " (\""
+ expectedThread.getName()
+ "\"), but running on thread " + currentThreadId
+ " (\"" + currentThread.getName() + ")");
}
}
// SDK version 15 accessibility methods retrieved through reflection.
private static class AccessibilityCompat {
private static boolean mInitialized = false;

View File

@ -134,7 +134,8 @@ public class GeckoInputConnection
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
if (mCommittingText)
Log.e(LOGTAG, "Please report this bug:", new IllegalStateException("commitText, but already committing text?!"));
Log.e(LOGTAG, "Please report this bug:",
new IllegalStateException("commitText, but already committing text?!"));
mCommittingText = true;
replaceText(text, newCursorPosition, false);
@ -321,6 +322,7 @@ public class GeckoInputConnection
if (DEBUG) {
Log.d(LOGTAG, String.format("IME: replaceText(\"%s\", %d, %b)",
text, newCursorPosition, composing));
GeckoApp.assertOnUiThread();
}
if (text == null)
@ -450,14 +452,16 @@ public class GeckoInputConnection
return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
}
public void notifyTextChange(InputMethodManager imm, String text,
int start, int oldEnd, int newEnd) {
protected void notifyTextChange(InputMethodManager imm, String text,
int start, int oldEnd, int newEnd) {
if (!mBatchMode) {
if (!text.contentEquals(mEditable)) {
if (DEBUG) Log.d(LOGTAG, String.format(
". . . notifyTextChange: current mEditable=\"%s\"",
mEditable.toString()));
setEditable(text);
// Editable will be updated by IME event
if (!hasCompositionString())
setEditable(text);
}
}
@ -489,8 +493,7 @@ public class GeckoInputConnection
imm.updateExtractedText(v, mUpdateRequest.token, mUpdateExtract);
}
public void notifySelectionChange(InputMethodManager imm,
int start, int end) {
protected void notifySelectionChange(InputMethodManager imm, int start, int end) {
if (!mBatchMode) {
final Editable content = getEditable();
@ -698,10 +701,14 @@ public class GeckoInputConnection
}
private void endComposition() {
if (DEBUG) Log.d(LOGTAG, "IME: endComposition: IME_COMPOSITION_END");
if (DEBUG) {
Log.d(LOGTAG, "IME: endComposition: IME_COMPOSITION_END");
GeckoApp.assertOnUiThread();
}
if (!hasCompositionString())
Log.e(LOGTAG, "Please report this bug:", new IllegalStateException("endComposition, but not composing text?!"));
Log.e(LOGTAG, "Please report this bug:",
new IllegalStateException("endComposition, but not composing text?!"));
GeckoAppShell.sendEventToGecko(
GeckoEvent.createIMEEvent(GeckoEvent.IME_COMPOSITION_END, 0, 0));
@ -710,7 +717,10 @@ public class GeckoInputConnection
}
private void sendTextToGecko(CharSequence text, int caretPos) {
if (DEBUG) Log.d(LOGTAG, "IME: sendTextToGecko(\"" + text + "\")");
if (DEBUG) {
Log.d(LOGTAG, "IME: sendTextToGecko(\"" + text + "\")");
GeckoApp.assertOnUiThread();
}
// Handle composition text styles
if (text != null && text instanceof Spanned) {
@ -808,19 +818,19 @@ public class GeckoInputConnection
outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
else if (mIMETypeHint.equalsIgnoreCase("number") ||
mIMETypeHint.equalsIgnoreCase("range"))
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
InputType.TYPE_NUMBER_FLAG_SIGNED |
InputType.TYPE_NUMBER_FLAG_DECIMAL;
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER
| InputType.TYPE_NUMBER_FLAG_SIGNED
| InputType.TYPE_NUMBER_FLAG_DECIMAL;
else if (mIMETypeHint.equalsIgnoreCase("datetime") ||
mIMETypeHint.equalsIgnoreCase("datetime-local"))
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
InputType.TYPE_DATETIME_VARIATION_NORMAL;
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME
| InputType.TYPE_DATETIME_VARIATION_NORMAL;
else if (mIMETypeHint.equalsIgnoreCase("date"))
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
InputType.TYPE_DATETIME_VARIATION_DATE;
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME
| InputType.TYPE_DATETIME_VARIATION_DATE;
else if (mIMETypeHint.equalsIgnoreCase("time"))
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
InputType.TYPE_DATETIME_VARIATION_TIME;
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME
| InputType.TYPE_DATETIME_VARIATION_TIME;
if (mIMEActionHint.equalsIgnoreCase("go"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_GO;
@ -874,6 +884,7 @@ public class GeckoInputConnection
if (DEBUG) {
Log.d(LOGTAG, "IME: processKeyDown(keyCode=" + keyCode + ", event=" + event + ", "
+ isPreIme + ")");
GeckoApp.assertOnUiThread();
}
if (keyCode > KeyEvent.getMaxKeyCode())
@ -936,6 +947,7 @@ public class GeckoInputConnection
if (DEBUG) {
Log.d(LOGTAG, "IME: processKeyUp(keyCode=" + keyCode + ", event=" + event + ", "
+ isPreIme + ")");
GeckoApp.assertOnUiThread();
}
if (keyCode > KeyEvent.getMaxKeyCode())
@ -993,71 +1005,82 @@ public class GeckoInputConnection
return mIMEState != IME_STATE_DISABLED;
}
public void notifyIME(int type, int state) {
View v = GeckoApp.mAppContext.getLayerController().getView();
public void notifyIME(final int type, final int state) {
postToUiThread(new Runnable() {
public void run() {
View v = GeckoApp.mAppContext.getLayerController().getView();
if (v == null)
return;
if (v == null)
return;
switch (type) {
case NOTIFY_IME_RESETINPUTSTATE:
if (DEBUG) Log.d(LOGTAG, ". . . notifyIME: reset");
switch (type) {
case NOTIFY_IME_RESETINPUTSTATE:
if (DEBUG) Log.d(LOGTAG, ". . . notifyIME: reset");
// Gecko just cancelled the current composition from underneath us,
// so abandon our active composition string WITHOUT committing it!
resetCompositionState();
// Gecko just cancelled the current composition from underneath us,
// so abandon our active composition string WITHOUT committing it!
resetCompositionState();
// Don't use IMEStateUpdater for reset.
// Because IME may not work showSoftInput()
// after calling restartInput() immediately.
// So we have to call showSoftInput() delay.
InputMethodManager imm = getInputMethodManager();
if (imm == null) {
// no way to reset IME status directly
IMEStateUpdater.resetIME();
} else {
imm.restartInput(v);
}
// Don't use IMEStateUpdater for reset.
// Because IME may not work showSoftInput()
// after calling restartInput() immediately.
// So we have to call showSoftInput() delay.
InputMethodManager imm = getInputMethodManager();
if (imm == null) {
// no way to reset IME status directly
IMEStateUpdater.resetIME();
} else {
imm.restartInput(v);
// keep current enabled state
IMEStateUpdater.enableIME();
break;
case NOTIFY_IME_CANCELCOMPOSITION:
if (DEBUG) Log.d(LOGTAG, ". . . notifyIME: cancel");
IMEStateUpdater.resetIME();
break;
case NOTIFY_IME_FOCUSCHANGE:
if (DEBUG) Log.d(LOGTAG, ". . . notifyIME: focus");
IMEStateUpdater.resetIME();
break;
}
}
// keep current enabled state
IMEStateUpdater.enableIME();
break;
case NOTIFY_IME_CANCELCOMPOSITION:
if (DEBUG) Log.d(LOGTAG, ". . . notifyIME: cancel");
IMEStateUpdater.resetIME();
break;
case NOTIFY_IME_FOCUSCHANGE:
if (DEBUG) Log.d(LOGTAG, ". . . notifyIME: focus");
IMEStateUpdater.resetIME();
break;
}
});
}
public void notifyIMEEnabled(int state, String typeHint, String actionHint) {
View v = GeckoApp.mAppContext.getLayerController().getView();
public void notifyIMEEnabled(final int state, final String typeHint, final String actionHint) {
postToUiThread(new Runnable() {
public void run() {
View v = GeckoApp.mAppContext.getLayerController().getView();
if (v == null)
return;
if (v == null)
return;
/* When IME is 'disabled', IME processing is disabled.
In addition, the IME UI is hidden */
mIMEState = state;
mIMETypeHint = typeHint;
mIMEActionHint = actionHint;
IMEStateUpdater.enableIME();
/* When IME is 'disabled', IME processing is disabled.
In addition, the IME UI is hidden */
mIMEState = state;
mIMETypeHint = typeHint;
mIMEActionHint = actionHint;
IMEStateUpdater.enableIME();
}
});
}
public void notifyIMEChange(String text, int start, int end, int newEnd) {
InputMethodManager imm = getInputMethodManager();
if (imm == null)
return;
public final void notifyIMEChange(final String text, final int start, final int end,
final int newEnd) {
postToUiThread(new Runnable() {
public void run() {
InputMethodManager imm = getInputMethodManager();
if (imm == null)
return;
if (newEnd < 0)
notifySelectionChange(imm, start, end);
else
notifyTextChange(imm, text, start, end, newEnd);
if (newEnd < 0)
notifySelectionChange(imm, start, end);
else
notifyTextChange(imm, text, start, end, newEnd);
}
});
}
/* Delay updating IME states (see bug 573800) */
@ -1088,35 +1111,39 @@ public class GeckoInputConnection
instance = null;
}
final View v = GeckoApp.mAppContext.getLayerController().getView();
if (DEBUG) Log.d(LOGTAG, "IME: v=" + v);
// TimerTask.run() is running on a random background thread, so post to UI thread.
postToUiThread(new Runnable() {
public void run() {
final View v = GeckoApp.mAppContext.getLayerController().getView();
final InputMethodManager imm = getInputMethodManager();
if (imm == null)
return;
final InputMethodManager imm = getInputMethodManager();
if (imm == null)
return;
if (mReset)
imm.restartInput(v);
if (mReset)
imm.restartInput(v);
if (!mEnable)
return;
if (!mEnable)
return;
if (mIMEState != IME_STATE_DISABLED) {
imm.showSoftInput(v, 0);
} else {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
if (mIMEState != IME_STATE_DISABLED) {
imm.showSoftInput(v, 0);
} else {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
}
});
}
}
public void setEditable(String contents) {
private void setEditable(String contents) {
mEditable.removeSpan(this);
mEditable.replace(0, mEditable.length(), contents);
mEditable.setSpan(this, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
Selection.setSelection(mEditable, contents.length());
}
public void initEditable(String contents) {
private void initEditable(String contents) {
mEditable = mEditableFactory.newEditable(contents);
mEditable.setSpan(this, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
Selection.setSelection(mEditable, contents.length());
@ -1143,6 +1170,12 @@ public class GeckoInputConnection
return new Span(start, end, content);
}
private static void postToUiThread(Runnable runnable) {
// postToUiThread() is called by the Gecko and TimerTask threads.
// The UI thread does not need to post Runnables to itself.
GeckoApp.mAppContext.mMainHandler.post(runnable);
}
private static final class Span {
public final int start;
public final int end;
@ -1182,29 +1215,34 @@ public class GeckoInputConnection
private static final class DebugGeckoInputConnection extends GeckoInputConnection {
public DebugGeckoInputConnection(View targetView) {
super(targetView);
GeckoApp.assertOnUiThread();
}
@Override
public boolean beginBatchEdit() {
Log.d(LOGTAG, "IME: beginBatchEdit");
GeckoApp.assertOnUiThread();
return super.beginBatchEdit();
}
@Override
public boolean endBatchEdit() {
Log.d(LOGTAG, "IME: endBatchEdit");
GeckoApp.assertOnUiThread();
return super.endBatchEdit();
}
@Override
public boolean commitCompletion(CompletionInfo text) {
Log.d(LOGTAG, "IME: commitCompletion");
GeckoApp.assertOnUiThread();
return super.commitCompletion(text);
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
Log.d(LOGTAG, String.format("IME: commitText(\"%s\", %d)", text, newCursorPosition));
GeckoApp.assertOnUiThread();
return super.commitText(text, newCursorPosition);
}
@ -1212,12 +1250,14 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
public boolean deleteSurroundingText(int leftLength, int rightLength) {
Log.d(LOGTAG, "IME: deleteSurroundingText(leftLen=" + leftLength + ", rightLen="
+ rightLength + ")");
GeckoApp.assertOnUiThread();
return super.deleteSurroundingText(leftLength, rightLength);
}
@Override
public boolean finishComposingText() {
Log.d(LOGTAG, "IME: finishComposingText");
GeckoApp.assertOnUiThread();
return super.finishComposingText();
}
@ -1225,18 +1265,21 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
public Editable getEditable() {
Editable editable = super.getEditable();
Log.d(LOGTAG, "IME: getEditable -> " + editable);
GeckoApp.assertOnUiThread();
return editable;
}
@Override
public boolean performContextMenuAction(int id) {
Log.d(LOGTAG, "IME: performContextMenuAction");
GeckoApp.assertOnUiThread();
return super.performContextMenuAction(id);
}
@Override
public ExtractedText getExtractedText(ExtractedTextRequest req, int flags) {
Log.d(LOGTAG, "IME: getExtractedText");
GeckoApp.assertOnUiThread();
ExtractedText extract = super.getExtractedText(req, flags);
if (extract != null)
Log.d(LOGTAG, String.format(
@ -1248,6 +1291,7 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
@Override
public CharSequence getTextAfterCursor(int length, int flags) {
Log.d(LOGTAG, "IME: getTextAfterCursor(length=" + length + ", flags=" + flags + ")");
GeckoApp.assertOnUiThread();
CharSequence s = super.getTextAfterCursor(length, flags);
Log.d(LOGTAG, ". . . getTextAfterCursor returns \"" + s + "\"");
return s;
@ -1256,6 +1300,7 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
@Override
public CharSequence getTextBeforeCursor(int length, int flags) {
Log.d(LOGTAG, "IME: getTextBeforeCursor");
GeckoApp.assertOnUiThread();
CharSequence s = super.getTextBeforeCursor(length, flags);
Log.d(LOGTAG, ". . . getTextBeforeCursor returns \"" + s + "\"");
return s;
@ -1264,24 +1309,28 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
Log.d(LOGTAG, String.format("IME: setComposingText(\"%s\", %d)", text, newCursorPosition));
GeckoApp.assertOnUiThread();
return super.setComposingText(text, newCursorPosition);
}
@Override
public boolean setComposingRegion(int start, int end) {
Log.d(LOGTAG, "IME: setComposingRegion(start=" + start + ", end=" + end + ")");
GeckoApp.assertOnUiThread();
return super.setComposingRegion(start, end);
}
@Override
public boolean setSelection(int start, int end) {
Log.d(LOGTAG, "IME: setSelection(start=" + start + ", end=" + end + ")");
GeckoApp.assertOnUiThread();
return super.setSelection(start, end);
}
@Override
public String getComposingText() {
Log.d(LOGTAG, "IME: getComposingText");
GeckoApp.assertOnUiThread();
String s = super.getComposingText();
Log.d(LOGTAG, ". . . getComposingText: Composing text = \"" + s + "\"");
return s;
@ -1290,12 +1339,15 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
@Override
public boolean onKeyDel() {
Log.d(LOGTAG, "IME: onKeyDel");
GeckoApp.assertOnUiThread();
return super.onKeyDel();
}
@Override
public void notifyTextChange(InputMethodManager imm, String text,
int start, int oldEnd, int newEnd) {
protected void notifyTextChange(InputMethodManager imm, String text,
int start, int oldEnd, int newEnd) {
// notifyTextChange() call is posted to UI thread from notifyIMEChange().
GeckoApp.assertOnUiThread();
Log.d(LOGTAG, String.format(
"IME: >notifyTextChange(\"%s\", start=%d, oldEnd=%d, newEnd=%d)",
text, start, oldEnd, newEnd));
@ -1303,8 +1355,9 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
}
@Override
public void notifySelectionChange(InputMethodManager imm,
int start, int end) {
protected void notifySelectionChange(InputMethodManager imm, int start, int end) {
// notifySelectionChange() call is posted to UI thread from notifyIMEChange().
GeckoApp.assertOnUiThread();
Log.d(LOGTAG, String.format("IME: >notifySelectionChange(start=%d, end=%d)", start, end));
super.notifySelectionChange(imm, start, end);
}
@ -1312,6 +1365,7 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
@Override
protected void resetCompositionState() {
Log.d(LOGTAG, "IME: resetCompositionState");
GeckoApp.assertOnUiThread();
if (hasCompositionString()) {
Log.d(LOGTAG, "resetCompositionState() is abandoning an active composition string");
}
@ -1322,12 +1376,14 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.d(LOGTAG, String.format("IME: onTextChanged(\"%s\" start=%d, before=%d, count=%d)",
s, start, before, count));
GeckoApp.assertOnUiThread();
super.onTextChanged(s, start, before, count);
}
@Override
public void afterTextChanged(Editable s) {
Log.d(LOGTAG, "IME: afterTextChanged(\"" + s + "\")");
GeckoApp.assertOnUiThread();
super.afterTextChanged(s);
}
@ -1335,30 +1391,35 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
Log.d(LOGTAG, String.format("IME: beforeTextChanged(\"%s\", start=%d, count=%d, after=%d)",
s, start, count, after));
GeckoApp.assertOnUiThread();
super.beforeTextChanged(s, start, count, after);
}
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
Log.d(LOGTAG, "IME: onCreateInputConnection called");
GeckoApp.assertOnUiThread();
return super.onCreateInputConnection(outAttrs);
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
Log.d(LOGTAG, "IME: onKeyPreIme(keyCode=" + keyCode + ", event=" + event + ")");
GeckoApp.assertOnUiThread();
return super.onKeyPreIme(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.d(LOGTAG, "IME: onKeyDown(keyCode=" + keyCode + ", event=" + event + ")");
GeckoApp.assertOnUiThread();
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
Log.d(LOGTAG, "IME: onKeyUp(keyCode=" + keyCode + ", event=" + event + ")");
GeckoApp.assertOnUiThread();
return super.onKeyUp(keyCode, event);
}
@ -1366,18 +1427,21 @@ private static final class DebugGeckoInputConnection extends GeckoInputConnectio
public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
Log.d(LOGTAG, "IME: onKeyMultiple(keyCode=" + keyCode + ", repeatCount=" + repeatCount
+ ", event=" + event + ")");
GeckoApp.assertOnUiThread();
return super.onKeyMultiple(keyCode, repeatCount, event);
}
@Override
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
Log.d(LOGTAG, "IME: onKeyLongPress(keyCode=" + keyCode + ", event=" + event + ")");
GeckoApp.assertOnUiThread();
return super.onKeyLongPress(keyCode, event);
}
@Override
public void notifyIME(int type, int state) {
Log.d(LOGTAG, String.format("IME: >notifyIME(type=%d, state=%d)", type, state));
GeckoApp.assertOnGeckoThread();
super.notifyIME(type, state);
}
}

View File

@ -1,6 +1,6 @@
{
"talos.zip": {
"url": "http://build.mozilla.org/talos/zips/talos.aec9ddd2a04c.zip",
"url": "http://build.mozilla.org/talos/zips/talos.18ae2ce2749b.zip",
"path": ""
}
}

View File

@ -504,9 +504,14 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
// because the service self updates itself and the service
// installer will stop the service.
LOG(("Service command %ls complete.\n", argv[2]));
} else if (!lstrcmpi(argv[2], L"clear-prefetch")) {
}
// See Bug 770883
#if 0
else if (!lstrcmpi(argv[2], L"clear-prefetch")) {
result = ClearKnownPrefetch();
} else {
}
#endif
else {
LOG(("Service command not recognized: %ls.\n", argv[2]));
// result is already set to FALSE
}