- Source/WebCore/ChangeLog +23 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2011-04-22  Levi Weintraub  <leviw@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        REGRESSION: left property broken with position:fixed elements in RTL documents
6
        https://bugs.webkit.org/show_bug.cgi?id=59204
7
        http://code.google.com/p/chromium/issues/detail?id=80216
8
9
        Test: fast/block/positioning/rtl-fixed-positioning.html
10
              fast/block/positioning/vertical-rl/fixed-positioning.html
11
12
        Returning the proper scroll offsets for fixed position content in RTL documents.
13
        We regressed to X and Y offsets not updating while scrolling when we clamped to zero,
14
        but RTL documents scroll in negative space.
15
16
        * page/FrameView.cpp:
17
        (WebCore::FrameView::scrollXForFixedPosition): Properly handling RTL documents where
18
        the scroll origin and offsets are negative.
19
        (WebCore::FrameView::scrollYForFixedPosition): Properly handling vertical writing-
20
        mode RTL documents, like above.
21
        * platform/ScrollView.h:
22
        (WebCore::ScrollView::scrollOrigin): Changing this accessor to const.
23
1
2011-04-21  MORITA Hajime  <morrita@google.com>
24
2011-04-21  MORITA Hajime  <morrita@google.com>
2
25
3
        Reviewed by Dimitri Glazkov.
26
        Reviewed by Dimitri Glazkov.
- Source/WebCore/page/FrameView.cpp -8 / +22 lines
Lines 1103-1112 int FrameView::scrollXForFixedPosition() Source/WebCore/page/FrameView.cpp_sec1
1103
1103
1104
    int x = scrollX();
1104
    int x = scrollX();
1105
1105
1106
    if (x < 0)
1106
    if (!ScrollView::scrollOrigin().x()) {
1107
        x = 0;
1107
        if (x < 0)
1108
    else if (x > maxX)
1108
            x = 0;
1109
        x = maxX;
1109
        else if (x > maxX)
1110
            x = maxX;
1111
    } else {
1112
        if (x > 0)
1113
            x = 0;
1114
        else if (x < -maxX)
1115
            x = -maxX;
1116
    }
1110
1117
1111
    if (!m_frame)
1118
    if (!m_frame)
1112
        return x;
1119
        return x;
Lines 1131-1140 int FrameView::scrollYForFixedPosition() Source/WebCore/page/FrameView.cpp_sec2
1131
1138
1132
    int y = scrollY();
1139
    int y = scrollY();
1133
1140
1134
    if (y < 0)
1141
    if (!ScrollView::scrollOrigin().y()) {
1135
        y = 0;
1142
        if (y < 0)
1136
    else if (y > maxY)
1143
            y = 0;
1137
        y = maxY;
1144
        else if (y > maxY)
1145
            y = maxY;
1146
    } else {
1147
        if (y > 0)
1148
            y = 0;
1149
        else if (y < -maxY)
1150
            y = -maxY;
1151
    }
1138
1152
1139
    if (!m_frame)
1153
    if (!m_frame)
1140
        return y;
1154
        return y;
- Source/WebCore/platform/ScrollView.h -1 / +1 lines
Lines 306-312 protected: Source/WebCore/platform/ScrollView.h_sec1
306
    virtual void scrollContentsSlowPath(const IntRect& updateRect);
306
    virtual void scrollContentsSlowPath(const IntRect& updateRect);
307
307
308
    void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously);
308
    void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously);
309
    IntPoint scrollOrigin() { return m_scrollOrigin; }
309
    IntPoint scrollOrigin() const { return m_scrollOrigin; }
310
310
311
    // Subclassed by FrameView to check the writing-mode of the document.
311
    // Subclassed by FrameView to check the writing-mode of the document.
312
    virtual bool isVerticalDocument() const { return true; }
312
    virtual bool isVerticalDocument() const { return true; }
- LayoutTests/ChangeLog +19 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2011-04-22  Levi Weintraub  <leviw@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        REGRESSION: left property broken with position:fixed elements in RTL documents
6
        https://bugs.webkit.org/show_bug.cgi?id=59204
