⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 126840 in webkit


Ignore:
Timestamp:
Aug 27, 2012, 9:26:48 PM (14 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=94848
When paged-x/y is specified on the root, columnGap is ignored, and garbage pixels
are likely

Source/WebCore:

Reviewed by Dan Bernstein.

We used to call setPagination() from applyOverflowToViewport(), but that is too
late. We want to setPagination() before we actually lay anything out so that all
of the styles (including columnGap!) will be properly set on the RenderView.

No longer handle pagination here since we take care of it in
applyPaginationToViewport()

  • page/FrameView.cpp:

(WebCore::FrameView::applyOverflowToViewport):

New function to call setPagination(). This function gets the appropriate renderer
and uses its RenderStyle to determine if pagination should be set.
(WebCore::FrameView::applyPaginationToViewport):
(WebCore):

Call applyPaginationToViewport() before the call to updateStyleIfNeeded().
(WebCore::FrameView::layout):

This code was meant to prevent garbage pixels in column gaps for pagination on the
RenderView, but paintContents() does not always get called when we paint into
tiles, so I moved this code to RenderView.
(WebCore::FrameView::paintContents):

  • page/FrameView.h:

(FrameView):

The code from RenderView::paintContents() to prevent garbage pixels is moved here.

  • rendering/RenderView.cpp:

(WebCore::RenderView::paint):

LayoutTests:

Reviewed by Dan Bernsetin.

New tests.

  • fast/overflow/paged-x-div-with-column-gap.html: Added.
  • fast/overflow/paged-x-with-column-gap.html: Added.
  • platform/mac/fast/overflow/paged-x-div-with-column-gap-expected.png: Added.
  • platform/mac/fast/overflow/paged-x-div-with-column-gap-expected.txt: Added.
  • platform/mac/fast/overflow/paged-x-with-column-gap-expected.png: Added.
  • platform/mac/fast/overflow/paged-x-with-column-gap-expected.txt: Added.

Updated results needed for Chromium.

  • platform/chromium/TestExpectations:
Location:
trunk
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126839 r126840  
     12012-08-27  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94848
     4        When paged-x/y is specified on the root, columnGap is ignored, and garbage pixels
     5        are likely
     6
     7        Reviewed by Dan Bernsetin.
     8
     9        New tests.
     10        * fast/overflow/paged-x-div-with-column-gap.html: Added.
     11        * fast/overflow/paged-x-with-column-gap.html: Added.
     12        * platform/mac/fast/overflow/paged-x-div-with-column-gap-expected.png: Added.
     13        * platform/mac/fast/overflow/paged-x-div-with-column-gap-expected.txt: Added.
     14        * platform/mac/fast/overflow/paged-x-with-column-gap-expected.png: Added.
     15        * platform/mac/fast/overflow/paged-x-with-column-gap-expected.txt: Added.
     16
     17        Updated results needed for Chromium.
     18        * platform/chromium/TestExpectations:
     19
    1202012-08-27  Kent Tamura  <tkent@chromium.org>
    221
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r126832 r126840  
    34673467BUGCR67540 BUGWK94735 LINUX : fast/text/emphasis-overlap.html = IMAGE IMAGE+TEXT
    34683468
     3469BUGWK95167 : fast/overflow/paged-x-with-column-gap.html = IMAGE IMAGE+TEXT TEXT MISSING
     3470BUGWK95167 : fast/overflow/paged-x-div-with-column-gap.html = IMAGE IMAGE+TEXT TEXT MISSING
     3471
    34693472BUGWK94793 : fast/notifications/notifications-event-listener-crash.html = TEXT PASS
    34703473
  • trunk/Source/WebCore/ChangeLog

    r126839 r126840  
     12012-08-27  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94848
     4        When paged-x/y is specified on the root, columnGap is ignored, and garbage pixels
     5        are likely
     6
     7        Reviewed by Dan Bernstein.
     8
     9        We used to call setPagination() from applyOverflowToViewport(), but that is too
     10        late. We want to setPagination() before we actually lay anything out so that all
     11        of the styles (including columnGap!) will be properly set on the RenderView.
     12
     13        No longer handle pagination here since we take care of it in
     14        applyPaginationToViewport()       
     15        * page/FrameView.cpp:
     16        (WebCore::FrameView::applyOverflowToViewport):
     17
     18        New function to call setPagination(). This function gets the appropriate renderer
     19        and uses its RenderStyle to determine if pagination should be set.
     20        (WebCore::FrameView::applyPaginationToViewport):
     21        (WebCore):
     22
     23        Call applyPaginationToViewport() before the call to updateStyleIfNeeded().
     24        (WebCore::FrameView::layout):
     25
     26        This code was meant to prevent garbage pixels in column gaps for pagination on the
     27        RenderView, but paintContents() does not always get called when we paint into
     28        tiles, so I moved this code to RenderView.
     29        (WebCore::FrameView::paintContents):
     30        * page/FrameView.h:
     31        (FrameView):
     32
     33        The code from RenderView::paintContents() to prevent garbage pixels is moved here.
     34        * rendering/RenderView.cpp:
     35        (WebCore::RenderView::paint):
     36
    1372012-08-27  Kent Tamura  <tkent@chromium.org>
    238
  • trunk/Source/WebCore/page/FrameView.cpp

    r126774 r126840  
    610610            ;
    611611    }
    612 
    613     Pagination pagination;
    614612   
    615613     switch (overflowY) {
     
    626624            vMode = ScrollbarAuto;
    627625            break;
    628         case OPAGEDX:
    629             pagination.mode = WebCore::paginationModeForRenderStyle(o->style());
    630             break;
    631         case OPAGEDY:
    632             pagination.mode = WebCore::paginationModeForRenderStyle(o->style());
    633             break;
    634626        default:
    635             // Don't set it at all.
     627            // Don't set it at all. Values of OPAGEDX and OPAGEDY are handled by applyPaginationToViewPort().
    636628            ;
    637629    }
    638630
     631    m_viewportRenderer = o;
     632}
     633
     634void FrameView::applyPaginationToViewport()
     635{
     636    Document* document = m_frame->document();
     637    Node* documentElement = document->documentElement();
     638    RenderObject* documentRenderer = documentElement ? documentElement->renderer() : 0;
     639    RenderObject* documentOrBodyRenderer = documentRenderer;
     640    Node* body = document->body();
     641    if (body && body->renderer()) {
     642        if (body->hasTagName(bodyTag))
     643            documentOrBodyRenderer = documentRenderer->style()->overflowX() == OVISIBLE && documentElement->hasTagName(htmlTag) ? body->renderer() : documentRenderer;
     644    }
     645
     646    Pagination pagination;
     647
     648    if (!documentOrBodyRenderer) {
     649        setPagination(pagination);
     650        return;
     651    }
     652
     653    EOverflow overflowY = documentOrBodyRenderer->style()->overflowY();
     654    if (overflowY == OPAGEDX || overflowY == OPAGEDY) {
     655        pagination.mode = WebCore::paginationModeForRenderStyle(documentOrBodyRenderer->style());
     656        pagination.gap = static_cast<unsigned>(documentOrBodyRenderer->style()->columnGap());
     657    }
     658
    639659    setPagination(pagination);
    640 
    641     m_viewportRenderer = o;
    642660}
    643661
     
    10361054            document->evaluateMediaQueryList();
    10371055
     1056        // If there is any pagination to apply, it will affect the RenderView's style, so we should
     1057        // take care of that now.
     1058        applyPaginationToViewport();
     1059
    10381060        // Always ensure our style info is up-to-date. This can happen in situations where
    10391061        // the layout beats any sort of style recalc update that needs to occur.
     
    31143136#endif
    31153137
    3116     if (pagination().mode != Pagination::Unpaginated)
    3117         p->fillRect(rect, baseBackgroundColor(), ColorSpaceDeviceRGB);
    3118 
    31193138    bool isTopLevelPainter = !sCurrentPaintTimeStamp;
    31203139    if (isTopLevelPainter)
  • trunk/Source/WebCore/page/FrameView.h

    r126774 r126840  
    383383
    384384    void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
     385    void applyPaginationToViewport();
    385386
    386387    void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r126837 r126840  
    249249    // RenderViews should never be called to paint with an offset not on device pixels.
    250250    ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffset);
     251
     252    // This avoids painting garbage between columns if there is a column gap.
     253    if (m_frameView && m_frameView->pagination().mode != Pagination::Unpaginated)
     254        paintInfo.context->fillRect(paintInfo.rect, m_frameView->baseBackgroundColor(), ColorSpaceDeviceRGB);
     255
    251256    paintObject(paintInfo, paintOffset);
    252257}
Note: See TracChangeset for help on using the changeset viewer.