Closed Bug 1582424 Opened 5 years ago Closed 5 years ago

remove grid usage from comm/chat/content/chat-tooltip.js

Categories

(Thunderbird :: Instant Messaging, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 71.0

People

(Reporter: khushil324, Assigned: khushil324)

References

Details

Attachments

(1 file, 3 obsolete files)

No description provided.
Assignee: nobody → khushil324
Attached patch Bug-1582424_remove-grid-chat-tooltip.patch (obsolete) (deleted) β€” β€” Splinter Review
Attachment #9094168 - Flags: review?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Comment on attachment 9094168 [details] [diff] [review]
Bug-1582424_remove-grid-chat-tooltip.patch

Review of attachment 9094168 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/content/chat-tooltip.js
@@ +289,5 @@
>          label.setAttribute("value", aLabel);
> +        let td1 = document.createElementNS(
> +          "http://www.w3.org/1999/xhtml",
> +          "td"
> +        );

looks like the first one should be <th>

But don't add a <label> under them, just add the content (createTextNode)
Attachment #9094168 - Flags: review?(mkmelin+mozilla)

Should we also remove the <description> tag?

Yeah please remove that too

Attached patch Bug-1582424_remove-grid-chat-tooltip.patch (obsolete) (deleted) β€” β€” Splinter Review
Attachment #9094168 - Attachment is obsolete: true
Attachment #9094213 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9094213 [details] [diff] [review]
Bug-1582424_remove-grid-chat-tooltip.patch

Review of attachment 9094213 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/content/chat-tooltip.js
@@ +287,5 @@
> +        let th = document.createElementNS("http://www.w3.org/1999/xhtml", "th");
> +        th.textContent = aLabel;
> +        row.appendChild(th);
> +        let td = document.createElementNS("http://www.w3.org/1999/xhtml", "td");
> +        description = td;

seems a bit unnecesary to have the let td here. 
Just do descriptition = document.createElementNS("http://www.w3.org/1999/xhtml")

@@ +297,5 @@
>        }
>        description.textContent = aValue;
>      }
>  
>      addSeparator() {

Didn't spot this earlier, but the addSeparator() should be redone, instead of adding an "empty" row.
Like in the other bug, add a class to style as needed.
Attachment #9094213 - Flags: review?(mkmelin+mozilla)
Attached patch Bug-1582424_remove-grid-chat-tooltip.patch (obsolete) (deleted) β€” β€” Splinter Review
Attachment #9094213 - Attachment is obsolete: true
Attachment #9094879 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9094879 [details] [diff] [review]
Bug-1582424_remove-grid-chat-tooltip.patch

Review of attachment 9094879 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me, r=mkmelin

::: chat/content/chat-tooltip.js
@@ +213,5 @@
>                  <description class="tooltipMessage"></description>
>                </stack>
>              </hbox>
> +            <table xmlns="http://www.w3.org/1999/xhtml" class="tooltipTable">
> +            </table>

maybe just
<html:table class="tooltipTable"></table>

Everything beneath it will be html sure, but since you're creating through script, it doesn't matter.
Attachment #9094879 - Flags: review?(mkmelin+mozilla) → review+
Attachment #9094879 - Attachment is obsolete: true
Attachment #9094892 - Flags: review+
Keywords: checkin-needed
Comment on attachment 9094892 [details] [diff] [review]
Bug-1582424_remove-grid-chat-tooltip.patch

Review of attachment 9094892 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/content/chat-tooltip.js
@@ +300,5 @@
>  
>      addSeparator() {
> +      if (this.table.hasChildNodes()) {
> +        let lastElement = this.table.lastChild;
> +        lastElement.querySelector("th").classList.add("chatTooltipSeparator");

Would it make sense to add this to the `tr` (which is likely `lastElement`), instead of the `th` and `td` separately?

(In reply to Patrick Cloke [:clokep] from comment #10)

Would it make sense to add this to the tr (which is likely lastElement),
instead of the th and td separately?

html:tr does not take border property i.e. we can not apply border style to tr directly.

(In reply to Khushil Mistry [:khushil324] from comment #11)

(In reply to Patrick Cloke [:clokep] from comment #10)

Would it make sense to add this to the tr (which is likely lastElement),
instead of the th and td separately?

html:tr does not take border property i.e. we can not apply border style to tr directly.

Makes sense! Thanks!

Please check the linting before submitting a patch. I've fixed it for you here.

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/398e5adc18c3
remove grid usage from chat-tooltip.js. r=mkmelin

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

Attachment

General

Created:
Updated:
Size: