<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>12687</bug_id>
          
          <creation_ts>2007-02-07 16:52:13 -0800</creation_ts>
          <short_desc>REGRESSION: Google Calendar cell highlight misplaced</short_desc>
          <delta_ts>2007-02-11 16:31:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.google.com/calendar/render?pli=1</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>GoogleBug, NeedsReduction, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antti Koivisto">koivisto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abob</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>24962</commentid>
    <comment_count>0</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-07 16:52:13 -0800</bug_when>
    <thetext>1. login to Google Calendar
2. click somewhere on main calendar area to select a time

The grey transparent highlight is drawn shifted several pixels right/down from cell area where it should be. Works fine in shipping Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25024</commentid>
    <comment_count>1</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-02-07 22:27:37 -0800</bug_when>
    <thetext>Could be a result of changing offsetTop/offsetLeft behavior to match Firefox recently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25038</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-02-07 23:49:49 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Could be a result of changing offsetTop/offsetLeft behavior to match Firefox
&gt; recently.
&gt; 

Wrong. Based on nightly builds, the regression happened sometime between 2005-12-01 and 2005-12-16.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25042</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-02-08 00:02:16 -0800</bug_when>
    <thetext>Perhaps this: &lt;http://trac.webkit.org/projects/webkit/changeset/11484&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25049</commentid>
    <comment_count>4</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-08 01:36:25 -0800</bug_when>
    <thetext>No, wasn&apos;t that one. Something else...(In reply to comment #3)
&gt; Perhaps this: &lt;http://trac.webkit.org/projects/webkit/changeset/11484&gt;.
&gt; 

No, doesn&apos;t seem to be that one. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25059</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-02-08 04:20:24 -0800</bug_when>
    <thetext>WebKit-CVS-2005-12-07 10-27-14 GMT.dmg works
WebKit-CVS-2005-12-08 23-04-18 GMT.dmg broken</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24650</commentid>
    <comment_count>6</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-09 08:18:28 -0800</bug_when>
    <thetext>If you revert both Bug 11109 and http://trac.webkit.org/projects/webkit/changeset/11484 then you get correct positioning. This is because Calendar works around offsetLeft/offsetTop/offsetParent bug in tiger webkit. Specifically tiger webkit would not include body margins to offsets of relative positioned elements.

This code in function qC(a, b, c, d) in the obfuscated calendar script

      if (T)
        i.x += 3;
      else
        if ($)
          {
            i.x += fb() ? 6 : 8;
            i.y += 6;
          }

adds some magic offsets to fix positioning issues. For safari $=1, for MSIE T=1.

Safari offsetLeft behavior is still not exactly the same as Firefox. For some reason, like MSIE, ToT Safari needs that i.x += 3; to get pixel-correct horizontal position. Is the idea here to try to replicate MSIE or Firefox behavior for offset functions? If target is MSIE then I don&apos;t think there is any bug here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24651</commentid>
    <comment_count>7</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-02-09 08:27:03 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Safari offsetLeft behavior is still not exactly the same as Firefox.

&gt; Is the idea here to try to replicate MSIE or Firefox
&gt; behavior for offset functions?

My intention with the patch for bug 11109 was to replicate Firefox (WinIE behavior is described in one of my comments on that bug). Do you know what the remaining discrepancy is?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24655</commentid>
    <comment_count>8</comment_count>
      <attachid>13086</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-09 09:36:19 -0800</bug_when>
    <thetext>Created attachment 13086
test case showing different offset behavior compared to ie/ff

Both FF and IE agree that offsetLeft/Top should be measured from inner border edge of the offsetParent. WebKit measures it from outer border edge of the parent. 

In this case first offsetLeft is zero in FF/IE and non-zero in Safari</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24663</commentid>
    <comment_count>9</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-09 11:02:38 -0800</bug_when>
    <thetext>Here is a nice test suite for offset properties by Anne van Kesteren: 

http://dump.testsuite.org/2006/dom/style/offset/

We get quite a few wrong and more importantly we get quite a few different from FF. Especially offsetParent seems to be often wrong.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24668</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-02-09 11:19:24 -0800</bug_when>
    <thetext>Per Comment #6, it sounds like both Safari and Google Calendar will need fixes to resolve this bug.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24670</commentid>
    <comment_count>11</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-02-09 11:25:12 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; Here is a nice test suite for offset properties by Anne van Kesteren: 
&gt; 
&gt; http://dump.testsuite.org/2006/dom/style/offset/
&gt; 
&gt; We get quite a few wrong and more importantly we get quite a few different from
&gt; FF. Especially offsetParent seems to be often wrong.

Filed Bug 12713 to import this test suite.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24683</commentid>
    <comment_count>12</comment_count>
      <attachid>13091</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-09 13:26:37 -0800</bug_when>
    <thetext>Created attachment 13091
proposed patch

Ok, so here is proposed patch. It does three things
1) calculate offsets from padding edge (inner edge of border), not from border edge
2) revert this 

