Changeset 28083 in webkit


Ignore:
Timestamp:
Nov 27, 2007 3:05:49 PM (16 years ago)
Author:
timothy@apple.com
Message:

WebCore:

Reviewed by Kevin McCullough.

Bug 16161: window.moveBy(0, 0) moves the window by -22px vertically
http://bugs.webkit.org/show_bug.cgi?id=16161

Removed the "Adjust the window rect to be in the coordinate space of
the screen rect" step which was always adding (0,22) to the window
position (on the main screen). Instead, account for screen X and Y
in the bottom and right constrain step.

Added more test cases to: fast/dom/Window/window-resize.html

  • bindings/js/kjs_window.cpp: (KJS::adjustWindowRect):

LayoutTests:

Reviewed by Kevin McCullough.

Bug 16161: window.moveBy(0, 0) moves the window by -22px vertically
http://bugs.webkit.org/show_bug.cgi?id=16161

Added test cases for moveBy(0, 0), moveBy(0, 1) and moveBy(1, 0).

  • fast/dom/Window/window-resize.html:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r28071 r28083  
     12007-11-27  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Kevin McCullough.
     4
     5        Bug 16161: window.moveBy(0, 0) moves the window by -22px vertically
     6        http://bugs.webkit.org/show_bug.cgi?id=16161
     7
     8        Added test cases for moveBy(0, 0), moveBy(0, 1) and  moveBy(1, 0).
     9
     10        * fast/dom/Window/window-resize.html:
     11
    1122007-11-26  Timothy Hatcher  <timothy@apple.com>
    213
  • trunk/LayoutTests/fast/dom/Window/window-resize.html

    r26635 r28083  
    178178    debug('');
    179179
     180    x = screen.width / 4;
     181    y = screen.height / 4;
     182    window.resizeTo(x, y);
     183
     184    x = screen.width / 2;
     185    y = screen.height / 2;
     186    window.moveTo(x - (window.outerWidth / 2), y - (window.outerHeight / 2));
     187
     188    var previousScreenX = window.screenX;
     189    var previousScreenY = window.screenY;
     190
     191    x = 0;
     192    y = 0;
     193    window.moveBy(x, y);
     194    debug("Testing - moveBy: Zero Zero");
     195    shouldBe('window.screenY', previousScreenY.toString());
     196    shouldBe('window.screenX', previousScreenX.toString());
     197
     198    debug('');
     199
     200    previousScreenX += 1;
     201
     202    x = 1;
     203    y = 0;
     204    window.moveBy(x, y);
     205    debug("Testing - moveBy: One Zero");
     206    shouldBe('window.screenY', previousScreenY.toString());
     207    shouldBe('window.screenX', previousScreenX.toString());
     208
     209    debug('');
     210
     211    previousScreenY += 1;
     212
     213    x = 0;
     214    y = 1;
     215    window.moveBy(x, y);
     216    debug("Testing - moveBy: Zero One");
     217    shouldBe('window.screenY', previousScreenY.toString());
     218    shouldBe('window.screenX', previousScreenX.toString());
     219
     220    debug('');
     221
     222    window.moveTo(0,0);
     223    window.resizeTo(screen.width, screen.height);
     224
    180225    x = -100;
    181226    y = -100;
  • trunk/WebCore/ChangeLog

    r28075 r28083  
     12007-11-27  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Kevin McCullough.
     4
     5        Bug 16161: window.moveBy(0, 0) moves the window by -22px vertically
     6        http://bugs.webkit.org/show_bug.cgi?id=16161
     7
     8        Removed the "Adjust the window rect to be in the coordinate space of
     9        the screen rect" step which was always adding (0,22) to the window
     10        position (on the main screen). Instead, account for screen X and Y
     11        in the bottom and right constrain step.
     12
     13        Added more test cases to: fast/dom/Window/window-resize.html
     14
     15        * bindings/js/kjs_window.cpp:
     16        (KJS::adjustWindowRect):
     17
    1182007-11-27  Timothy Hatcher  <timothy@apple.com>
    219
  • trunk/WebCore/bindings/js/kjs_window.cpp

    r28056 r28083  
    12301230    // Constrain the window to the bottom and right of the screen if it's past
    12311231    // the right or below it.
    1232     window.setX(window.x() - max(0.0f, window.right() - screen.width()));
    1233     window.setY(window.y() - max(0.0f, window.bottom() - screen.height()));
    1234    
    1235     // Adjust the window rect to be in the coordinate space of the screen rect
    1236     window.setX(window.x() + screen.x());
    1237     window.setY(window.y() + screen.y());
     1232    window.setX(window.x() - max(0.0f, window.right() - screen.width() - screen.x()));
     1233    window.setY(window.y() - max(0.0f, window.bottom() - screen.height() - screen.y()));
    12381234}
    12391235
Note: See TracChangeset for help on using the changeset viewer.