• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3  * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #include "config.h"
22 #include "RenderView.h"
23 
24 #include "Document.h"
25 #include "Element.h"
26 #include "FloatQuad.h"
27 #include "Frame.h"
28 #include "FrameView.h"
29 #include "GraphicsContext.h"
30 #include "RenderLayer.h"
31 
32 #ifdef ANDROID_LAYOUT
33 #include "Settings.h"
34 #endif
35 
36 namespace WebCore {
37 
RenderView(Node * node,FrameView * view)38 RenderView::RenderView(Node* node, FrameView* view)
39     : RenderBlock(node)
40     , m_frameView(view)
41     , m_selectionStart(0)
42     , m_selectionEnd(0)
43     , m_selectionStartPos(-1)
44     , m_selectionEndPos(-1)
45     , m_printImages(true)
46     , m_maximalOutlineSize(0)
47     , m_layoutState(0)
48     , m_layoutStateDisableCount(0)
49 {
50     // Clear our anonymous bit, set because RenderObject assumes
51     // any renderer with document as the node is anonymous.
52     setIsAnonymous(false);
53 
54     // init RenderObject attributes
55     setInline(false);
56 
57     m_minPrefWidth = 0;
58     m_maxPrefWidth = 0;
59 
60     setPrefWidthsDirty(true, false);
61 
62     setPositioned(true); // to 0,0 :)
63 
64     // Create a new root layer for our layer hierarchy.
65     m_layer = new (node->document()->renderArena()) RenderLayer(this);
66     setHasLayer(true);
67 }
68 
~RenderView()69 RenderView::~RenderView()
70 {
71 }
72 
calcHeight()73 void RenderView::calcHeight()
74 {
75     if (!printing() && m_frameView)
76         setHeight(viewHeight());
77 }
78 
calcWidth()79 void RenderView::calcWidth()
80 {
81     if (!printing() && m_frameView)
82         setWidth(viewWidth());
83 #ifdef ANDROID_LAYOUT
84     const Settings * settings = document()->settings();
85     ASSERT(settings);
86     if (settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen)
87         m_visibleWidth = m_frameView->screenWidth();
88     if (settings->useWideViewport() && settings->viewportWidth() == -1 && width() < minPrefWidth())
89         setWidth(m_minPrefWidth);
90 #endif
91     m_marginLeft = 0;
92     m_marginRight = 0;
93 }
94 
calcPrefWidths()95 void RenderView::calcPrefWidths()
96 {
97     ASSERT(prefWidthsDirty());
98 
99     RenderBlock::calcPrefWidths();
100 
101     m_maxPrefWidth = m_minPrefWidth;
102 }
103 
layout()104 void RenderView::layout()
105 {
106     if (printing())
107         m_minPrefWidth = m_maxPrefWidth = width();
108 
109     // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
110     bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
111     if (relayoutChildren) {
112         setChildNeedsLayout(true, false);
113         for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
114             if (child->style()->height().isPercent() || child->style()->minHeight().isPercent() || child->style()->maxHeight().isPercent())
115                 child->setChildNeedsLayout(true, false);
116         }
117     }
118 
119     ASSERT(!m_layoutState);
120     LayoutState state;
121     // FIXME: May be better to push a clip and avoid issuing offscreen repaints.
122     state.m_clipped = false;
123     m_layoutState = &state;
124 
125     if (needsLayout())
126         RenderBlock::layout();
127 
128     // Ensure that docWidth() >= width() and docHeight() >= height().
129     setOverflowWidth(width());
130     setOverflowHeight(height());
131 
132     setOverflowWidth(docWidth());
133     setOverflowHeight(docHeight());
134 
135     ASSERT(layoutDelta() == IntSize());
136     ASSERT(m_layoutStateDisableCount == 0);
137     ASSERT(m_layoutState == &state);
138     m_layoutState = 0;
139     setNeedsLayout(false);
140 }
141 
localToAbsolute(FloatPoint localPoint,bool fixed,bool) const142 FloatPoint RenderView::localToAbsolute(FloatPoint localPoint, bool fixed, bool) const
143 {
144     // This disables the css position:fixed to the Browser window. Instead
145     // the fixed element will be always fixed to the top page.
146 #ifndef ANDROID_DISABLE_POSITION_FIXED
147     if (fixed && m_frameView)
148         localPoint += m_frameView->scrollOffset();
149 #endif
150     return localPoint;
151 }
152 
absoluteToLocal(FloatPoint containerPoint,bool fixed,bool) const153 FloatPoint RenderView::absoluteToLocal(FloatPoint containerPoint, bool fixed, bool) const
154 {
155     // This disables the css position:fixed to the Browser window. Instead
156     // the fixed element will be always fixed to the top page.
157 #ifndef ANDROID_DISABLE_POSITION_FIXED
158     if (fixed && m_frameView)
159         containerPoint -= m_frameView->scrollOffset();
160 #endif
161     return containerPoint;
162 }
163 
localToContainerQuad(const FloatQuad & localQuad,RenderBox * repaintContainer,bool fixed) const164 FloatQuad RenderView::localToContainerQuad(const FloatQuad& localQuad, RenderBox* repaintContainer, bool fixed) const
165 {
166     // If a container was specified, and was not 0 or the RenderView,
167     // then we should have found it by now.
168     ASSERT_UNUSED(repaintContainer, !repaintContainer || repaintContainer == this);
169 
170     FloatQuad quad = localQuad;
171     if (fixed && m_frameView)
172         quad += m_frameView->scrollOffset();
173 
174     return quad;
175 }
176 
paint(PaintInfo & paintInfo,int tx,int ty)177 void RenderView::paint(PaintInfo& paintInfo, int tx, int ty)
178 {
179     // If we ever require layout but receive a paint anyway, something has gone horribly wrong.
180     ASSERT(!needsLayout());
181 
182     // Cache the print rect because the dirty rect could get changed during painting.
183     if (printing())
184         setPrintRect(paintInfo.rect);
185     else
186         setPrintRect(IntRect());
187     paintObject(paintInfo, tx, ty);
188 }
189 
rendererObscuresBackground(RenderObject * object)190 static inline bool rendererObscuresBackground(RenderObject* object)
191 {
192     return object && object->style()->visibility() == VISIBLE && object->style()->opacity() == 1 && !object->style()->hasTransform();
193 }
194 
paintBoxDecorations(PaintInfo & paintInfo,int,int)195 void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int, int)
196 {
197     // Check to see if we are enclosed by a layer that requires complex painting rules.  If so, we cannot blit
198     // when scrolling, and we need to use slow repaints.  Examples of layers that require this are transparent layers,
199     // layers with reflections, or transformed layers.
200     // FIXME: This needs to be dynamic.  We should be able to go back to blitting if we ever stop being inside
201     // a transform, transparency layer, etc.
202     Element* elt;
203     for (elt = document()->ownerElement(); view() && elt && elt->renderer(); elt = elt->document()->ownerElement()) {
204         RenderLayer* layer = elt->renderer()->enclosingLayer();
205         if (layer->requiresSlowRepaints()) {
206             frameView()->setUseSlowRepaints();
207             break;
208         }
209     }
210 
211     // If painting will entirely fill the view, no need to fill the background.
212     if (elt || rendererObscuresBackground(firstChild()) || !view())
213         return;
214 
215     // This code typically only executes if the root element's visibility has been set to hidden,
216     // or there is a transform on the <html>.
217     // Only fill with the base background color (typically white) if we're the root document,
218     // since iframes/frames with no background in the child document should show the parent's background.
219     if (view()->isTransparent()) // FIXME: This needs to be dynamic.  We should be able to go back to blitting if we ever stop being transparent.
220         frameView()->setUseSlowRepaints(); // The parent must show behind the child.
221     else {
222         Color baseColor = frameView()->baseBackgroundColor();
223         if (baseColor.alpha() > 0) {
224             paintInfo.context->save();
225             paintInfo.context->setCompositeOperation(CompositeCopy);
226             paintInfo.context->fillRect(paintInfo.rect, baseColor);
227             paintInfo.context->restore();
228         } else
229             paintInfo.context->clearRect(paintInfo.rect);
230     }
231 }
232 
repaintViewRectangle(const IntRect & ur,bool immediate)233 void RenderView::repaintViewRectangle(const IntRect& ur, bool immediate)
234 {
235     if (printing() || ur.width() == 0 || ur.height() == 0)
236         return;
237 
238     if (!m_frameView)
239         return;
240 
241     // We always just invalidate the root view, since we could be an iframe that is clipped out
242     // or even invisible.
243     Element* elt = document()->ownerElement();
244     if (!elt)
245         m_frameView->repaintContentRectangle(ur, immediate);
246     else if (RenderBox* obj = elt->renderBox()) {
247         IntRect vr = viewRect();
248         IntRect r = intersection(ur, vr);
249 
250         // Subtract out the contentsX and contentsY offsets to get our coords within the viewing
251         // rectangle.
252         r.move(-vr.x(), -vr.y());
253 
254         // FIXME: Hardcoded offsets here are not good.
255         r.move(obj->borderLeft() + obj->paddingLeft(),
256                obj->borderTop() + obj->paddingTop());
257         obj->repaintRectangle(r, immediate);
258     }
259 }
260 
computeRectForRepaint(IntRect & rect,RenderBox * repaintContainer,bool fixed)261 void RenderView::computeRectForRepaint(IntRect& rect, RenderBox* repaintContainer, bool fixed)
262 {
263     // If a container was specified, and was not 0 or the RenderView,
264     // then we should have found it by now.
265     ASSERT_UNUSED(repaintContainer, !repaintContainer || repaintContainer == this);
266 
267     if (printing())
268         return;
269 
270     if (fixed && m_frameView)
271         rect.move(m_frameView->scrollX(), m_frameView->scrollY());
272 
273     // Apply our transform if we have one (because of full page zooming).
274     if (m_layer && m_layer->transform())
275         rect = m_layer->transform()->mapRect(rect);
276 }
277 
absoluteRects(Vector<IntRect> & rects,int tx,int ty,bool)278 void RenderView::absoluteRects(Vector<IntRect>& rects, int tx, int ty, bool)
279 {
280     rects.append(IntRect(tx, ty, m_layer->width(), m_layer->height()));
281 }
282 
absoluteQuads(Vector<FloatQuad> & quads,bool)283 void RenderView::absoluteQuads(Vector<FloatQuad>& quads, bool)
284 {
285     quads.append(FloatRect(0, 0, m_layer->width(), m_layer->height()));
286 }
287 
rendererAfterPosition(RenderObject * object,unsigned offset)288 static RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset)
289 {
290     if (!object)
291         return 0;
292 
293     RenderObject* child = object->childAt(offset);
294     return child ? child : object->nextInPreOrderAfterChildren();
295 }
296 
selectionRect(bool clipToVisibleContent)297 IntRect RenderView::selectionRect(bool clipToVisibleContent)
298 {
299     // The virtual selectionRect() should never be called on the RenderView.
300     // We assert because there used to be ambiguity between
301     // RenderView::selectionRect(bool) and
302     // virtual RenderObject::selectionRect(bool) const
303     ASSERT_NOT_REACHED();
304     return RenderBlock::selectionRect(clipToVisibleContent);
305 }
306 
selectionBounds(bool clipToVisibleContent) const307 IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
308 {
309     document()->updateRendering();
310 
311     typedef HashMap<RenderObject*, SelectionInfo*> SelectionMap;
312     SelectionMap selectedObjects;
313 
314     RenderObject* os = m_selectionStart;
315     RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
316     while (os && os != stop) {
317         if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
318             // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
319             selectedObjects.set(os, new SelectionInfo(os, clipToVisibleContent));
320             RenderBlock* cb = os->containingBlock();
321             while (cb && !cb->isRenderView()) {
322                 SelectionInfo* blockInfo = selectedObjects.get(cb);
323                 if (blockInfo)
324                     break;
325                 selectedObjects.set(cb, new SelectionInfo(cb, clipToVisibleContent));
326                 cb = cb->containingBlock();
327             }
328         }
329 
330         os = os->nextInPreOrder();
331     }
332 
333     // Now create a single bounding box rect that encloses the whole selection.
334     IntRect selRect;
335     SelectionMap::iterator end = selectedObjects.end();
336     for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) {
337         SelectionInfo* info = i->second;
338         selRect.unite(info->rect());
339         delete info;
340     }
341     return selRect;
342 }
343 
setSelection(RenderObject * start,int startPos,RenderObject * end,int endPos)344 void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* end, int endPos)
345 {
346     // Make sure both our start and end objects are defined.
347     // Check www.msnbc.com and try clicking around to find the case where this happened.
348     if ((start && !end) || (end && !start))
349         return;
350 
351     // Just return if the selection hasn't changed.
352     if (m_selectionStart == start && m_selectionStartPos == startPos &&
353         m_selectionEnd == end && m_selectionEndPos == endPos)
354         return;
355 
356     // Record the old selected objects.  These will be used later
357     // when we compare against the new selected objects.
358     int oldStartPos = m_selectionStartPos;
359     int oldEndPos = m_selectionEndPos;
360 
361     // Objects each have a single selection rect to examine.
362     typedef HashMap<RenderObject*, SelectionInfo*> SelectedObjectMap;
363     SelectedObjectMap oldSelectedObjects;
364     SelectedObjectMap newSelectedObjects;
365 
366     // Blocks contain selected objects and fill gaps between them, either on the left, right, or in between lines and blocks.
367     // In order to get the repaint rect right, we have to examine left, middle, and right rects individually, since otherwise
368     // the union of those rects might remain the same even when changes have occurred.
369     typedef HashMap<RenderBlock*, BlockSelectionInfo*> SelectedBlockMap;
370     SelectedBlockMap oldSelectedBlocks;
371     SelectedBlockMap newSelectedBlocks;
372 
373     RenderObject* os = m_selectionStart;
374     RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
375     while (os && os != stop) {
376         if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
377             // Blocks are responsible for painting line gaps and margin gaps.  They must be examined as well.
378             oldSelectedObjects.set(os, new SelectionInfo(os, true));
379             RenderBlock* cb = os->containingBlock();
380             while (cb && !cb->isRenderView()) {
381                 BlockSelectionInfo* blockInfo = oldSelectedBlocks.get(cb);
382                 if (blockInfo)
383                     break;
384                 oldSelectedBlocks.set(cb, new BlockSelectionInfo(cb));
385                 cb = cb->containingBlock();
386             }
387         }
388 
389         os = os->nextInPreOrder();
390     }
391 
392     // Now clear the selection.
393     SelectedObjectMap::iterator oldObjectsEnd = oldSelectedObjects.end();
394     for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObjectsEnd; ++i)
395         i->first->setSelectionState(SelectionNone);
396 
397     // set selection start and end
398     m_selectionStart = start;
399     m_selectionStartPos = startPos;
400     m_selectionEnd = end;
401     m_selectionEndPos = endPos;
402 
403     // Update the selection status of all objects between m_selectionStart and m_selectionEnd
404     if (start && start == end)
405         start->setSelectionState(SelectionBoth);
406     else {
407         if (start)
408             start->setSelectionState(SelectionStart);
409         if (end)
410             end->setSelectionState(SelectionEnd);
411     }
412 
413     RenderObject* o = start;
414     stop = rendererAfterPosition(end, endPos);
415 
416     while (o && o != stop) {
417         if (o != start && o != end && o->canBeSelectionLeaf())
418             o->setSelectionState(SelectionInside);
419         o = o->nextInPreOrder();
420     }
421 
422     // Now that the selection state has been updated for the new objects, walk them again and
423     // put them in the new objects list.
424     o = start;
425     while (o && o != stop) {
426         if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) {
427             newSelectedObjects.set(o, new SelectionInfo(o, true));
428             RenderBlock* cb = o->containingBlock();
429             while (cb && !cb->isRenderView()) {
430                 BlockSelectionInfo* blockInfo = newSelectedBlocks.get(cb);
431                 if (blockInfo)
432                     break;
433                 newSelectedBlocks.set(cb, new BlockSelectionInfo(cb));
434                 cb = cb->containingBlock();
435             }
436         }
437 
438         o = o->nextInPreOrder();
439     }
440 
441     if (!m_frameView) {
442         // We built the maps, but we aren't going to use them.
443         // We need to delete the values, otherwise they'll all leak!
444         deleteAllValues(oldSelectedObjects);
445         deleteAllValues(newSelectedObjects);
446         deleteAllValues(oldSelectedBlocks);
447         deleteAllValues(newSelectedBlocks);
448         return;
449     }
450 
451     // Have any of the old selected objects changed compared to the new selection?
452     for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObjectsEnd; ++i) {
453         RenderObject* obj = i->first;
454         SelectionInfo* newInfo = newSelectedObjects.get(obj);
455         SelectionInfo* oldInfo = i->second;
456         if (!newInfo || oldInfo->rect() != newInfo->rect() || oldInfo->state() != newInfo->state() ||
457             (m_selectionStart == obj && oldStartPos != m_selectionStartPos) ||
458             (m_selectionEnd == obj && oldEndPos != m_selectionEndPos)) {
459             repaintViewRectangle(oldInfo->rect());
460             if (newInfo) {
461                 repaintViewRectangle(newInfo->rect());
462                 newSelectedObjects.remove(obj);
463                 delete newInfo;
464             }
465         }
466         delete oldInfo;
467     }
468 
469     // Any new objects that remain were not found in the old objects dict, and so they need to be updated.
470     SelectedObjectMap::iterator newObjectsEnd = newSelectedObjects.end();
471     for (SelectedObjectMap::iterator i = newSelectedObjects.begin(); i != newObjectsEnd; ++i) {
472         SelectionInfo* newInfo = i->second;
473         repaintViewRectangle(newInfo->rect());
474         delete newInfo;
475     }
476 
477     // Have any of the old blocks changed?
478     SelectedBlockMap::iterator oldBlocksEnd = oldSelectedBlocks.end();
479     for (SelectedBlockMap::iterator i = oldSelectedBlocks.begin(); i != oldBlocksEnd; ++i) {
480         RenderBlock* block = i->first;
481         BlockSelectionInfo* newInfo = newSelectedBlocks.get(block);
482         BlockSelectionInfo* oldInfo = i->second;
483         if (!newInfo || oldInfo->rects() != newInfo->rects() || oldInfo->state() != newInfo->state()) {
484             repaintViewRectangle(oldInfo->rects());
485             if (newInfo) {
486                 repaintViewRectangle(newInfo->rects());
487                 newSelectedBlocks.remove(block);
488                 delete newInfo;
489             }
490         }
491         delete oldInfo;
492     }
493 
494     // Any new blocks that remain were not found in the old blocks dict, and so they need to be updated.
495     SelectedBlockMap::iterator newBlocksEnd = newSelectedBlocks.end();
496     for (SelectedBlockMap::iterator i = newSelectedBlocks.begin(); i != newBlocksEnd; ++i) {
497         BlockSelectionInfo* newInfo = i->second;
498         repaintViewRectangle(newInfo->rects());
499         delete newInfo;
500     }
501 }
502 
clearSelection()503 void RenderView::clearSelection()
504 {
505     setSelection(0, -1, 0, -1);
506 }
507 
selectionStartEnd(int & startPos,int & endPos) const508 void RenderView::selectionStartEnd(int& startPos, int& endPos) const
509 {
510     startPos = m_selectionStartPos;
511     endPos = m_selectionEndPos;
512 }
513 
printing() const514 bool RenderView::printing() const
515 {
516     return document()->printing();
517 }
518 
updateWidgetPositions()519 void RenderView::updateWidgetPositions()
520 {
521     RenderObjectSet::iterator end = m_widgets.end();
522     for (RenderObjectSet::iterator it = m_widgets.begin(); it != end; ++it)
523         (*it)->updateWidgetPosition();
524 }
525 
addWidget(RenderObject * o)526 void RenderView::addWidget(RenderObject* o)
527 {
528     m_widgets.add(o);
529 }
530 
removeWidget(RenderObject * o)531 void RenderView::removeWidget(RenderObject* o)
532 {
533     m_widgets.remove(o);
534 }
535 
viewRect() const536 IntRect RenderView::viewRect() const
537 {
538     if (printing())
539         return IntRect(0, 0, width(), height());
540     if (m_frameView)
541         return m_frameView->visibleContentRect();
542     return IntRect();
543 }
544 
docHeight() const545 int RenderView::docHeight() const
546 {
547     int h = height();
548     int lowestPos = lowestPosition();
549     if (lowestPos > h)
550         h = lowestPos;
551 
552     // FIXME: This doesn't do any margin collapsing.
553     // Instead of this dh computation we should keep the result
554     // when we call RenderBlock::layout.
555     int dh = 0;
556     for (RenderBox* c = firstChildBox(); c; c = c->nextSiblingBox())
557         dh += c->height() + c->marginTop() + c->marginBottom();
558 
559     if (dh > h)
560         h = dh;
561 
562     return h;
563 }
564 
docWidth() const565 int RenderView::docWidth() const
566 {
567     int w = width();
568     int rightmostPos = rightmostPosition();
569     if (rightmostPos > w)
570         w = rightmostPos;
571 
572     for (RenderBox* c = firstChildBox(); c; c = c->nextSiblingBox()) {
573         int dw = c->width() + c->marginLeft() + c->marginRight();
574         if (dw > w)
575             w = dw;
576     }
577 
578     return w;
579 }
580 
viewHeight() const581 int RenderView::viewHeight() const
582 {
583     int height = 0;
584     if (!printing() && m_frameView) {
585         height = m_frameView->layoutHeight();
586         height = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(height)) : height;
587     }
588     return height;
589 }
590 
viewWidth() const591 int RenderView::viewWidth() const
592 {
593     int width = 0;
594     if (!printing() && m_frameView) {
595         width = m_frameView->layoutWidth();
596         width = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(width)) : width;
597     }
598     return width;
599 }
600 
601 // The idea here is to take into account what object is moving the pagination point, and
602 // thus choose the best place to chop it.
setBestTruncatedAt(int y,RenderBox * forRenderer,bool forcedBreak)603 void RenderView::setBestTruncatedAt(int y, RenderBox* forRenderer, bool forcedBreak)
604 {
605     // Nobody else can set a page break once we have a forced break.
606     if (m_forcedPageBreak)
607         return;
608 
609     // Forced breaks always win over unforced breaks.
610     if (forcedBreak) {
611         m_forcedPageBreak = true;
612         m_bestTruncatedAt = y;
613         return;
614     }
615 
616     // prefer the widest object who tries to move the pagination point
617     if (forRenderer->width() > m_truncatorWidth) {
618         m_truncatorWidth = forRenderer->width();
619         m_bestTruncatedAt = y;
620     }
621 }
622 
pushLayoutState(RenderObject * root)623 void RenderView::pushLayoutState(RenderObject* root)
624 {
625     ASSERT(!doingFullRepaint());
626     ASSERT(m_layoutStateDisableCount == 0);
627     ASSERT(m_layoutState == 0);
628 
629     m_layoutState = new (renderArena()) LayoutState(root);
630 }
631 
632 } // namespace WebCore
633