!(!style()-&gt;htmlHacks() &amp;&amp; skipTables ? curr-&gt;isRoot() : curr-&gt;isBody())

in http://trac.webkit.org/projects/webkit/changeset/11484 back to this

!curr-&gt;isBody()

which seems to match FF behavior in both strict and compat modes. Why was this change done? Hard to say since there was no test case nor explanation.

3) Check for tableness from dom tree instead of rendering tree. That&apos;s just what other browser seem to do based on Anne&apos;s tests.

These changes make all Anne&apos;s tests pass except for 3,8,12,29,43,45,49,50. In all those cases we match FF behavior (except 12, where we fail a bit less). Failures are of course all debatable since there is no authorative spec about offset behaviors. No layout test failures either.

(some of Anne&apos;s test cases may randomly produce wrong offsetTop results when reloaded. that is some layout timing problem not directly related to offset calculations)

None of this actually fixes Google Calendar, it needs ToT fixes in the other end. Best we can do is to make this stuff consistent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24640</commentid>
    <comment_count>13</comment_count>
    <who name="Bob Austin">abob</who>
    <bug_when>2007-02-09 14:12:33 -0800</bug_when>
    <thetext>This problem has been written to the Google bug tracking system.
631734</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24435</commentid>
    <comment_count>14</comment_count>
      <attachid>13091</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-02-10 16:21:36 -0800</bug_when>
    <thetext>Comment on attachment 13091
proposed patch

Fix looks good (Mitz agrees) but needs ChangeLog entry and test case. Feel free to convert this to an r+ if you add a ChangeLog and land the attached test case w/ this.

Also, this won&apos;t really make the bug on Google go away, but being more like FF will allow us to turn this into strictly an evangelism bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24437</commentid>
    <comment_count>15</comment_count>
      <attachid>13091</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-02-10 16:27:40 -0800</bug_when>
    <thetext>Comment on attachment 13091
proposed patch

r- per above comments</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24112</commentid>
    <comment_count>16</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-11 16:29:17 -0800</bug_when>
    <thetext>Commited as r19567 with attached layout test based on comment  #14 above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24113</commentid>
    <comment_count>17</comment_count>
      <attachid>13091</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2007-02-11 16:31:29 -0800</bug_when>
    <thetext>Comment on attachment 13091
proposed patch

see comment 14</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>13086</attachid>
            <date>2007-02-09 09:36:19 -0800</date>
            <delta_ts>2007-02-09 09:36:19 -0800</delta_ts>
            <desc>test case showing different offset behavior compared to ie/ff</desc>
            <filename>12687.html</filename>
            <type>text/html</type>
            <size>449</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgoKPGJvZHkgc3R5bGU9J21hcmdpbjo4cHgnPgo8ZGl2Pgo8ZGl2IHN0eWxl
