зеркало из https://github.com/mozilla/gecko-dev.git
Bug 629200 part 16 - Add mutation event tests for strings and classes and tidy up use of DidChangeString; r=jwatt
This commit is contained in:
Родитель
1fc48bd472
Коммит
05b3affab8
|
@ -806,7 +806,6 @@ nsSVGElement::UnsetAttrInternal(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||
if (aNamespaceID == stringInfo.mStringInfo[i].mNamespaceID &&
|
||||
aName == *stringInfo.mStringInfo[i].mName) {
|
||||
stringInfo.Reset(i);
|
||||
DidChangeString(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ public:
|
|||
virtual void DidChangePointList(bool aDoSetAttr);
|
||||
virtual void DidChangePathSegList(bool aDoSetAttr);
|
||||
virtual void DidChangeTransformList(bool aDoSetAttr);
|
||||
virtual void DidChangeString(PRUint8 aAttrEnum) {}
|
||||
void DidChangeString(PRUint8 aAttrEnum) {}
|
||||
void DidChangeStringList(bool aIsConditionalProcessingAttribute,
|
||||
PRUint8 aAttrEnum);
|
||||
|
||||
|
|
|
@ -38,8 +38,11 @@ function runTests()
|
|||
is(filter.className.animVal, "bar", "className animVal");
|
||||
filter.removeAttribute("class");
|
||||
is(filter.hasAttribute("class"), false, "class attribute");
|
||||
ok(filter.getAttribute("class") === null, "removed class attribute");
|
||||
is(filter.className.baseVal, "", "className baseVal");
|
||||
is(filter.className.animVal, "", "className animVal");
|
||||
filter.setAttribute("class", "");
|
||||
ok(filter.getAttribute("class") === "", "empty class attribute");
|
||||
|
||||
// length attribute
|
||||
|
||||
|
@ -204,6 +207,10 @@ function runTests()
|
|||
convolve.result.baseVal = "bar";
|
||||
is(convolve.result.animVal, "bar", "string animVal");
|
||||
is(convolve.getAttribute("result"), "bar", "string attribute");
|
||||
convolve.setAttribute("result", "");
|
||||
ok(convolve.getAttribute("result") === "", "empty string attribute");
|
||||
convolve.removeAttribute("result");
|
||||
ok(convolve.getAttribute("result") === null, "removed string attribute");
|
||||
|
||||
// preserveAspectRatio attribute
|
||||
|
||||
|
|
|
@ -31,6 +31,19 @@ function runTests()
|
|||
var marker = doc.getElementById("marker");
|
||||
var eventChecker = new MutationEventChecker;
|
||||
|
||||
// class attribute
|
||||
|
||||
eventChecker.watchAttr(filter, "class");
|
||||
eventChecker.expect("add modify remove add");
|
||||
filter.setAttribute("class", "foo");
|
||||
filter.className.baseVal = "bar";
|
||||
filter.removeAttribute("class");
|
||||
filter.className.baseVal = "foo";
|
||||
|
||||
eventChecker.expect("");
|
||||
filter.className.baseVal = "foo";
|
||||
filter.setAttribute("class", "foo");
|
||||
|
||||
// length attribute
|
||||
|
||||
eventChecker.watchAttr(marker, "markerWidth");
|
||||
|
@ -174,6 +187,20 @@ function runTests()
|
|||
convolve.setAttribute("edgeMode", "none");
|
||||
convolve.edgeMode.baseVal = SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE;
|
||||
|
||||
// string attribute
|
||||
|
||||
eventChecker.watchAttr(convolve, "result");
|
||||
eventChecker.expect("add modify remove add");
|
||||
convolve.setAttribute("result", "bar");
|
||||
convolve.result.baseVal = "foo";
|
||||
convolve.removeAttribute("result");
|
||||
convolve.result.baseVal = "bar";
|
||||
|
||||
eventChecker.expect("");
|
||||
convolve.result.baseVal = "bar";
|
||||
convolve.setAttribute("result", "bar");
|
||||
convolve.result.baseVal = "bar";
|
||||
|
||||
eventChecker.finish();
|
||||
|
||||
SimpleTest.finish();
|
||||
|
|
Загрузка…
Ссылка в новой задаче