~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to WebCore/page/FrameView.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *                     1999 Lars Knoll <knoll@kde.org>
4
4
 *                     1999 Antti Koivisto <koivisto@kde.org>
5
5
 *                     2000 Dirk Mueller <mueller@kde.org>
6
 
 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
 
6
 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
7
7
 *           (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8
8
 *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9
9
 * Copyright (C) 2009 Google Inc. All rights reserved.
29
29
 
30
30
#include "AXObjectCache.h"
31
31
#include "CSSStyleSelector.h"
 
32
#include "Chrome.h"
32
33
#include "ChromeClient.h"
33
34
#include "DocLoader.h"
34
35
#include "EventHandler.h"
345
346
    // Try the <body> element first as a scrollbar source.
346
347
    Element* body = doc ? doc->body() : 0;
347
348
    if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(SCROLLBAR))
348
 
        return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderBox());
 
349
        return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderer()->enclosingBox());
349
350
    
350
351
    // If the <body> didn't have a custom style, then the root element might.
351
352
    Element* docElement = doc ? doc->documentElement() : 0;
604
605
                vMode = ScrollbarAlwaysOff;
605
606
                hMode = ScrollbarAlwaysOff;
606
607
            } else if (body->hasTagName(bodyTag)) {
607
 
                if (!m_firstLayout && m_size.height() != layoutHeight()
608
 
                        && toRenderBox(body->renderer())->stretchesToViewHeight())
 
608
                if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewHeight())
609
609
                    body->renderer()->setChildNeedsLayout(true);
610
610
                // It's sufficient to just check the X overflow,
611
611
                // since it's illegal to have visible in only one direction.
658
658
 
659
659
    pauseScheduledEvents();
660
660
 
661
 
    if (subtree)
662
 
        root->view()->pushLayoutState(root);
 
661
    bool disableLayoutState = false;
 
662
    if (subtree) {
 
663
        RenderView* view = root->view();
 
664
        disableLayoutState = view->shouldDisableLayoutStateForSubtree(root);
 
665
        view->pushLayoutState(root);
 
666
        if (disableLayoutState)
 
667
            view->disableLayoutState();
 
668
    }
663
669
        
664
670
    m_midLayout = true;
665
671
    beginDeferredRepaints();
667
673
    endDeferredRepaints();
668
674
    m_midLayout = false;
669
675
 
670
 
    if (subtree)
671
 
        root->view()->popLayoutState();
 
676
    if (subtree) {
 
677
        RenderView* view = root->view();
 
678
        view->popLayoutState();
 
679
        if (disableLayoutState)
 
680
            view->enableLayoutState();
 
681
    }
672
682
    m_layoutRoot = 0;
673
683
 
674
 
    m_frame->invalidateSelection();
 
684
    m_frame->selection()->setNeedsLayout();
 
685
    m_frame->selectionLayoutChanged();
675
686
   
676
687
    m_layoutSchedulingEnabled = true;
677
688
 
949
960
 
950
961
    double delay = adjustedDeferredRepaintDelay();
951
962
    if ((m_deferringRepaints || m_deferredRepaintTimer.isActive() || delay) && !immediate) {
952
 
        IntRect visibleContent = visibleContentRect();
953
 
        visibleContent.intersect(r);
954
 
        if (visibleContent.isEmpty())
 
963
        IntRect paintRect = r;
 
964
        if (!paintsEntireContents())
 
965
            paintRect.intersect(visibleContentRect());
 
966
        if (paintRect.isEmpty())
955
967
            return;
956
968
        if (m_repaintCount == cRepaintRectUnionThreshold) {
957
969
            IntRect unionedRect;
961
973
            m_repaintRects.append(unionedRect);
962
974
        }
963
975
        if (m_repaintCount < cRepaintRectUnionThreshold)
964
 
            m_repaintRects.append(visibleContent);
 
976
            m_repaintRects.append(paintRect);
965
977
        else
966
 
            m_repaintRects[0].unite(visibleContent);
 
978
            m_repaintRects[0].unite(paintRect);
967
979
        m_repaintCount++;
968
980
    
969
981
        if (!m_deferringRepaints && !m_deferredRepaintTimer.isActive())
1196
1208
        || m_layoutRoot
1197
1209
        || (document && document->childNeedsStyleRecalc()) // can occur when using WebKit ObjC interface
1198
1210
        || m_frame->needsReapplyStyles()
1199
 
        || (m_deferSetNeedsLayouts && m_setNeedsLayoutWasDeferred);
 
1211
        || (m_deferSetNeedsLayouts && m_setNeedsLayoutWasDeferred)
 
1212
        || m_frame->selection()->needsDisplayUpdate();
1200
1213
}
1201
1214
 
1202
1215
void FrameView::setNeedsLayout()
1698
1711
        
1699
1712
    // m_nodeToDraw is used to draw only one element (and its descendants)
1700
1713
    RenderObject* eltRenderer = m_nodeToDraw ? m_nodeToDraw->renderer() : 0;
1701
 
    if (m_paintBehavior == PaintBehaviorNormal)
 
1714
 
 
1715
    PaintBehavior paintBehavior = m_paintBehavior;
 
1716
    if (paintBehavior == PaintBehaviorNormal)
1702
1717
        document->invalidateRenderedRectsForMarkersInRect(rect);
1703
 
    contentRenderer->layer()->paint(p, rect, m_paintBehavior, eltRenderer);
 
1718
 
 
1719
    if (document->printing())
 
1720
        paintBehavior |= PaintBehaviorFlattenCompositingLayers;
 
1721
 
 
1722
    contentRenderer->layer()->paint(p, rect, paintBehavior, eltRenderer);
1704
1723
    
1705
1724
    m_isPainting = false;
1706
1725
    m_lastPaintTime = currentTime();