OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 namespace WebCore { | 48 namespace WebCore { |
49 | 49 |
50 RenderView::RenderView(Document* document) | 50 RenderView::RenderView(Document* document) |
51 : RenderBlockFlow(document) | 51 : RenderBlockFlow(document) |
52 , m_frameView(document->view()) | 52 , m_frameView(document->view()) |
53 , m_selectionStart(0) | 53 , m_selectionStart(0) |
54 , m_selectionEnd(0) | 54 , m_selectionEnd(0) |
55 , m_selectionStartPos(-1) | 55 , m_selectionStartPos(-1) |
56 , m_selectionEndPos(-1) | 56 , m_selectionEndPos(-1) |
57 , m_maximalOutlineSize(0) | |
58 , m_pageLogicalHeight(0) | 57 , m_pageLogicalHeight(0) |
59 , m_pageLogicalHeightChanged(false) | 58 , m_pageLogicalHeightChanged(false) |
60 , m_layoutState(0) | 59 , m_layoutState(0) |
61 , m_layoutStateDisableCount(0) | 60 , m_layoutStateDisableCount(0) |
62 , m_renderQuoteHead(0) | 61 , m_renderQuoteHead(0) |
63 , m_renderCounterCount(0) | 62 , m_renderCounterCount(0) |
64 { | 63 { |
65 // init RenderObject attributes | 64 // init RenderObject attributes |
66 setInline(false); | 65 setInline(false); |
67 | 66 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 579 |
581 // Blocks are responsible for painting line gaps and margin gaps. They m
ust be examined as well. | 580 // Blocks are responsible for painting line gaps and margin gaps. They m
ust be examined as well. |
582 for (RenderBlock* block = o->containingBlock(); block && !block->isRende
rView(); block = block->containingBlock()) { | 581 for (RenderBlock* block = o->containingBlock(); block && !block->isRende
rView(); block = block->containingBlock()) { |
583 if (!processedBlocks.add(block).isNewEntry) | 582 if (!processedBlocks.add(block).isNewEntry) |
584 break; | 583 break; |
585 RenderSelectionInfo(block, true).repaint(); | 584 RenderSelectionInfo(block, true).repaint(); |
586 } | 585 } |
587 } | 586 } |
588 } | 587 } |
589 | 588 |
590 // Compositing layer dimensions take outline size into account, so we have to re
compute layer | |
591 // bounds when it changes. | |
592 // FIXME: This is ugly; it would be nice to have a better way to do this. | |
593 void RenderView::setMaximalOutlineSize(int o) | |
594 { | |
595 if (o != m_maximalOutlineSize) { | |
596 m_maximalOutlineSize = o; | |
597 | |
598 // maximalOutlineSize affects compositing layer dimensions. | |
599 compositor()->setCompositingLayersNeedRebuild(); // FIXME: this reall
y just needs to be a geometry update. | |
600 } | |
601 } | |
602 | |
603 // When exploring the RenderTree looking for the nodes involved in the Selection
, sometimes it's | 589 // When exploring the RenderTree looking for the nodes involved in the Selection
, sometimes it's |
604 // required to change the traversing direction because the "start" position is b
elow the "end" one. | 590 // required to change the traversing direction because the "start" position is b
elow the "end" one. |
605 static inline RenderObject* getNextOrPrevRenderObjectBasedOnDirection(const Rend
erObject* o, const RenderObject* stop, bool& continueExploring, bool& exploringB
ackwards) | 591 static inline RenderObject* getNextOrPrevRenderObjectBasedOnDirection(const Rend
erObject* o, const RenderObject* stop, bool& continueExploring, bool& exploringB
ackwards) |
606 { | 592 { |
607 RenderObject* next; | 593 RenderObject* next; |
608 if (exploringBackwards) { | 594 if (exploringBackwards) { |
609 next = o->previousInPreOrder(); | 595 next = o->previousInPreOrder(); |
610 continueExploring = next && !(next)->isRenderView(); | 596 continueExploring = next && !(next)->isRenderView(); |
611 } else { | 597 } else { |
612 next = o->nextInPreOrder(); | 598 next = o->nextInPreOrder(); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 return viewWidth(IncludeScrollbars) / scale; | 977 return viewWidth(IncludeScrollbars) / scale; |
992 } | 978 } |
993 | 979 |
994 double RenderView::layoutViewportHeight() const | 980 double RenderView::layoutViewportHeight() const |
995 { | 981 { |
996 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 982 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
997 return viewHeight(IncludeScrollbars) / scale; | 983 return viewHeight(IncludeScrollbars) / scale; |
998 } | 984 } |
999 | 985 |
1000 } // namespace WebCore | 986 } // namespace WebCore |
OLD | NEW |