Closed Bug 380289 Opened 17 years ago Closed 16 years ago

Warning: Error in parsing value for property 'max-height' (day/week view)

Categories

(Calendar :: Calendar Frontend, defect)

Sunbird 0.5
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kelv, Assigned: mozilla)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Build Identifier: Thunderbird version 2.0.0.0 (20070326) + Lightning nightly build for 10th May 2007

When switching from month view to week view either via the Calendar menu or a Toolbar shortcut, an error is produces in the error log.

Reproducible: Always

Steps to Reproduce:
1. Start Thunderbird.
2. Switch from Month view to Calendar view.

Actual Results:  
Warning: Error in parsing value for property 'max-height'.  Declaration dropped.
Source File: chrome://messenger/content/messenger.xul
Line: 0

Expected Results:  
No error report.
On further inspection the error occurs however week view is accessed.
According to the message you posted in Comment #0 this is just a warning.
Summary: Error log report when switching from month to week view → Warning logged when switching from month to week view
I don't see any error in console using the same thunderbird and lightning (in new profile)--->WFM
Bug: following warning appears in error console

  Warning: Error in parsing value for property 'max-height'.  Declaration dropped.
  Source File: chrome://calendar/content/calendar.xul
  Line: 0

Problem occurs for short events, esp. when window is also short.

1. create an event with end time is same as start time (0 duration).
   (also happens for longer events if window is short enough, but
   happens for 0-length events regardless of window size)
2. Navigate away and back to day or week view of day with this event.

Actual: For every short event in view, Error console shows
  Warning: Error in parsing value for property 'max-height'.  Declaration dropped.
  Source File: chrome://calendar/content/calendar.xul
  Line: 0

Expected:
  No warnings.
Severity: normal → trivial
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Warning logged when switching from month to week view → Error in parsing value for property 'max-height' (day/week view)
Version: unspecified → Sunbird 0.5
Tracked problem down to 
  calendar-multiday-view.xml#calendar-event-box.setEditableLabel

The computed max-height value becomes negative.

The max-height code looks like it might be left over from a draft when the
title <xul:description> was between the <calendar-event-gripbar>s in
a <xul:vbox>, but now the title <xul:description> is in a different
layer of a <xul:stack>, so it looks like it is no longer needed.
http://mxr.mozilla.org/mozilla/source/calendar/base/content/calendar-multiday-view.xml#1565
http://mxr.mozilla.org/mozilla/source/calendar/base/content/calendar-multiday-view.xml#1704

It was checked-in for bug 368982.  
Bug 368982 comment 38 seems to says it makes the bottom grippy 
stay visible in short events, but after trying it with and without
the code for max-height, I haven't been able to create an event
where it makes a difference.  Since they are in different
layers of the stack, I don't see how it would work.

CC'ing michael.buettner@sun.com: is there an event box where the max-height code is needed?

If the code is no longer needed, this first patch below fixes the
problem by removing this code.

diff -r mozilla/calendar/base/content/calendar-multiday-view.xml
--- a/mozilla/calendar/base/content/calendar-multiday-view.xml	
+++ b/mozilla/calendar/base/content/calendar-multiday-view.xml	
@@ -1712,7 +1712,3 @@
	   } else {
	     evl.textContent = calGetString("calendar", "eventUntitled");
	   }
- 
-          var gripbar = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1").boxObject.height;
-          var height = document.getAnonymousElementByAttribute(this, "anonid", "eventbox").boxObject.height;
-          evl.setAttribute("style", "max-height: " + (height-gripbar*2) + "px");
         ]]></body>
       </method>
     </implementation>

If I'm wrong and the code is still needed, then this second patch
fixes the problem by constraining the max-height value to be
non-negative.

diff -r mozilla/calendar/base/content/calendar-multiday-view.xml
--- a/mozilla/calendar/base/content/calendar-multiday-view.xml	
+++ b/mozilla/calendar/base/content/calendar-multiday-view.xml	
@@ -1712,7 +1712,7 @@
 
           var gripbar = document.getAnonymousElementByAttribute(this, "anonid", "gripbar1").boxObject.height;
           var height = document.getAnonymousElementByAttribute(this, "anonid", "eventbox").boxObject.height;
-          evl.setAttribute("style", "max-height: " + (height-gripbar*2) + "px");
+          evl.setAttribute("style", "max-height: " + Math.max(0, height-gripbar*2) + "px");
         ]]></body>
       </method>
     </implementation>

I hope this helps.
Summary: Error in parsing value for property 'max-height' (day/week view) → Warning: Error in parsing value for property 'max-height' (day/week view)
I see the warning in the error console simply by creating a new event.  Steps:

1) In Month view, double click on today's box.
2) Click "Save & Close".

The warning repeats for the total number of events in the day.

(Lightning 2008-02-07 / Thunderbird 2.0.0.9)
Actually, those steps are incomplete.  To reproduce it in Month View:

1) Restart Thunderbird
2) Open and clear the error console
3) Switch to Calendar mode
4) Switch to Week view
5) Switch to Month view
6) Switch to Mail mode
7) Switch to Calendar mode
8) Double click on today's box.
9) Click "Save & Close".
TB 2.0.0.14 / LT0.9pre (2008053119): this still happens
This is now caused by the thunderbirthday addon BTW which apparantly does something weird with durations. Nevertheless it's confirmed in scenarios without this addon too.
Bas, could you eloborate on the weird behaviour of ThunderBirthDay? I thought that my addon is using them as intended and I'd like to fix it, if it doesn't. The error doesn't happen on my machine, so I have no idea where to start...
Has anyone seen the warning in a recent nightly build at all? For me this can be resolved as WORKSFORME. Maybe this is one of the issues that were actually fixed and not regressed by Bug 387402.
Please ignore my last comment. I'm still seeing this warning using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.2pre) Gecko/2008072419 Calendar/0.6a1.
This also appears on OS/2 and Linux.

As I remarked in bug 464896 the warning (in Sunbird) only appears for rotated views, once per event that gets displayed.

I wonder why comment 5 was never followed up. It still seems to be relevant.
OS: Windows XP → All
Hardware: PC → All
Attached patch fix as per comment 5 — — Splinter Review
OK, I confirmed that this fixes the warnings for me (in Sunbird 0.9). Patch against current comm-central.

I am not really up to date on who does reviews for Sunbird and http://www.mozilla.org/owners.html#calendar somehow feels outdated but Matt was involved with the original code-line.
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Attachment #348179 - Flags: review?
Attachment #348179 - Flags: review? → review?(lilmatt)
Comment on attachment 348179 [details] [diff] [review]
fix as per comment 5

Aha, use correct account address, the one from the owners pages doesn't exist any more...
Attachment #348179 - Flags: review?(lilmatt) → review?(Berend.Cornelius)
Comment on attachment 348179 [details] [diff] [review]
fix as per comment 5

Seems to fix the issue; r=berend
Attachment #348179 - Flags: review?(Berend.Cornelius) → review+
Great, thanks. Pushed: http://hg.mozilla.org/comm-central/rev/f8cafabd5a83
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: