Last Comment Bug 332945 - expose base interface binding for xhtml/xul calendars
: expose base interface binding for xhtml/xul calendars
Status: RESOLVED FIXED
: fixed1.8.0.5, fixed1.8.1
Product: Core
Classification: Components
Component: XForms (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: alexander :surkov
: Stephen Pride
Mentors:
Depends on:
Blocks: 327236 330641
  Show dependency treegraph
 
Reported: 2006-04-05 22:28 PDT by alexander :surkov
Modified: 2006-06-06 07:03 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (17.59 KB, patch)
2006-04-05 23:19 PDT, alexander :surkov
doronr: review+
Details | Diff | Review
patch2 (20.53 KB, patch)
2006-05-11 21:20 PDT, alexander :surkov
allan: review+
Details | Diff | Review
for checkin (20.51 KB, patch)
2006-05-15 19:01 PDT, alexander :surkov
no flags Details | Diff | Review

Description alexander :surkov 2006-04-05 22:28:16 PDT
 
Comment 1 alexander :surkov 2006-04-05 23:19:25 PDT
Created attachment 217384 [details] [diff] [review]
patch
Comment 2 alexander :surkov 2006-05-11 20:32:10 PDT
A small note about what patch does. XUL and XHTML calendar can have a common base. Acutally the patch does it :). I move out some functionality from "calendar-compact" binding to new binding "calendar-compact-base".
Comment 3 Doron Rosenberg (IBM) 2006-05-11 21:05:11 PDT
Comment on attachment 217384 [details] [diff] [review]
patch

>diff -uNrap mozilla.orig/extensions/xforms/resources/content/widgets-xhtml.xml mozilla/extensions/xforms/resources/content/widgets-xhtml.xml
>--- mozilla.orig/extensions/xforms/resources/content/widgets-xhtml.xml	2006-04-05 12:32:25.000000000 +0900
>+++ mozilla/extensions/xforms/resources/content/widgets-xhtml.xml	2006-04-06 15:11:08.000000000 +0900
>@@ -41,18 +41,23 @@
>   %xformsDTD;
> ]>
> 
>+<!--
>+  The file contains auxiliary controls implementations for XHTML context. The
>+  controls are inherited from bindings defined in 'widgets.xml' file.
>+-->
> 
> <bindings id="widgetsBindingsForXHTML"
>           xmlns="http://www.mozilla.org/xbl"
>           xmlns:html="http://www.w3.org/1999/xhtml"
>-          xmlns:xbl="http://www.mozilla.org/xbl">
>+          xmlns:xbl="http://www.mozilla.org/xbl"
>+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

If this is the xhtml impl, why the xul namespace?

>+          switch (aActionType) {
>+          case "prevMonth":
>+            this.setDate(this.year, this.month - 1, aDay);
>+            break;
>+
>+          case "nextMonth":
>+            this.setDate(this.year, this.month + 1, aDay);
>+            break;
>+
>+          case "currentMonth":
>+            if (!this.readonly) {
>+              this.selectedDate = new Date(this.year, this.month - 1, aDay);
>+              this.fireChangeEvent();
>+            } else {
>+              this.currentDayIndex = this.dayOffset + aDay - 1;
>+            }
>+            break;
>+          }

I prefer case statements indented, but that might just be me.
Comment 4 alexander :surkov 2006-05-11 21:20:03 PDT
Created attachment 221780 [details] [diff] [review]
patch2

(In reply to comment #3)

> If this is the xhtml impl, why the xul namespace?

Fixed.

> I prefer case statements indented, but that might just be me.
> 

Fixed.
Comment 5 Allan Beaufour 2006-05-15 07:20:14 PDT
Comment on attachment 221780 [details] [diff] [review]
patch2

> +  <!-- COMPACT CALENDAR BASE
> +    The widget is interface binding for xhtml and xul calendars widgets.

This widget is the interface binding ...

> +    It supposes successor widgets have following interface:

It assumes that successor widgets have ...

> +      <method name="setSelectedDayByIndex">
> +        <parameter name="aSelectedIndex"/>
> +        <parameter name="aCurrentIndex"/>
> +        <body>
> +        <![CDATA[
> +          if (!aCurrentIndex)
> +            aCurrentIndex = aSelectedIndex;
> +
> +          if (this._selectedDayIndex != -1) {
> +            this.unselectDayControl(this._dayElements[this._selectedDayIndex]);
> +          }
> +
> +          if (this.isSelectedDate()) {
> +            var dayElm = null;

You are not using this.

+            this.selectDayControl(this._dayElements[aSelectedIndex]);
+            this._selectedDayIndex = aSelectedIndex;
+          } else {
+            this._selectedDayIndex = -1;
+          }
+
+          this.currentDayIndex = aCurrentIndex;
+        ]]>
+        </body>
+      </method>

With that, r=me
Comment 6 alexander :surkov 2006-05-15 19:01:59 PDT
Created attachment 222135 [details] [diff] [review]
for checkin
Comment 7 Allan Beaufour 2006-05-16 01:16:26 PDT
Fixed on trunk

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