Back out da3319e4987c (bug 704482) because of test_smilAccessKey.xhtml failure

This commit is contained in:
Matt Brubeck 2011-11-23 19:02:43 -08:00
parent b888ed8aeb
commit 22477b5b6b
3 changed files with 10 additions and 20 deletions

View File

@ -100,9 +100,6 @@ nsresult
nsSMILTimeValueSpec::SetSpec(const nsAString& aStringSpec,
Element* aContextNode)
{
NS_ABORT_IF_FALSE(aContextNode,
"null context node; can't determine if script is enabled");
nsSMILTimeValueSpecParams params;
nsresult rv =
nsSMILParserUtils::ParseTimeValueSpecParams(aStringSpec, params);
@ -110,28 +107,24 @@ nsSMILTimeValueSpec::SetSpec(const nsAString& aStringSpec,
if (NS_FAILED(rv))
return rv;
mParams = params;
// According to SMIL 3.0:
// The special value "indefinite" does not yield an instance time in the
// begin list. It will, however yield a single instance with the value
// "indefinite" in an end list. This value is not removed by a reset.
if (params.mType == nsSMILTimeValueSpecParams::OFFSET ||
(!mIsBegin && params.mType == nsSMILTimeValueSpecParams::INDEFINITE)) {
mOwner->AddInstanceTime(new nsSMILInstanceTime(params.mOffset), mIsBegin);
if (mParams.mType == nsSMILTimeValueSpecParams::OFFSET ||
(!mIsBegin && mParams.mType == nsSMILTimeValueSpecParams::INDEFINITE)) {
mOwner->AddInstanceTime(new nsSMILInstanceTime(mParams.mOffset), mIsBegin);
}
// Fill in the event symbol to simplify handling later
if (params.mType == nsSMILTimeValueSpecParams::REPEAT) {
params.mEventSymbol = nsGkAtoms::repeatEvent;
} else if (params.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
// Reject accessKey if scripts are disabled.
if (!aContextNode->GetOwnerDocument()->IsScriptEnabled()) {
return NS_ERROR_FAILURE;
}
params.mEventSymbol = nsGkAtoms::keypress;
if (mParams.mType == nsSMILTimeValueSpecParams::REPEAT) {
mParams.mEventSymbol = nsGkAtoms::repeatEvent;
} else if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
mParams.mEventSymbol = nsGkAtoms::keypress;
}
mParams = params;
ResolveReferences(aContextNode);
return rv;

View File

@ -803,7 +803,6 @@ nsSMILTimedElement::SetAttr(nsIAtom* aAttribute, const nsAString& aValue,
Element* aContextNode,
nsresult* aParseResult)
{
NS_ABORT_IF_FALSE(aContextNode, "missing context node");
bool foundMatch = true;
nsresult parseResult = NS_OK;

View File

@ -263,9 +263,7 @@ public:
* @param aResult The nsAttrValue object that may be used for storing the
* parsed result.
* @param aContextNode The element to use for context when resolving
* references to other elements, and for determining
* whether scripting is enabled (and hence whether
* we should allow "accessKey" time specifications).
* references to other elements.
* @param[out] aParseResult The result of parsing the attribute. Will be set
* to NS_OK if parsing is successful.
*