Changeset 84454 in webkit


Ignore:
Timestamp:
Apr 20, 2011 7:13:10 PM (13 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/9095366> With a non-1 page scale, scrolling to reveal selection fails
https://bugs.webkit.org/show_bug.cgi?id=59046

Reviewed by Maciej Stachowiak.

Source/WebCore:

Test: fast/transforms/selection-bounds-in-transformed-view.html

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::repaintUsingContainer): If the repaint container is the RenderView, and
it has a composited layer that paints straight to the window, then translate from view coordinates
to window coordinates here.

  • rendering/RenderView.cpp:

(WebCore::RenderView::mapLocalToContainer): Do not apply our transform if we are the painting root.
(WebCore::RenderView::computeRectForRepaint): Ditto. Applying the transform here was compensating
for not applying it in RenderObject::repaintUsingContainer(), but for purposes other than repainting,
such as computing selection bounds, this function was returning the wrong results.

LayoutTests:

  • fast/transforms/selection-bounds-in-transformed-view-expected.txt: Added.
  • fast/transforms/selection-bounds-in-transformed-view.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84451 r84454  
     12011-04-20  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        <rdar://problem/9095366> With a non-1 page scale, scrolling to reveal selection fails
     6        https://bugs.webkit.org/show_bug.cgi?id=59046
     7
     8        * fast/transforms/selection-bounds-in-transformed-view-expected.txt: Added.
     9        * fast/transforms/selection-bounds-in-transformed-view.html: Added.
     10
    1112011-04-20  Dirk Pranke  <dpranke@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r84452 r84454  
     12011-04-20  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        <rdar://problem/9095366> With a non-1 page scale, scrolling to reveal selection fails
     6        https://bugs.webkit.org/show_bug.cgi?id=59046
     7
     8        Test: fast/transforms/selection-bounds-in-transformed-view.html
     9
     10        * rendering/RenderObject.cpp:
     11        (WebCore::RenderObject::repaintUsingContainer): If the repaint container is the RenderView, and
     12        it has a composited layer that paints straight to the window, then translate from view coordinates
     13        to window coordinates here.
     14        * rendering/RenderView.cpp:
     15        (WebCore::RenderView::mapLocalToContainer): Do not apply our transform if we are the painting root.
     16        (WebCore::RenderView::computeRectForRepaint): Ditto. Applying the transform here was compensating
     17        for not applying it in RenderObject::repaintUsingContainer(), but for purposes other than repainting,
     18        such as computing selection bounds, this function was returning the wrong results.
     19
    1202011-04-20  Dan Bernstein  <mitz@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r84273 r84454  
    11581158    if (repaintContainer->isRenderView()) {
    11591159        ASSERT(repaintContainer == v);
    1160         if (!v->hasLayer() || !v->layer()->isComposited() || v->layer()->backing()->paintingGoesToWindow()) {
    1161             v->repaintViewRectangle(r, immediate);
     1160        bool viewHasCompositedLayer = v->hasLayer() && v->layer()->isComposited();
     1161        if (!viewHasCompositedLayer || v->layer()->backing()->paintingGoesToWindow()) {
     1162            IntRect repaintRectangle = r;
     1163            if (viewHasCompositedLayer &&  v->layer()->transform())
     1164                repaintRectangle = v->layer()->transform()->mapRect(r);
     1165            v->repaintViewRectangle(repaintRectangle, immediate);
    11621166            return;
    11631167        }
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r83140 r84454  
    141141    // If a container was specified, and was not 0 or the RenderView,
    142142    // then we should have found it by now.
    143     ASSERT_UNUSED(repaintContainer, !repaintContainer || repaintContainer == this);
    144 
    145     if (useTransforms && shouldUseTransformFromContainer(0)) {
     143    ASSERT_ARG(repaintContainer, !repaintContainer || repaintContainer == this);
     144
     145    if (!repaintContainer && useTransforms && shouldUseTransformFromContainer(0)) {
    146146        TransformationMatrix t;
    147147        getTransformFromContainer(0, IntSize(), t);
     
    300300    // If a container was specified, and was not 0 or the RenderView,
    301301    // then we should have found it by now.
    302     ASSERT_UNUSED(repaintContainer, !repaintContainer || repaintContainer == this);
     302    ASSERT_ARG(repaintContainer, !repaintContainer || repaintContainer == this);
    303303
    304304    if (printing())
     
    318318       
    319319    // Apply our transform if we have one (because of full page zooming).
    320     if (m_layer && m_layer->transform())
     320    if (!repaintContainer && m_layer && m_layer->transform())
    321321        rect = m_layer->transform()->mapRect(rect);
    322322}
Note: See TracChangeset for help on using the changeset viewer.