OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 , m_height(0) | 140 , m_height(0) |
141 , m_scrollX(0) | 141 , m_scrollX(0) |
142 , m_scrollY(0) | 142 , m_scrollY(0) |
143 , m_scrollOriginX(0) | 143 , m_scrollOriginX(0) |
144 , m_scrollLeftOverflow(0) | 144 , m_scrollLeftOverflow(0) |
145 , m_scrollWidth(0) | 145 , m_scrollWidth(0) |
146 , m_scrollHeight(0) | 146 , m_scrollHeight(0) |
147 , m_inResizeMode(false) | 147 , m_inResizeMode(false) |
148 , m_posZOrderList(0) | 148 , m_posZOrderList(0) |
149 , m_negZOrderList(0) | 149 , m_negZOrderList(0) |
150 , m_overflowList(0) | 150 , m_normalFlowList(0) |
151 , m_clipRects(0) | 151 , m_clipRects(0) |
152 #ifndef NDEBUG | 152 #ifndef NDEBUG |
153 , m_clipRectsRoot(0) | 153 , m_clipRectsRoot(0) |
154 #endif | 154 #endif |
155 , m_scrollDimensionsDirty(true) | 155 , m_scrollDimensionsDirty(true) |
156 , m_zOrderListsDirty(true) | 156 , m_zOrderListsDirty(true) |
157 , m_overflowListDirty(true) | 157 , m_normalFlowListDirty(true) |
158 , m_isOverflowOnly(shouldBeOverflowOnly()) | 158 , m_isNormalFlowOnly(shouldBeNormalFlowOnly()) |
159 , m_usedTransparency(false) | 159 , m_usedTransparency(false) |
160 , m_paintingInsideReflection(false) | 160 , m_paintingInsideReflection(false) |
161 , m_inOverflowRelayout(false) | 161 , m_inOverflowRelayout(false) |
162 , m_needsFullRepaint(false) | 162 , m_needsFullRepaint(false) |
163 , m_overflowStatusDirty(true) | 163 , m_overflowStatusDirty(true) |
164 , m_visibleContentStatusDirty(true) | 164 , m_visibleContentStatusDirty(true) |
165 , m_hasVisibleContent(false) | 165 , m_hasVisibleContent(false) |
166 , m_visibleDescendantStatusDirty(false) | 166 , m_visibleDescendantStatusDirty(false) |
167 , m_hasVisibleDescendant(false) | 167 , m_hasVisibleDescendant(false) |
168 #if USE(ACCELERATED_COMPOSITING) | 168 #if USE(ACCELERATED_COMPOSITING) |
(...skipping 20 matching lines...) Expand all Loading... |
189 } | 189 } |
190 | 190 |
191 destroyScrollbar(HorizontalScrollbar); | 191 destroyScrollbar(HorizontalScrollbar); |
192 destroyScrollbar(VerticalScrollbar); | 192 destroyScrollbar(VerticalScrollbar); |
193 | 193 |
194 // Child layers will be deleted by their corresponding render objects, so | 194 // Child layers will be deleted by their corresponding render objects, so |
195 // we don't need to delete them ourselves. | 195 // we don't need to delete them ourselves. |
196 | 196 |
197 delete m_posZOrderList; | 197 delete m_posZOrderList; |
198 delete m_negZOrderList; | 198 delete m_negZOrderList; |
199 delete m_overflowList; | 199 delete m_normalFlowList; |
200 delete m_marquee; | 200 delete m_marquee; |
201 | 201 |
202 #if USE(ACCELERATED_COMPOSITING) | 202 #if USE(ACCELERATED_COMPOSITING) |
203 clearBacking(); | 203 clearBacking(); |
204 #endif | 204 #endif |
205 | 205 |
206 // Make sure we have no lingering clip rects. | 206 // Make sure we have no lingering clip rects. |
207 ASSERT(!m_clipRects); | 207 ASSERT(!m_clipRects); |
208 | 208 |
209 if (m_reflection) { | 209 if (m_reflection) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void RenderLayer::setHasVisibleContent(bool b) | 333 void RenderLayer::setHasVisibleContent(bool b) |
334 { | 334 { |
335 if (m_hasVisibleContent == b && !m_visibleContentStatusDirty) | 335 if (m_hasVisibleContent == b && !m_visibleContentStatusDirty) |
336 return; | 336 return; |
337 m_visibleContentStatusDirty = false; | 337 m_visibleContentStatusDirty = false; |
338 m_hasVisibleContent = b; | 338 m_hasVisibleContent = b; |
339 if (m_hasVisibleContent) { | 339 if (m_hasVisibleContent) { |
340 RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint
(); | 340 RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint
(); |
341 m_repaintRect = renderer()->clippedOverflowRectForRepaint(repaintContain
er); | 341 m_repaintRect = renderer()->clippedOverflowRectForRepaint(repaintContain
er); |
342 m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer); | 342 m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer); |
343 if (!isOverflowOnly()) | 343 if (!isNormalFlowOnly()) |
344 dirtyStackingContextZOrderLists(); | 344 dirtyStackingContextZOrderLists(); |
345 } | 345 } |
346 if (parent()) | 346 if (parent()) |
347 parent()->childVisibilityChanged(m_hasVisibleContent); | 347 parent()->childVisibilityChanged(m_hasVisibleContent); |
348 } | 348 } |
349 | 349 |
350 void RenderLayer::dirtyVisibleContentStatus() | 350 void RenderLayer::dirtyVisibleContentStatus() |
351 { | 351 { |
352 m_visibleContentStatusDirty = true; | 352 m_visibleContentStatusDirty = true; |
353 if (parent()) | 353 if (parent()) |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 #if USE(ACCELERATED_COMPOSITING) | 554 #if USE(ACCELERATED_COMPOSITING) |
555 RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const | 555 RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const |
556 { | 556 { |
557 if (includeSelf && isComposited()) | 557 if (includeSelf && isComposited()) |
558 return const_cast<RenderLayer*>(this); | 558 return const_cast<RenderLayer*>(this); |
559 | 559 |
560 // Compositing layers are parented according to stacking order and overflow
list, | 560 // Compositing layers are parented according to stacking order and overflow
list, |
561 // so we have to check whether the parent is a stacking context, or whether | 561 // so we have to check whether the parent is a stacking context, or whether |
562 // the child is overflow-only. | 562 // the child is overflow-only. |
563 bool inOverflowList = isOverflowOnly(); | 563 bool inNormalFlowList = isNormalFlowOnly(); |
564 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 564 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
565 if (curr->isComposited() && (inOverflowList || curr->isStackingContext()
)) | 565 if (curr->isComposited() && (inNormalFlowList || curr->isStackingContext
())) |
566 return curr; | 566 return curr; |
567 | 567 |
568 inOverflowList = curr->isOverflowOnly(); | 568 inNormalFlowList = curr->isNormalFlowOnly(); |
569 } | 569 } |
570 | 570 |
571 return 0; | 571 return 0; |
572 } | 572 } |
573 #endif | 573 #endif |
574 | 574 |
575 IntPoint RenderLayer::absoluteToContents(const IntPoint& absolutePoint) const | 575 IntPoint RenderLayer::absoluteToContents(const IntPoint& absolutePoint) const |
576 { | 576 { |
577 // We don't use convertToLayerCoords because it doesn't know about transform
s | 577 // We don't use convertToLayerCoords because it doesn't know about transform
s |
578 return roundedIntPoint(renderer()->absoluteToLocal(absolutePoint, false, tru
e)); | 578 return roundedIntPoint(renderer()->absoluteToLocal(absolutePoint, false, tru
e)); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 setFirstChild(child); | 703 setFirstChild(child); |
704 | 704 |
705 if (beforeChild) { | 705 if (beforeChild) { |
706 beforeChild->setPreviousSibling(child); | 706 beforeChild->setPreviousSibling(child); |
707 child->setNextSibling(beforeChild); | 707 child->setNextSibling(beforeChild); |
708 } else | 708 } else |
709 setLastChild(child); | 709 setLastChild(child); |
710 | 710 |
711 child->setParent(this); | 711 child->setParent(this); |
712 | 712 |
713 if (child->isOverflowOnly()) | 713 if (child->isNormalFlowOnly()) |
714 dirtyOverflowList(); | 714 dirtyNormalFlowList(); |
715 | 715 |
716 if (!child->isOverflowOnly() || child->firstChild()) { | 716 if (!child->isNormalFlowOnly() || child->firstChild()) { |
717 // Dirty the z-order list in which we are contained. The stackingContex
t() can be null in the | 717 // Dirty the z-order list in which we are contained. The stackingContex
t() can be null in the |
718 // case where we're building up generated content layers. This is ok, s
ince the lists will start | 718 // case where we're building up generated content layers. This is ok, s
ince the lists will start |
719 // off dirty in that case anyway. | 719 // off dirty in that case anyway. |
720 child->dirtyStackingContextZOrderLists(); | 720 child->dirtyStackingContextZOrderLists(); |
721 } | 721 } |
722 | 722 |
723 child->updateVisibilityStatus(); | 723 child->updateVisibilityStatus(); |
724 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) | 724 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) |
725 childVisibilityChanged(true); | 725 childVisibilityChanged(true); |
726 | 726 |
(...skipping 13 matching lines...) Expand all Loading... |
740 if (oldChild->previousSibling()) | 740 if (oldChild->previousSibling()) |
741 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); | 741 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); |
742 if (oldChild->nextSibling()) | 742 if (oldChild->nextSibling()) |
743 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling())
; | 743 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling())
; |
744 | 744 |
745 if (m_first == oldChild) | 745 if (m_first == oldChild) |
746 m_first = oldChild->nextSibling(); | 746 m_first = oldChild->nextSibling(); |
747 if (m_last == oldChild) | 747 if (m_last == oldChild) |
748 m_last = oldChild->previousSibling(); | 748 m_last = oldChild->previousSibling(); |
749 | 749 |
750 if (oldChild->isOverflowOnly()) | 750 if (oldChild->isNormalFlowOnly()) |
751 dirtyOverflowList(); | 751 dirtyNormalFlowList(); |
752 if (!oldChild->isOverflowOnly() || oldChild->firstChild()) { | 752 if (!oldChild->isNormalFlowOnly() || oldChild->firstChild()) { |
753 // Dirty the z-order list in which we are contained. When called via th
e | 753 // Dirty the z-order list in which we are contained. When called via th
e |
754 // reattachment process in removeOnlyThisLayer, the layer may already be
disconnected | 754 // reattachment process in removeOnlyThisLayer, the layer may already be
disconnected |
755 // from the main layer tree, so we need to null-check the |stackingConte
xt| value. | 755 // from the main layer tree, so we need to null-check the |stackingConte
xt| value. |
756 oldChild->dirtyStackingContextZOrderLists(); | 756 oldChild->dirtyStackingContextZOrderLists(); |
757 } | 757 } |
758 | 758 |
759 oldChild->setPreviousSibling(0); | 759 oldChild->setPreviousSibling(0); |
760 oldChild->setNextSibling(0); | 760 oldChild->setNextSibling(0); |
761 oldChild->setParent(0); | 761 oldChild->setParent(0); |
762 | 762 |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 | 1979 |
1980 if (!outlineRect.isEmpty()) { | 1980 if (!outlineRect.isEmpty()) { |
1981 // Paint our own outline | 1981 // Paint our own outline |
1982 RenderObject::PaintInfo paintInfo(p, outlineRect, PaintPhaseSelfOutline,
false, paintingRootForRenderer, 0); | 1982 RenderObject::PaintInfo paintInfo(p, outlineRect, PaintPhaseSelfOutline,
false, paintingRootForRenderer, 0); |
1983 setClip(p, paintDirtyRect, outlineRect); | 1983 setClip(p, paintDirtyRect, outlineRect); |
1984 renderer()->paint(paintInfo, tx, ty); | 1984 renderer()->paint(paintInfo, tx, ty); |
1985 restoreClip(p, paintDirtyRect, outlineRect); | 1985 restoreClip(p, paintDirtyRect, outlineRect); |
1986 } | 1986 } |
1987 | 1987 |
1988 // Paint any child layers that have overflow. | 1988 // Paint any child layers that have overflow. |
1989 if (m_overflowList) | 1989 if (m_normalFlowList) |
1990 for (Vector<RenderLayer*>::iterator it = m_overflowList->begin(); it !=
m_overflowList->end(); ++it) | 1990 for (Vector<RenderLayer*>::iterator it = m_normalFlowList->begin(); it !
= m_normalFlowList->end(); ++it) |
1991 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, pa
intRestriction, paintingRoot, false, temporaryClipRects); | 1991 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, pa
intRestriction, paintingRoot, false, temporaryClipRects); |
1992 | 1992 |
1993 // Now walk the sorted list of children with positive z-indices. | 1993 // Now walk the sorted list of children with positive z-indices. |
1994 if (m_posZOrderList) | 1994 if (m_posZOrderList) |
1995 for (Vector<RenderLayer*>::iterator it = m_posZOrderList->begin(); it !=
m_posZOrderList->end(); ++it) | 1995 for (Vector<RenderLayer*>::iterator it = m_posZOrderList->begin(); it !=
m_posZOrderList->end(); ++it) |
1996 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, pa
intRestriction, paintingRoot, false, temporaryClipRects); | 1996 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, pa
intRestriction, paintingRoot, false, temporaryClipRects); |
1997 | 1997 |
1998 if (renderer()->hasMask() && shouldPaint && !selectionOnly && !damageRect.is
Empty()) { | 1998 if (renderer()->hasMask() && shouldPaint && !selectionOnly && !damageRect.is
Empty()) { |
1999 setClip(p, paintDirtyRect, damageRect); | 1999 setClip(p, paintDirtyRect, damageRect); |
2000 | 2000 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 // z-index. | 2111 // z-index. |
2112 if (m_posZOrderList) { | 2112 if (m_posZOrderList) { |
2113 for (int i = m_posZOrderList->size() - 1; i >= 0; --i) { | 2113 for (int i = m_posZOrderList->size() - 1; i >= 0; --i) { |
2114 insideLayer = m_posZOrderList->at(i)->hitTestLayer(rootLayer, reques
t, result, hitTestRect, hitTestPoint); | 2114 insideLayer = m_posZOrderList->at(i)->hitTestLayer(rootLayer, reques
t, result, hitTestRect, hitTestPoint); |
2115 if (insideLayer) | 2115 if (insideLayer) |
2116 return insideLayer; | 2116 return insideLayer; |
2117 } | 2117 } |
2118 } | 2118 } |
2119 | 2119 |
2120 // Now check our overflow objects. | 2120 // Now check our overflow objects. |
2121 if (m_overflowList) { | 2121 if (m_normalFlowList) { |
2122 for (int i = m_overflowList->size() - 1; i >= 0; --i) { | 2122 for (int i = m_normalFlowList->size() - 1; i >= 0; --i) { |
2123 insideLayer = m_overflowList->at(i)->hitTestLayer(rootLayer, request
, result, hitTestRect, hitTestPoint); | 2123 insideLayer = m_normalFlowList->at(i)->hitTestLayer(rootLayer, reque
st, result, hitTestRect, hitTestPoint); |
2124 if (insideLayer) | 2124 if (insideLayer) |
2125 return insideLayer; | 2125 return insideLayer; |
2126 } | 2126 } |
2127 } | 2127 } |
2128 | 2128 |
2129 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. | 2129 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. |
2130 if (fgRect.contains(hitTestPoint) && | 2130 if (fgRect.contains(hitTestPoint) && |
2131 renderer()->hitTest(request, result, hitTestPoint, | 2131 renderer()->hitTest(request, result, hitTestPoint, |
2132 layerBounds.x() - renderBoxX(), | 2132 layerBounds.x() - renderBoxX(), |
2133 layerBounds.y() - renderBoxY(), | 2133 layerBounds.y() - renderBoxY(), |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 #endif | 2603 #endif |
2604 } | 2604 } |
2605 | 2605 |
2606 void RenderLayer::dirtyStackingContextZOrderLists() | 2606 void RenderLayer::dirtyStackingContextZOrderLists() |
2607 { | 2607 { |
2608 RenderLayer* sc = stackingContext(); | 2608 RenderLayer* sc = stackingContext(); |
2609 if (sc) | 2609 if (sc) |
2610 sc->dirtyZOrderLists(); | 2610 sc->dirtyZOrderLists(); |
2611 } | 2611 } |
2612 | 2612 |
2613 void RenderLayer::dirtyOverflowList() | 2613 void RenderLayer::dirtyNormalFlowList() |
2614 { | 2614 { |
2615 if (m_overflowList) | 2615 if (m_normalFlowList) |
2616 m_overflowList->clear(); | 2616 m_normalFlowList->clear(); |
2617 m_overflowListDirty = true; | 2617 m_normalFlowListDirty = true; |
2618 | 2618 |
2619 #if USE(ACCELERATED_COMPOSITING) | 2619 #if USE(ACCELERATED_COMPOSITING) |
2620 if (!renderer()->documentBeingDestroyed()) | 2620 if (!renderer()->documentBeingDestroyed()) |
2621 compositor()->setCompositingLayersNeedUpdate(); | 2621 compositor()->setCompositingLayersNeedUpdate(); |
2622 #endif | 2622 #endif |
2623 } | 2623 } |
2624 | 2624 |
2625 void RenderLayer::updateZOrderLists() | 2625 void RenderLayer::updateZOrderLists() |
2626 { | 2626 { |
2627 if (!isStackingContext() || !m_zOrderListsDirty) | 2627 if (!isStackingContext() || !m_zOrderListsDirty) |
2628 return; | 2628 return; |
2629 | 2629 |
2630 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 2630 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
2631 if (!m_reflection || reflectionLayer() != child) | 2631 if (!m_reflection || reflectionLayer() != child) |
2632 child->collectLayers(m_posZOrderList, m_negZOrderList); | 2632 child->collectLayers(m_posZOrderList, m_negZOrderList); |
2633 | 2633 |
2634 // Sort the two lists. | 2634 // Sort the two lists. |
2635 if (m_posZOrderList) | 2635 if (m_posZOrderList) |
2636 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), compa
reZIndex); | 2636 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), compa
reZIndex); |
2637 | 2637 |
2638 if (m_negZOrderList) | 2638 if (m_negZOrderList) |
2639 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), compa
reZIndex); | 2639 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), compa
reZIndex); |
2640 | 2640 |
2641 m_zOrderListsDirty = false; | 2641 m_zOrderListsDirty = false; |
2642 } | 2642 } |
2643 | 2643 |
2644 void RenderLayer::updateOverflowList() | 2644 void RenderLayer::updateNormalFlowList() |
2645 { | 2645 { |
2646 if (!m_overflowListDirty) | 2646 if (!m_normalFlowListDirty) |
2647 return; | 2647 return; |
2648 | 2648 |
2649 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
{ | 2649 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
{ |
2650 // Ignore non-overflow layers and reflections. | 2650 // Ignore non-overflow layers and reflections. |
2651 if (child->isOverflowOnly() && (!m_reflection || reflectionLayer() != ch
ild)) { | 2651 if (child->isNormalFlowOnly() && (!m_reflection || reflectionLayer() !=
child)) { |
2652 if (!m_overflowList) | 2652 if (!m_normalFlowList) |
2653 m_overflowList = new Vector<RenderLayer*>; | 2653 m_normalFlowList = new Vector<RenderLayer*>; |
2654 m_overflowList->append(child); | 2654 m_normalFlowList->append(child); |
2655 } | 2655 } |
2656 } | 2656 } |
2657 | 2657 |
2658 m_overflowListDirty = false; | 2658 m_normalFlowListDirty = false; |
2659 } | 2659 } |
2660 | 2660 |
2661 void RenderLayer::collectLayers(Vector<RenderLayer*>*& posBuffer, Vector<RenderL
ayer*>*& negBuffer) | 2661 void RenderLayer::collectLayers(Vector<RenderLayer*>*& posBuffer, Vector<RenderL
ayer*>*& negBuffer) |
2662 { | 2662 { |
2663 updateVisibilityStatus(); | 2663 updateVisibilityStatus(); |
2664 | 2664 |
2665 // Overflow layers are just painted by their enclosing layers, so they don't
get put in zorder lists. | 2665 // Overflow layers are just painted by their enclosing layers, so they don't
get put in zorder lists. |
2666 if ((m_hasVisibleContent || (m_hasVisibleDescendant && isStackingContext()))
&& !isOverflowOnly()) { | 2666 if ((m_hasVisibleContent || (m_hasVisibleDescendant && isStackingContext()))
&& !isNormalFlowOnly()) { |
2667 // Determine which buffer the child should be in. | 2667 // Determine which buffer the child should be in. |
2668 Vector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; | 2668 Vector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; |
2669 | 2669 |
2670 // Create the buffer if it doesn't exist yet. | 2670 // Create the buffer if it doesn't exist yet. |
2671 if (!buffer) | 2671 if (!buffer) |
2672 buffer = new Vector<RenderLayer*>; | 2672 buffer = new Vector<RenderLayer*>; |
2673 | 2673 |
2674 // Append ourselves at the end of the appropriate buffer. | 2674 // Append ourselves at the end of the appropriate buffer. |
2675 buffer->append(this); | 2675 buffer->append(this); |
2676 } | 2676 } |
2677 | 2677 |
2678 // Recur into our children to collect more layers, but only if we don't esta
blish | 2678 // Recur into our children to collect more layers, but only if we don't esta
blish |
2679 // a stacking context. | 2679 // a stacking context. |
2680 if (m_hasVisibleDescendant && !isStackingContext()) { | 2680 if (m_hasVisibleDescendant && !isStackingContext()) { |
2681 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { | 2681 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { |
2682 // Ignore reflections. | 2682 // Ignore reflections. |
2683 if (!m_reflection || reflectionLayer() != child) | 2683 if (!m_reflection || reflectionLayer() != child) |
2684 child->collectLayers(posBuffer, negBuffer); | 2684 child->collectLayers(posBuffer, negBuffer); |
2685 } | 2685 } |
2686 } | 2686 } |
2687 } | 2687 } |
2688 | 2688 |
2689 void RenderLayer::updateLayerListsIfNeeded() | 2689 void RenderLayer::updateLayerListsIfNeeded() |
2690 { | 2690 { |
2691 #if USE(ACCELERATED_COMPOSITING) | 2691 #if USE(ACCELERATED_COMPOSITING) |
2692 if (compositor()->inCompositingMode()) { | 2692 if (compositor()->inCompositingMode()) { |
2693 if ((isStackingContext() && m_zOrderListsDirty) || m_overflowListDirty) | 2693 if ((isStackingContext() && m_zOrderListsDirty) || m_normalFlowListDirty
) |
2694 compositor()->updateCompositingLayers(this); | 2694 compositor()->updateCompositingLayers(this); |
2695 return; | 2695 return; |
2696 } | 2696 } |
2697 #endif | 2697 #endif |
2698 updateZOrderLists(); | 2698 updateZOrderLists(); |
2699 updateOverflowList(); | 2699 updateNormalFlowList(); |
2700 } | 2700 } |
2701 | 2701 |
2702 void RenderLayer::repaintIncludingDescendants() | 2702 void RenderLayer::repaintIncludingDescendants() |
2703 { | 2703 { |
2704 renderer()->repaint(); | 2704 renderer()->repaint(); |
2705 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) | 2705 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) |
2706 curr->repaintIncludingDescendants(); | 2706 curr->repaintIncludingDescendants(); |
2707 } | 2707 } |
2708 | 2708 |
2709 #if USE(ACCELERATED_COMPOSITING) | 2709 #if USE(ACCELERATED_COMPOSITING) |
(...skipping 23 matching lines...) Expand all Loading... |
2733 absRect.move(x, y); | 2733 absRect.move(x, y); |
2734 | 2734 |
2735 RenderView* view = renderer()->view(); | 2735 RenderView* view = renderer()->view(); |
2736 if (view) | 2736 if (view) |
2737 view->repaintViewRectangle(absRect); | 2737 view->repaintViewRectangle(absRect); |
2738 } else | 2738 } else |
2739 backing()->setContentsNeedDisplayInRect(r); | 2739 backing()->setContentsNeedDisplayInRect(r); |
2740 } | 2740 } |
2741 #endif | 2741 #endif |
2742 | 2742 |
2743 bool RenderLayer::shouldBeOverflowOnly() const | 2743 bool RenderLayer::shouldBeNormalFlowOnly() const |
2744 { | 2744 { |
2745 return (renderer()->hasOverflowClip() || renderer()->hasReflection()) && | 2745 return (renderer()->hasOverflowClip() || renderer()->hasReflection()) && |
2746 !renderer()->isPositioned() && | 2746 !renderer()->isPositioned() && |
2747 !renderer()->isRelPositioned() && | 2747 !renderer()->isRelPositioned() && |
2748 !renderer()->hasTransform() && | 2748 !renderer()->hasTransform() && |
2749 !isTransparent(); | 2749 !isTransparent(); |
2750 } | 2750 } |
2751 | 2751 |
2752 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle*) | 2752 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle*) |
2753 { | 2753 { |
2754 bool isOverflowOnly = shouldBeOverflowOnly(); | 2754 bool isNormalFlowOnly = shouldBeNormalFlowOnly(); |
2755 if (isOverflowOnly != m_isOverflowOnly) { | 2755 if (isNormalFlowOnly != m_isNormalFlowOnly) { |
2756 m_isOverflowOnly = isOverflowOnly; | 2756 m_isNormalFlowOnly = isNormalFlowOnly; |
2757 RenderLayer* p = parent(); | 2757 RenderLayer* p = parent(); |
2758 if (p) | 2758 if (p) |
2759 p->dirtyOverflowList(); | 2759 p->dirtyNormalFlowList(); |
2760 dirtyStackingContextZOrderLists(); | 2760 dirtyStackingContextZOrderLists(); |
2761 } | 2761 } |
2762 | 2762 |
2763 if (renderer()->style()->overflowX() == OMARQUEE && renderer()->style()->mar
queeBehavior() != MNONE) { | 2763 if (renderer()->style()->overflowX() == OMARQUEE && renderer()->style()->mar
queeBehavior() != MNONE) { |
2764 if (!m_marquee) | 2764 if (!m_marquee) |
2765 m_marquee = new RenderMarquee(this); | 2765 m_marquee = new RenderMarquee(this); |
2766 m_marquee->updateMarqueeStyle(); | 2766 m_marquee->updateMarqueeStyle(); |
2767 } | 2767 } |
2768 else if (m_marquee) { | 2768 else if (m_marquee) { |
2769 delete m_marquee; | 2769 delete m_marquee; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 if (m_marquee) | 2884 if (m_marquee) |
2885 m_marquee->suspend(); | 2885 m_marquee->suspend(); |
2886 | 2886 |
2887 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) | 2887 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) |
2888 curr->suspendMarquees(); | 2888 curr->suspendMarquees(); |
2889 } | 2889 } |
2890 | 2890 |
2891 } // namespace WebCore | 2891 } // namespace WebCore |
2892 | 2892 |
2893 | 2893 |
OLD | NEW |