Closed Bug 1512942 Opened 6 years ago Closed 6 years ago

[de-xbl] Convert timepicker-minute to custom element.

Categories

(Calendar :: Lightning Only, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: arshad, Assigned: arshad)

References

Details

Attachments

(1 file, 6 obsolete files)

No description provided.
Assignee: nobody → arshdkhn1
Status: NEW → ASSIGNED
Blocks: 1512941
Blocks: tb-war-on-xbl
No longer blocks: 1512941
Blocks: 1512941
Attached patch timepicker-minute.patch (obsolete) β€” β€” Splinter Review
Attachment #9030416 - Flags: feedback?(mkmelin+mozilla)
Comment on attachment 9030416 [details] [diff] [review] timepicker-minute.patch Review of attachment 9030416 [details] [diff] [review]: ----------------------------------------------------------------- ::: common/bindings/datetimepicker.js @@ +83,5 @@ > + return; > + } > + > + if (this.hasAttribute("label")) { > + this.label.setAttribute("value", this.getAttribute("label")); should handle label removal too ::: mail/base/content/customElements.js @@ +10,5 @@ > "chrome://messenger/content/mailWidgets.js", > "chrome://messenger/content/generalBindings.js", > "chrome://messenger/content/statuspanel.js", > "chrome://messenger/content/foldersummary.js", > + "chrome://messenger/content/datetimepicker.js", -> lightning ::: mail/base/jar.mn @@ +38,5 @@ > * content/messenger/viewSource.xul (../../common/src/viewSource.xul) > * content/messenger/datetimepicker.xml (../../common/bindings/datetimepicker.xml) > content/messenger/generalBindings.xml (../../common/bindings/generalBindings.xml) > content/messenger/generalBindings.js (../../common/bindings/generalBindings.js) > + content/messenger/datetimepicker.js (../../common/bindings/datetimepicker.js) -> lightning
Attachment #9030416 - Flags: feedback?(mkmelin+mozilla) → feedback-
(In reply to Magnus Melin [:mkmelin] from comment #2) > Comment on attachment 9030416 [details] [diff] [review] > timepicker-minute.patch > > Review of attachment 9030416 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: common/bindings/datetimepicker.js > @@ +83,5 @@ > > + return; > > + } > > + > > + if (this.hasAttribute("label")) { > > + this.label.setAttribute("value", this.getAttribute("label")); > > should handle label removal too > I know we have done this earlier, but recently I was workin on a bug where I landed it some problems when I removed the attr on inheriting elment when parent element's attr was removed.
That's something to watch out for. Dunno if it happens in reality for this case, but if someone does remove the label you'd have unexpected behaviour unless you handle it.
> > ::: mail/base/jar.mn > @@ +38,5 @@ > > * content/messenger/viewSource.xul (../../common/src/viewSource.xul) > > * content/messenger/datetimepicker.xml (../../common/bindings/datetimepicker.xml) > > content/messenger/generalBindings.xml (../../common/bindings/generalBindings.xml) > > content/messenger/generalBindings.js (../../common/bindings/generalBindings.js) > > + content/messenger/datetimepicker.js (../../common/bindings/datetimepicker.js) > > why is this in common/bindings, if they were lightning specific only.
It's not, that's from one of your other unlanded patches.
Attached patch timepicker-minute.patch (obsolete) β€” β€” Splinter Review
Attachment #9030416 - Attachment is obsolete: true
Attached patch timepicker-minute.patch (obsolete) β€” β€” Splinter Review
Attachment #9030697 - Attachment is obsolete: true
Comment on attachment 9030699 [details] [diff] [review] timepicker-minute.patch Review of attachment 9030699 [details] [diff] [review]: ----------------------------------------------------------------- ::: calendar/base/content/dialogs/calendar-event-dialog-attendees.xul @@ +29,5 @@ > style="padding-top: 8px; padding-bottom: 10px; padding-inline-start: 8px; padding-inline-end: 10px;" > xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> > > <!-- Javascript includes --> > + <script type="application/javascript" Adding script in files where datetimepicker is used because datetimepicker has timepicker as anon content, which has timpicker-grids inside it.. https://searchfox.org/comm-central/search?q=datetimepicker&case=false&regexp=false&path=calendar
Attachment #9030699 - Flags: feedback?(mkmelin+mozilla)
Comment on attachment 9030699 [details] [diff] [review] timepicker-minute.patch Review of attachment 9030699 [details] [diff] [review]: ----------------------------------------------------------------- Doesn't seem to work. Clicking a minute I get JavaScript error: chrome://calendar/content/datetimepickers/datetimepickers.js, line 62: ReferenceError: clickMinute is not defined ::: calendar/resources/content/datetimepickers/datetimepickers.js @@ +5,5 @@ > +"use strict"; > + > +// This is loaded into all XUL windows. Wrap in a block to prevent > +// leaking to window scope. > +{ I think you should skip the indent for this though It's also questionable if we really care. It's not all XUL windows, it's just the ones we use it in.
Attachment #9030699 - Flags: feedback?(mkmelin+mozilla) → feedback-

See Bug 1512941 for the timepicker-minute patch changes.

Attached patch timepicker-minute.patch (obsolete) β€” β€” Splinter Review
Attachment #9030699 - Attachment is obsolete: true
Attachment #9047947 - Flags: review+
Comment on attachment 9047947 [details] [diff] [review] timepicker-minute.patch Review of attachment 9047947 [details] [diff] [review]: ----------------------------------------------------------------- (no reviewed yet!) ::: calendar/resources/content/datetimepickers/datetimepickers.js @@ +71,5 @@ > + this.appendChild(spacer.cloneNode()); > + this.appendChild(minutebox); > + this.appendChild(spacer); > + > + this.pixelScrollDelta = 0; why does all this dom building happen in connecedCallback() and not the constructor?
Attachment #9047947 - Flags: review+

(In reply to Magnus Melin [:mkmelin] from comment #14)

Comment on attachment 9047947 [details] [diff] [review]
timepicker-minute.patch

Review of attachment 9047947 [details] [diff] [review]:

(no reviewed yet!)

::: calendar/resources/content/datetimepickers/datetimepickers.js
@@ +71,5 @@

  •        this.appendChild(spacer.cloneNode());
    
  •        this.appendChild(minutebox);
    
  •        this.appendChild(spacer);
    
  •        this.pixelScrollDelta = 0;
    

why does all this dom building happen in connecedCallback() and not the
constructor?

if it is not shadow dom then dom should be build in connectedCallback. It will throw NSERrror if you append child in constructor and try to extend it by some other ce. We experienced this in one of the very first ce conversion.

Comment on attachment 9047947 [details] [diff] [review]
timepicker-minute.patch

Review of attachment 9047947 [details] [diff] [review]:

(no reviewed yet!)

::: calendar/resources/content/datetimepickers/datetimepickers.js
@@ +71,5 @@

  •        this.appendChild(spacer.cloneNode());
    
  •        this.appendChild(minutebox);
    
  •        this.appendChild(spacer);
    
  •        this.pixelScrollDelta = 0;
    

Fallen reviewed it in https://bugzilla.mozilla.org/show_bug.cgi?id=1512941#c24(In reply to Magnus Melin [:mkmelin] from comment #14)

You really need to put that kind of information into this bug when marking a patch r+

I'm not convinced you should build in connectedCallback. That can run more than once.

(In reply to Magnus Melin [:mkmelin] from comment #17)

You really need to put that kind of information into this bug when marking a patch r+

Yes you are right, I should have put it here also. I forgot about it after conveying it to you on IRC.

I'm not convinced you should build in connectedCallback. That can run more than once.
when you clone node, or move nodes..

Attached patch timepicker-minute.patch (obsolete) β€” β€” Splinter Review

is it ok now?

Attachment #9047947 - Attachment is obsolete: true
Attachment #9047958 - Flags: review+
Attachment #9047958 - Flags: feedback?(mkmelin+mozilla)
Attached patch timepicker-minute.patch (obsolete) β€” β€” Splinter Review
Attachment #9047958 - Attachment is obsolete: true
Attachment #9047958 - Flags: feedback?(mkmelin+mozilla)
Attachment #9047989 - Flags: review+
Attachment #9047989 - Flags: feedback?(mkmelin+mozilla)
Comment on attachment 9047989 [details] [diff] [review] timepicker-minute.patch Review of attachment 9047989 [details] [diff] [review]: ----------------------------------------------------------------- ::: calendar/resources/content/datetimepickers/datetimepickers.js @@ +602,5 @@ > if ((preString && this.amRegExp.test(preString)) || > (postString && this.amRegExp.test(postString))) { > ampmCode = "AM"; > } else if ((preString && this.pmRegExp.test(preString)) || > + (postString && this.pmRegExp.test(postString))) { strange intention change here @@ +761,5 @@ > this.ampmIndex = POST_INDEX; > } > } > if (this.ampmIndex) { > + let makeFormatRegExp = function (string) { no space after function (leave this line as it was)
Attachment #9047989 - Flags: feedback?(mkmelin+mozilla) → feedback+
Attached patch timepicker-minute.patch β€” β€” Splinter Review
Attachment #9047989 - Attachment is obsolete: true
Attachment #9048056 - Flags: review+
Attachment #9048056 - Flags: feedback+
Keywords: checkin-needed

Just a note that bugzilla autolinks bug comments when you write something like bug 1512942 comment 22

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/9385db6fc2ae
Convert timepicker-minute binding to custom element. r=philipp

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 6.9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: