- a/LayoutTests/ChangeLog +14 lines
Lines 2-7 a/LayoutTests/ChangeLog_sec1
2
2
3
        Reviewed by NOBODY (OOPS!).
3
        Reviewed by NOBODY (OOPS!).
4
4
5
        Compositing layers are incorrectly positioned after scrolling with position:fixed
6
        https://bugs.webkit.org/show_bug.cgi?id=29262
7
        
8
        Add testcase for scrolling a page with position:fixed composited content.
9
10
        * compositing/geometry/fixed-position.html: Added.
11
        * platform/mac/compositing/geometry/fixed-position-expected.checksum: Added.
12
        * platform/mac/compositing/geometry/fixed-position-expected.png: Added.
13
        * platform/mac/compositing/geometry/fixed-position-expected.txt: Added.
14
15
2009-09-17  Simon Fraser  <simon.fraser@apple.com>
16
17
        Reviewed by NOBODY (OOPS!).
18
5
        Transformed elements inside position:fixed container are clipped incorrectly
19
        Transformed elements inside position:fixed container are clipped incorrectly
6
        https://bugs.webkit.org/show_bug.cgi?id=29346
20
        https://bugs.webkit.org/show_bug.cgi?id=29346
7
        
21
        
- a/LayoutTests/compositing/geometry/fixed-position.html +54 lines
Line 0 a/LayoutTests/compositing/geometry/fixed-position.html_sec1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
   "http://www.w3.org/TR/html4/loose.dtd">
3
4
<html lang="en">
5
<head>
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7
  <title>Position fixed</title>
8
  <style type="text/css" media="screen">
9
    body {
10
      height: 1000px;
11
      width: 1000px;
12
    }
13
    #fixed {
14
      position: fixed;
15
      top: 0;
16
      left: 0;
17
      height: 100px;
18
      width: 100px;
19
      opacity: 0.8; /* makes this a compositing layer without assigning a transform */
20
      background-color: orange;
21
    }
22
23
    .box {
24
      height: 50px;
25
      width: 50px;
26
      background-color: green;
27
    }
28
    
29
    .compositing {
30
      -webkit-transform: translateZ(0);
31
    }
32
    
33
    p {
34
      position: absolute;
35
      left: 50px;
36
      top: 150px;
37
    }
38
  </style>
39
  <script type="text/javascript" charset="utf-8">
40
    window.addEventListener('load', function() {
41
      window.scrollBy(50, 50);
42
    }, false);
43
  </script>
44
</head>
45
<body>
46
47
<p>You should see a green square in the top left corner of an orange box.</p>
48
<div id="fixed">
49
  <div class="compositing box">
50
  </div>
51
</div>
52
53
</body>
54
</html>
- a/LayoutTests/platform/mac/compositing/geometry/fixed-position-expected.checksum +1 lines
Line 0 a/LayoutTests/platform/mac/compositing/geometry/fixed-position-expected.checksum_sec1
1
1bb716783916e0a67d95469a957b138c
- a/LayoutTests/platform/mac/compositing/geometry/fixed-position-expected.txt +14 lines
Line 0 a/LayoutTests/platform/mac/compositing/geometry/fixed-position-expected.txt_sec1
1
layer at (0,0) size 1008x1016
2
  RenderView at (0,0) size 785x585
3
layer at (0,0) size 1008x1016
4
  RenderBlock {HTML} at (0,0) size 785x1016
5
    RenderBody {BODY} at (8,8) size 1000x1000
6
layer at (50,166) size 439x18
7
  RenderBlock (positioned) {P} at (50,166) size 439x18
8
    RenderText {#text} at (0,0) size 439x18
9
      text run at (0,0) width 439: "You should see a green square in the top left corner of an orange box."
10
layer at (50,50) size 100x100
11
  RenderBlock (positioned) {DIV} at (0,0) size 100x100 [bgcolor=#FFA500]
12
layer at (50,50) size 50x50
13
  RenderBlock {DIV} at (0,0) size 50x50 [bgcolor=#008000]
14
scrolled to 50,50
- a/WebCore/ChangeLog +20 lines
Lines 2-7 a/WebCore/ChangeLog_sec1
2
2
3
        Reviewed by NOBODY (OOPS!).
3
        Reviewed by NOBODY (OOPS!).
4
4
5
        Compositing layers are incorrectly positioned after scrolling with position:fixed
6
        https://bugs.webkit.org/show_bug.cgi?id=29262
7
        
8
        When scrolling a page with compositing layers inside a position:fixed element,
9
        we need to update the compositing layer positions when the scroll position changes.
10
11
        Test: compositing/geometry/fixed-position.html
12
13
        * WebCore.base.exp:
14
        Export FrameView::scrollPositionChanged()
15
        
16
        * page/FrameView.h:
17
        * page/FrameView.cpp:
18
        (WebCore::FrameView::scrollPositionChanged):
19
        New method that sends the scroll event, and updates compositing layers positions if necessary.
20
21
2009-09-17  Simon Fraser  <simon.fraser@apple.com>
22
23
        Reviewed by NOBODY (OOPS!).
24
5
        Transformed elements inside position:fixed container are clipped incorrectly
25
        Transformed elements inside position:fixed container are clipped incorrectly
6
        https://bugs.webkit.org/show_bug.cgi?id=29346
26
        https://bugs.webkit.org/show_bug.cgi?id=29346
7
        
27
        
- a/WebCore/WebCore.base.exp +1 lines
Lines 682-687 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb a/WebCore/WebCore.base.exp_sec1
682
__ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
682
__ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
683
__ZN7WebCore9FrameView6createEPNS_5FrameE
683
__ZN7WebCore9FrameView6createEPNS_5FrameE
684
__ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
684
__ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
685
__ZN7WebCore9FrameView21scrollPositionChangedEv
685
__ZN7WebCore9HTMLNames10listingTagE
686
__ZN7WebCore9HTMLNames10listingTagE
686
__ZN7WebCore9HTMLNames11textareaTagE
687
__ZN7WebCore9HTMLNames11textareaTagE
687
__ZN7WebCore9HTMLNames13blockquoteTagE
688
__ZN7WebCore9HTMLNames13blockquoteTagE
- a/WebCore/page/FrameView.cpp +16 lines
Lines 803-808 void FrameView::setScrollPosition(const IntPoint& scrollPoint) a/WebCore/page/FrameView.cpp_sec1
803
    m_inProgrammaticScroll = wasInProgrammaticScroll;
803
    m_inProgrammaticScroll = wasInProgrammaticScroll;
804
}
804
}
805
805
806
void FrameView::scrollPositionChanged()
807
{
808
    frame()->eventHandler()->sendScrollEvent();
809
810
#if USE(ACCELERATED_COMPOSITING)
811
    // We need to update layer positions after scrolling to account for position:fixed layers.
812
    Document* document = m_frame->document();
813
    if (!document)
814
        return;
815
816
    RenderLayer* layer = document->renderer() ? document->renderer()->enclosingLayer() : 0;
817
    if (layer)
818
        layer->updateLayerPositions(RenderLayer::UpdateCompositingLayers);
819
#endif
820
}
821
806
HostWindow* FrameView::hostWindow() const
822
HostWindow* FrameView::hostWindow() const
807
{
823
{
808
    Page* page = frame() ? frame()->page() : 0;
824
    Page* page = frame() ? frame()->page() : 0;
- a/WebCore/page/FrameView.h +1 lines
Lines 131-136 public: a/WebCore/page/FrameView.h_sec1
131
131
132
    virtual void scrollRectIntoViewRecursively(const IntRect&);
132
    virtual void scrollRectIntoViewRecursively(const IntRect&);
133
    virtual void setScrollPosition(const IntPoint&);
133
    virtual void setScrollPosition(const IntPoint&);
134
    void scrollPositionChanged();
134
135
135
    String mediaType() const;
136
    String mediaType() const;
136
    void setMediaType(const String&);
137
    void setMediaType(const String&);
- a/WebKit/mac/ChangeLog +15 lines
Lines 1-3 a/WebKit/mac/ChangeLog_sec1
1
2009-09-17  Simon Fraser  <simon.fraser@apple.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Compositing layers are incorrectly positioned after scrolling with position:fixed
6
        https://bugs.webkit.org/show_bug.cgi?id=29262
7
        
8
        When scrolling a page with compositing layers inside a position:fixed element,
9
        we need to update the compositing layer positions when the scroll position changes.
10
11
        * WebView/WebHTMLView.mm:
12
        (-[WebHTMLView _frameOrBoundsChanged]):
13
        Call the new FrameView::scrollPositionChanged() method rather than sending the
14
        scroll event directly.
15
1
2009-09-16  Simon Fraser  <simon.fraser@apple.com>
16
2009-09-16  Simon Fraser  <simon.fraser@apple.com>
2
17
3
        Reviewed by Dan Bernstein.
18
        Reviewed by Dan Bernstein.
- a/WebKit/mac/WebView/WebHTMLView.mm -2 / +5 lines
Lines 1151-1158 static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) a/WebKit/mac/WebView/WebHTMLView.mm_sec1
1151
{
1151
{
1152
    NSPoint origin = [[self superview] bounds].origin;
1152
    NSPoint origin = [[self superview] bounds].origin;
1153
    if (!NSEqualPoints(_private->lastScrollPosition, origin)) {
1153
    if (!NSEqualPoints(_private->lastScrollPosition, origin)) {
1154
        if (Frame* coreFrame = core([self _frame]))
1154
        if (Frame* coreFrame = core([self _frame])) {
1155
            coreFrame->eventHandler()->sendScrollEvent();
1155
            if (FrameView* coreView = coreFrame->view())
1156
                coreView->scrollPositionChanged();
1157
        }
1158
    
1156
        [_private->completionController endRevertingChange:NO moveLeft:NO];
1159
        [_private->completionController endRevertingChange:NO moveLeft:NO];
1157
        
1160
        
1158
        WebView *webView = [self _webView];
1161
        WebView *webView = [self _webView];

Return to Bug 29262