PSJwb3NpdGlvbjogYWJzb2x1dGU7IHdpZHRoOiAxNTBweDsgaGVpZ2h0OiAxNTBweDsgYm9yZGVy
OiA1cHggc29saWQgZ3JlZW4iPgo8ZGl2IGlkPSd4JyBzdHlsZT0icG9zaXRpb246IGFic29sdXRl
OyBsZWZ0OjAlOyB0b3A6MCU7IHdpZHRoOiA1MHB4OyBoZWlnaHQ6IDUwcHg7IGJvcmRlcjoxM3B4
IHNvbGlkIGJsdWUiPgo8L2Rpdj4KPC9kaXY+CjxzY3JpcHQ+CnZhciBlbCA9IGRvY3VtZW50Lmdl
dEVsZW1lbnRCeUlkKCd4Jyk7CndoaWxlIChlbCkgewpkb2N1bWVudC53cml0ZSgnPGJyPi0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1vZmZzZXRMZWZ0Oicr
ZWwub2Zmc2V0TGVmdCk7CmVsID0gZWwub2Zmc2V0UGFyZW50Owp9Cjwvc2NyaXB0Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>13091</attachid>
            <date>2007-02-09 13:26:37 -0800</date>
            <delta_ts>2007-02-11 16:31:29 -0800</delta_ts>
            <desc>proposed patch</desc>
            <filename>12687.patch</filename>
            <type>text/plain</type>
            <size>1759</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvcmVuZGVyaW5nL1JlbmRlck9iamVjdC5jcHAKPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g
V2ViQ29yZS9yZW5kZXJpbmcvUmVuZGVyT2JqZWN0LmNwcAkocmV2aXNpb24gMTk0ODEpCisrKyBX
ZWJDb3JlL3JlbmRlcmluZy9SZW5kZXJPYmplY3QuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC01MDcs
NyArNTA3LDcgQEAgaW50IFJlbmRlck9iamVjdDo6b2Zmc2V0TG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SBwYXJlbnQoKTsK
ICAgICB3aGlsZSAoY3VyciAmJiAoIWN1cnItPmVsZW1lbnQoKSB8fAotICAgICAgICAgICAgICAg
ICAgICAoIWN1cnItPmlzUG9zaXRpb25lZCgpICYmICFjdXJyLT5pc1JlbFBvc2l0aW9uZWQoKSAm
JgotICAgICAgICAgICAgICAgICAgICAgICAgISghc3R5bGUoKS0+aHRtbEhhY2tzKCkgJiYgc2tp
cFRhYmxlcyA/IGN1cnItPmlzUm9vdCgpIDogY3Vyci0+aXNCb2R5KCkpKSkpIHsKLSAgICAgICAg
aWYgKCFza2lwVGFibGVzICYmIGN1cnItPmVsZW1lbnQoKSAmJiAoY3Vyci0+aXNUYWJsZUNlbGwo
KSB8fCBjdXJyLT5pc1RhYmxlKCkpKQorICAgICAgICAgICAgICAgICAgICAoIWN1cnItPmlzUG9z
aXRpb25lZCgpICYmICFjdXJyLT5pc1JlbFBvc2l0aW9uZWQoKSAmJiAhY3Vyci0+aXNCb2R5KCkp
KSkgeworICAgICAgICBpZiAoIXNraXBUYWJsZXMgJiYgY3Vyci0+ZWxlbWVudCgpICYmIChjdXJy
LT5lbGVtZW50KCktPmhhc1RhZ05hbWUodGFibGVUYWcpIHx8IAorICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyLT5lbGVtZW50KCktPmhhc1RhZ05hbWUo
dGRUYWcpIHx8IGN1cnItPmVsZW1lbnQoKS0+aGFzVGFnTmFtZSh0aFRhZykpKQogICAgICAgICAg
ICAgYnJlYWs7CiAgICAgICAgIGN1cnIgPSBjdXJyLT5wYXJlbnQoKTsKICAgICB9Cg==
</data>
<flag name="review"
          id="5073"
          type_id="1"
          status="+"
          setter="koivisto"
    />
          </attachment>
      

    </bug>

</bugzilla>