Closed Bug 327234 Opened 18 years ago Closed 18 years ago

Expose abstract interface for input[type="gMonth"] and input[type="gDay"]

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: fixed1.8.0.4, fixed1.8.1)

Attachments

(3 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20051212 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20051212 Firefox/1.6a1

Patch is comming up.

Reproducible: Always
Blocks: 327236
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: aaronr → surkov
Attached file test case
Attached patch patch (obsolete) — Splinter Review
was exposed interface for inputs type="gMonth" and type "gDay", also all input controls was moved into separate file. The cause is too big files.
Attachment #211969 - Flags: review?(allan)
Attachment #211969 - Flags: review?(smaug)
Status: NEW → ASSIGNED
Attached patch split out patchSplinter Review
Attachment #211969 - Attachment is obsolete: true
Attachment #212099 - Flags: review?(allan)
Attachment #211969 - Flags: review?(smaug)
Attachment #211969 - Flags: review?(allan)
(In reply to comment #3)
> Created an attachment (id=212099) [edit]
> split out patch

I asked surkov to do the "split" in a seperate patch, as it makes checking the changes a lot easier.
Comment on attachment 212099 [details] [diff] [review]
split out patch

r=me
Attachment #212099 - Flags: review?(allan) → review+
Attachment #212099 - Flags: review?(smaug)
Comment on attachment 212099 [details] [diff] [review]
split out patch


>+<bindings id="xformsBindings"

Not all our bindings files should have the same id for their root element ;)
I think there is same problem also with select.xml

>+          xmlns="http://www.mozilla.org/xbl"
>+          xmlns:html="http://www.w3.org/1999/xhtml"
>+          xmlns:xbl="http://www.mozilla.org/xbl"
>+          xmlns:xforms="http://www.w3.org/2002/xforms"
>+          xmlns:lazy="http://www.mozilla.org/projects/xforms/2005/lazy">

I think xmlns:lazy is not needed here.
Attachment #212099 - Flags: review?(smaug) → review+
(In reply to comment #6)

> Not all our bindings files should have the same id for their root element ;)
> I think there is same problem also with select.xml

Ok, I'll check namespaces and remove unused of them in second patch :)
Why input month and day doesn't handle focus and blur and doesn't fire DOMFocusIn and DOMFocusOut events like it do other input controls? For what is DOMFocusIn and DOMFocusOut events firing needed at all?
(In reply to comment #7)
> (In reply to comment #6)
> 
> > Not all our bindings files should have the same id for their root element ;)
> > I think there is same problem also with select.xml
> 
> Ok, I'll check namespaces and remove unused of them in second patch :)

Agreed, just remember it in second patch.

Checked attachment 212099 [details] [diff] [review] in to trunk.
Attached patch main patch (obsolete) — Splinter Review
Attachment #212203 - Flags: review?(allan)
Attachment #212203 - Flags: review?(doronr)
(In reply to comment #8)
> Why input month and day doesn't handle focus and blur and doesn't fire
> DOMFocusIn and DOMFocusOut events like it do other input controls?

Well, they should.

> For what is DOMFocusIn and DOMFocusOut events firing needed at all?

http://www.w3.org/TR/2005/PER-xforms-20051006/index-all.html#evt-DOMFocusIn
Comment on attachment 212203 [details] [diff] [review]
main patch

>+            XHTML_NS: 'http://www.w3.org/1999/xhtml',
>+
>+            set readonly(val) {
>+              this.disabled = val;
>+            },
>+            appendMonth: function(name, value) {
>+              var option = this.ownerDocument.
>+                createElementNS(this.XHTML_NS, 'option');
>+              option.textContent = name;
>+              option.setAttribute('value', value);
>+              this.appendChild(option);
>+            }
>+          };

Why not just use the XHTML_NS string directly, creating a property for one usage is silly.

>+
>+
>+  <!-- INPUT: DAY -->

Why two spaces?

>+            XHTML_NS: 'http://www.w3.org/1999/xhtml',
>+
>+            set readonly(val) {
>+              this.disabled = val;
>+            },
>+            appendDay: function(name, value) {
>+              var option = this.ownerDocument.
>+                createElementNS(this.XHTML_NS, 'option');
>+              option.textContent = name;
>+              option.setAttribute('value', value);
>+              this.appendChild(option);
>+            }

ditto for the xhtml ns

>+
>+
>   <!-- SECRET: <DEFAULT> -->

2 newlines again

>@@ -729,194 +727,139 @@
>     </handlers>
>   </binding>
> 
>+
>   <!-- INPUT: Month
and again

> 
>-      <method name="_change">
>+      <method name="updateInstanceData">
>+        <parameter name="incremental"/>

please call it aIncremental, so we know that it is an argument

>   </binding>
> 
>+

2 newlines

rest looks good
Attachment #212203 - Flags: review?(doronr) → review+
(In reply to comment #12)

> Why not just use the XHTML_NS string directly, creating a property for one
> usage is silly.

The object is created one time but method appendMonth() is used many times. I just thought why should we create xmlns string every time when method is called?


> Why two spaces?
> 2 newlines again

I belive if two lines is presented between two binding then I can easier locate needing binding. One line used as separator inside of binding. Two lines are used between bindings. Btw xforms.xml contains two lines between bindings.

> please call it aIncremental, so we know that it is an argument

For sure, I didn't notice that.

If you don't agree with me about xmlns string and two lines then please let me know and I'll fix it.
Comment on attachment 212203 [details] [diff] [review]
main patch

> +++ mozilla/extensions/xforms/resources/content/input-xhtml.xml	2006-02-17 18:53:06.000000000 +0800
>  <bindings id="xformsBindings"

Didn't you promise to change the id? :)

> +  <!-- INPUT: DAY -->

> +      <method name="getControlElement">
> +        <body>
> +          return {
> +            __proto__: this.ownerDocument.
> +              getAnonymousElementByAttribute(this, 'anonid', 'control'),
> +
> +            XHTML_NS: 'http://www.w3.org/1999/xhtml',
> +
> +            set readonly(val) {
> +              this.disabled = val;
> +            },
> +            appendDay: function(name, value) {
> +              var option = this.ownerDocument.
> +                createElementNS(this.XHTML_NS, 'option');
> +              option.textContent = name;
> +              option.setAttribute('value', value);
> +              this.appendChild(option);
> +            }
> +          };
> +        </body>
> +      </method>
> +
> +      <property name="XHTML_NS" readonly="true"
> +                onget="return 'http://www.w3.org/1999/xhtml';"/>

What's up with the two XHTML_NS definitions?
Attachment #212203 - Attachment is obsolete: true
Attachment #212696 - Flags: review?(allan)
Attachment #212203 - Flags: review?(allan)
Attachment #212696 - Flags: review?(allan) → review+
Checked in to trunk
Whiteboard: xf-to-branch
Blocks: 326556
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Blocks: 332853
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: