Last Comment Bug 668826 - Make reflectString able to test reflections with different IDL attribute and content attribute names
: Make reflectString able to test reflections with different IDL attribute and ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla8
Assigned To: Mounir Lamouri (:mounir)
:
:
Mentors:
Depends on: 668820
Blocks: 586786
  Show dependency treegraph
 
Reported: 2011-07-01 08:41 PDT by Mounir Lamouri (:mounir)
Modified: 2011-07-06 10:01 PDT (History)
1 user (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (6.46 KB, patch)
2011-07-05 16:13 PDT, Mounir Lamouri (:mounir)
Ms2ger: review+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2011-07-01 08:41:10 PDT
With bug 668820, I think we could allow things like this:
reflectString({
  element: myElement,
  attribute: "myAttribute",
});
and:
reflectString({
  element: myElement,
  attribute: { idl: "myIDL", content: "myContent", },
});

That would require to check the type of the 'attribute' attribute on the methods. Would you approve such a solution Ms2ger?
Comment 1 Mounir Lamouri (:mounir) 2011-07-05 16:13:29 PDT
Created attachment 544093 [details] [diff] [review]
Patch v1

Only doing that for reflectString for the moment. Should be easy to do the same thing for other methods if needed.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2011-07-06 04:57:46 PDT
Comment on attachment 544093 [details] [diff] [review]
Patch v1

>--- a/content/html/content/test/reflect.js
>+++ b/content/html/content/test/reflect.js
> function reflectString(aParameters)
> {
>   var element = aParameters.element;
>-  var attr = aParameters.attribute;
>+  var contentAttr = typeof aParameters.attribute == "string"
>+                      ? aParameters.attribute : aParameters.attribute.content;
>+  var idlAttr = typeof aParameters.attribute == "string"
>+                  ? aParameters.attribute : aParameters.attribute.idl;

===, to match the !== below.

Looks good. r=me
Comment 3 Mounir Lamouri (:mounir) 2011-07-06 06:05:57 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/f9f7e6821ba6

Note You need to log in before you can comment on or make changes to this bug.