Changeset 15471 in webkit


Ignore:
Timestamp:
Jul 16, 2006 5:37:55 PM (18 years ago)
Author:
darin
Message:

LayoutTests:

Reviewed by John Sullivan (new test, not the changes to existing ones).

  • fast/html/body-offset-properties-expected.txt: Added.
  • fast/html/body-offset-properties.html: Added.
  • editing/execCommand/findString-2.html: Update to not depend on the buggy body.offseLeft/Top. Instead hardcode the default body margin of 8.
  • editing/pasteboard/drop-text-without-selection.html: Ditto.
  • editing/selection/click-before-and-after-table.html: Ditto.
  • editing/selection/mixed-editability-1.html: Ditto.
  • fast/table/click-near-anonymous-table.html: Ditto.
  • editing/selection/drag-to-contenteditable-iframe.html: Remove unnecessary use of body.offsetLeft/Top that are always 0.

WebCore:

Reviewed by John Sullivan.

The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
Presumably some other bug that we fixed had been compensating.

Test: fast/html/body-offset-properties.html

  • rendering/RenderObject.cpp: (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent. (WebCore::RenderObject::offsetTop): Ditto. (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r15468 r15471  
     12006-07-16  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by John Sullivan (new test, not the changes to existing ones).
     4
     5        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
     6          <rdar://problem/4590613>
     7          REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
     8
     9        * fast/html/body-offset-properties-expected.txt: Added.
     10        * fast/html/body-offset-properties.html: Added.
     11
     12        * editing/execCommand/findString-2.html: Update to not depend on the buggy body.offseLeft/Top.
     13        Instead hardcode the default body margin of 8.
     14        * editing/pasteboard/drop-text-without-selection.html: Ditto.
     15        * editing/selection/click-before-and-after-table.html: Ditto.
     16        * editing/selection/mixed-editability-1.html: Ditto.
     17        * fast/table/click-near-anonymous-table.html: Ditto.
     18
     19        * editing/selection/drag-to-contenteditable-iframe.html: Remove unnecessary use of body.offsetLeft/Top
     20        that are always 0.
     21
    1222006-07-16  Maciej Stachowiak  <mjs@apple.com>
    223
  • trunk/LayoutTests/editing/execCommand/findString-2.html

    r14877 r15471  
    66if (window.layoutTestController) {
    77    var e = document.getElementById("selectme");
    8     var x = e.offsetParent.offsetLeft + e.offsetLeft + e.offsetWidth / 2;
    9     var y = e.offsetParent.offsetTop + e.offsetTop + e.offsetHeight / 2;
     8    // The 8 here is the default margin on the body element.
     9    var x = 8 + e.offsetLeft + e.offsetWidth / 2;
     10    var y = 8 + e.offsetTop + e.offsetHeight / 2;
    1011    eventSender.mouseMoveTo(x, y);
    1112    eventSender.mouseDown();
  • trunk/LayoutTests/editing/pasteboard/drop-text-without-selection.html

    r13891 r15471  
    2222    var link = document.getElementById("link");
    2323
    24     var xOff = document.body.offsetLeft;
    25     var yOff = document.body.offsetTop;
     24    // The 8 here is the default margin on the body element.
     25    var xOff = 8;
     26    var yOff = 8;
    2627   
    2728    var x = xOff + link.offsetLeft + link.offsetWidth / 2;
  • trunk/LayoutTests/editing/selection/click-before-and-after-table.html

    r15067 r15471  
    2525    var s, x, y, e, top, bottom, left, right;
    2626    table = document.getElementById("table");
    27     top = table.offsetParent.offsetTop + table.offsetTop;
     27    // The 8 here is the default margin on the body element.
     28    top = 8 + table.offsetTop;
     29    left = 8 + table.offsetLeft;
    2830    bottom = top + table.offsetHeight;
    29     left = table.offsetParent.offsetLeft + table.offsetLeft;
    3031    right = left + table.offsetWidth;
    3132   
  • trunk/LayoutTests/editing/selection/drag-to-contenteditable-iframe.html

    r14527 r15471  
    2828   
    2929    e = document.getElementById("dragme");
    30     x = e.offsetLeft + e.offsetParent.offsetLeft + e.offsetWidth / 2;
    31     y = e.offsetTop + e.offsetParent.offsetTop + e.offsetHeight / 2;
     30    x = e.offsetLeft + e.offsetWidth / 2;
     31    y = e.offsetTop + e.offsetHeight / 2;
    3232
    3333    eventSender.mouseMoveTo(x, y);
     
    3636   
    3737    e = document.getElementById("frame");
    38     x = e.offsetLeft + e.offsetParent.offsetLeft + e.offsetWidth / 2;
    39     y = e.offsetTop + e.offsetParent.offsetTop + e.offsetHeight / 2;
     38    x = e.offsetLeft + e.offsetWidth / 2;
     39    y = e.offsetTop + e.offsetHeight / 2;
    4040   
    4141    eventSender.mouseMoveTo(x, y);
  • trunk/LayoutTests/editing/selection/mixed-editability-1.html

    r15195 r15471  
    1010    var x, y;
    1111   
    12     x = start.offsetParent.offsetTop + start.offsetLeft + start.offsetWidth / 2;
    13     y = start.offsetParent.offsetTop + start.offsetTop + start.offsetHeight / 2;
     12    // The 8 here is the default margin on the body element.
     13    x = 8 + start.offsetLeft + start.offsetWidth / 2;
     14    y = 8 + start.offsetTop + start.offsetHeight / 2;
    1415   
    1516    eventSender.mouseMoveTo(x, y);
  • trunk/LayoutTests/fast/table/click-near-anonymous-table.html

    r15425 r15471  
    88                return;
    99            var target = document.getElementById("target");
    10             var baseX = document.body.offsetLeft + target.offsetLeft;
    11             var baseY = document.body.offsetTop + target.offsetTop;
     10            // The 8 here is the default margin on the body element.
     11            var baseX = 8 + target.offsetLeft;
     12            var baseY = 8 + target.offsetTop;
    1213            for (i = 0; i < target.children.length; i++) {
    1314                var div = target.children[i];
  • trunk/WebCore/ChangeLog

    r15470 r15471  
     12006-07-16  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by John Sullivan.
     4
     5        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
     6          <rdar://problem/4590613>
     7          REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
     8
     9        The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
     10        I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
     11        Presumably some other bug that we fixed had been compensating.
     12
     13        Test: fast/html/body-offset-properties.html
     14
     15        * rendering/RenderObject.cpp:
     16        (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
     17        (WebCore::RenderObject::offsetTop): Ditto.
     18        (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
     19
    1202006-07-16  Beth Dakin  <bdakin@apple.com>
    221
  • trunk/WebCore/rendering/RenderObject.cpp

    r15299 r15471  
    558558int RenderObject::offsetLeft() const
    559559{
     560    RenderObject* offsetPar = offsetParent();
     561    if (!offsetPar)
     562        return 0;
    560563    int x = xPos();
    561564    if (!isPositioned()) {
    562565        if (isRelPositioned())
    563             x += ((RenderBox*)this)->relativePositionOffsetX();
    564        
    565         RenderObject* offsetPar = offsetParent();
     566            x += static_cast<const RenderBox*>(this)->relativePositionOffsetX();
    566567        RenderObject* curr = parent();
    567568        while (curr && curr != offsetPar) {
     
    575576int RenderObject::offsetTop() const
    576577{
     578    RenderObject* offsetPar = offsetParent();
     579    if (!offsetPar)
     580        return 0;
    577581    int y = yPos();
    578582    if (!isPositioned()) {
    579583        if (isRelPositioned())
    580             y += ((RenderBox*)this)->relativePositionOffsetY();
    581         RenderObject* offsetPar = offsetParent();
     584            y += static_cast<const RenderBox*>(this)->relativePositionOffsetY();
    582585        RenderObject* curr = parent();
    583586        while (curr && curr != offsetPar) {
     
    593596{
    594597    // FIXME: It feels like this function could almost be written using containing blocks.
     598    if (isBody())
     599        return 0;
    595600    bool skipTables = isPositioned() || isRelPositioned();
    596601    RenderObject* curr = parent();
Note: See TracChangeset for help on using the changeset viewer.