7
        http://code.google.com/p/chromium/issues/detail?id=80216
8
9
        Test to ensure position:fixed works properly in RTL documents.
10
11
        * fast/block/positioning/rtl-fixed-positioning.html: Added.
12
        * fast/block/positioning/vertical-rl/fixed-positioning.html: Added.
13
        * platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.checksum: Added.
14
        * platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.png: Added.
15
        * platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.txt: Added.
16
        * platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.checksum: Added.
17
        * platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.png: Added.
18
        * platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.txt: Added.
19
1
2011-04-21  MORITA Hajime  <morrita@google.com>
20
2011-04-21  MORITA Hajime  <morrita@google.com>
2
21
3
        Reviewed by Dimitri Glazkov.
22
        Reviewed by Dimitri Glazkov.
- LayoutTests/fast/block/positioning/rtl-fixed-positioning.html +32 lines
Line 0 LayoutTests/fast/block/positioning/rtl-fixed-positioning.html_sec1
1
<!doctype html>
2
<html dir='rtl'>
3
<head>
4
<style>
5
.container {
6
    background-color: #0f0;
7
    height: 2000px;
8
    width: 2000px;
9
}
10
.floater {
11
    background-color: #f0f;
12
    height: 100px;
13
    left: 0;
14
    position: fixed;
15
    top: 0;
16
    width: 100px;
17
}
18
body {
19
    overflow:hidden;
20
}
21
</style>
22
</head>
23
<body>
24
25
<div class="container">
26
  <div class="floater" dir="ltr">This box should be fixed to the top-left of the window.
27
  </div>
28
</div>
29
30
<script>
31
window.scrollBy(-100, 100);
32
</script>
- LayoutTests/fast/block/positioning/vertical-rl/fixed-positioning.html +33 lines
Line 0 LayoutTests/fast/block/positioning/vertical-rl/fixed-positioning.html_sec1
1
<!doctype html>
2
<html dir="rtl">
3
<head>
4
<style>
5
.container {
6
    background-color: #0f0;
7
    height: 2000px;
8
    width: 2000px;
9
}
10
.floater {
11
    background-color: #f0f;
12
    height: 100px;
13
    left: 0;
14
    position: fixed;
15
    top: 0;
16
    width: 100px;
17
}
18
body {
19
    overflow:hidden;
20
    -webkit-writing-mode: vertical-rl;
21
}
22
</style>
23
</head>
24
<body>
25
26
<div class="container">
27
  <div class="floater" dir="ltr">This box should be fixed to the top-left of the window.
28
  </div>
29
</div>
30
31
<script>
32
window.scrollBy(-100, -100);
33
</script>
- LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.checksum +1 lines
Line 0 LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.checksum_sec1
1
b40d40b52aa9840013332966b24af383
- LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.txt +7 lines
Line 0 LayoutTests/platform/mac/fast/block/positioning/rtl-fixed-positioning-expected.txt_sec1
1
layer at (0,0) size 800x2016
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x2016
4
  RenderBlock {HTML} at (0,0) size 800x2016
5
    RenderBody {BODY} at (8,8) size 784x2000
6
      RenderBlock {DIV} at (-1216,0) size 2000x2000 [bgcolor=#00FF00]
7
scrolled to -100,100
- LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.checksum +1 lines
Line 0 LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.checksum_sec1
1
95bb6c9c3112d564f2f8ec9fe07bd15d
- LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.txt +7 lines
Line 0 LayoutTests/platform/mac/fast/block/positioning/vertical-rl/fixed-positioning-expected.txt_sec1
1
layer at (0,0) size 2016x600
2
  RenderView at (0,0) size 800x600
3
layer at (-1216,0) size 2016x600 backgroundClip at (0,0) size 2016x600 clip at (0,0) size 2016x600 outlineClip at (0,0) size 2016x600
4
  RenderBlock {HTML} at (0,0) size 2016x600
5
    RenderBody {BODY} at (8,8) size 2000x584
6
      RenderBlock {DIV} at (0,-1416) size 2000x2000 [bgcolor=#00FF00]
7
scrolled to -100,-100

Return to Bug 59204