]> git.saurik.com Git - iphone-api.git/blob - WebCore/RenderLayer.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / RenderLayer.h
1 /*
2 * Copyright (C) 2003 Apple Computer, Inc.
3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 *
6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com>
11 * Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
12 * Josh Soref <timeless@mac.com>
13 * Boris Zbarsky <bzbarsky@mit.edu>
14 *
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 *
29 * Alternatively, the contents of this file may be used under the terms
30 * of either the Mozilla Public License Version 1.1, found at
31 * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
32 * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
33 * (the "GPL"), in which case the provisions of the MPL or the GPL are
34 * applicable instead of those above. If you wish to allow use of your
35 * version of this file only under the terms of one of those two
36 * licenses (the MPL or the GPL) and not to allow others to use your
37 * version of this file under the LGPL, indicate your decision by
38 * deletingthe provisions above and replace them with the notice and
39 * other provisions required by the MPL or the GPL, as the case may be.
40 * If you do not delete the provisions above, a recipient may use your
41 * version of this file under any of the LGPL, the MPL or the GPL.
42 */
43
44 #ifndef RenderLayer_h
45 #define RenderLayer_h
46
47 #include "ScrollbarClient.h"
48 #include "RenderBox.h"
49 #include "Timer.h"
50 #include <wtf/OwnPtr.h>
51
52 namespace WebCore {
53
54 class CachedResource;
55 class HitTestResult;
56 class HitTestingTransformState;
57 class RenderFrameSet;
58 class RenderMarquee;
59 class RenderReplica;
60 class RenderScrollbarPart;
61 class RenderStyle;
62 class RenderTable;
63 class RenderText;
64 class RenderView;
65 class Scrollbar;
66 class TransformationMatrix;
67
68 #if USE(ACCELERATED_COMPOSITING)
69 class RenderLayerBacking;
70 class RenderLayerCompositor;
71 #endif
72
73 struct HitTestRequest;
74
75 class ClipRects {
76 public:
77 ClipRects()
78 : m_refCnt(0)
79 , m_fixed(false)
80 {
81 }
82
83 ClipRects(const IntRect& r)
84 : m_overflowClipRect(r)
85 , m_fixedClipRect(r)
86 , m_posClipRect(r)
87 , m_refCnt(0)
88 , m_fixed(false)
89 {
90 }
91
92 ClipRects(const ClipRects& other)
93 : m_overflowClipRect(other.overflowClipRect())
94 , m_fixedClipRect(other.fixedClipRect())
95 , m_posClipRect(other.posClipRect())
96 , m_refCnt(0)
97 , m_fixed(other.fixed())
98 {
99 }
100
101 void reset(const IntRect& r)
102 {
103 m_overflowClipRect = r;
104 m_fixedClipRect = r;
105 m_posClipRect = r;
106 m_fixed = false;
107 }
108
109 const IntRect& overflowClipRect() const { return m_overflowClipRect; }
110 void setOverflowClipRect(const IntRect& r) { m_overflowClipRect = r; }
111
112 const IntRect& fixedClipRect() const { return m_fixedClipRect; }
113 void setFixedClipRect(const IntRect&r) { m_fixedClipRect = r; }
114
115 const IntRect& posClipRect() const { return m_posClipRect; }
116 void setPosClipRect(const IntRect& r) { m_posClipRect = r; }
117
118 bool fixed() const { return m_fixed; }
119 void setFixed(bool fixed) { m_fixed = fixed; }
120
121 void ref() { m_refCnt++; }
122 void deref(RenderArena* renderArena) { if (--m_refCnt == 0) destroy(renderArena); }
123
124 void destroy(RenderArena*);
125
126 // Overloaded new operator.
127 void* operator new(size_t, RenderArena*) throw();
128
129 // Overridden to prevent the normal delete from being called.
130 void operator delete(void*, size_t);
131
132 bool operator==(const ClipRects& other) const
133 {
134 return m_overflowClipRect == other.overflowClipRect() &&
135 m_fixedClipRect == other.fixedClipRect() &&
136 m_posClipRect == other.posClipRect() &&
137 m_fixed == other.fixed();
138 }
139
140 ClipRects& operator=(const ClipRects& other)
141 {
142 m_overflowClipRect = other.overflowClipRect();
143 m_fixedClipRect = other.fixedClipRect();
144 m_posClipRect = other.posClipRect();
145 m_fixed = other.fixed();
146 return *this;
147 }
148
149 static IntRect infiniteRect() { return IntRect(INT_MIN/2, INT_MIN/2, INT_MAX, INT_MAX); }
150
151 private:
152 // The normal operator new is disallowed on all render objects.
153 void* operator new(size_t) throw();
154
155 private:
156 IntRect m_overflowClipRect;
157 IntRect m_fixedClipRect;
158 IntRect m_posClipRect;
159 unsigned m_refCnt : 31;
160 bool m_fixed : 1;
161 };
162
163 class RenderLayer : public ScrollbarClient {
164 public:
165 enum ScrollBehavior {
166 noScroll,
167 alignCenter,
168 alignTop,
169 alignBottom,
170 alignLeft,
171 alignRight,
172 alignToClosestEdge
173 };
174
175 struct ScrollAlignment {
176 ScrollBehavior m_rectVisible;
177 ScrollBehavior m_rectHidden;
178 ScrollBehavior m_rectPartial;
179 };
180
181 friend class RenderReplica;
182
183 static const ScrollAlignment gAlignCenterIfNeeded;
184 static const ScrollAlignment gAlignToEdgeIfNeeded;
185 static const ScrollAlignment gAlignCenterAlways;
186 static const ScrollAlignment gAlignTopAlways;
187 static const ScrollAlignment gAlignBottomAlways;
188
189 static ScrollBehavior getVisibleBehavior(const ScrollAlignment& s) { return s.m_rectVisible; }
190 static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return s.m_rectPartial; }
191 static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s.m_rectHidden; }
192
193 RenderLayer(RenderBox*);
194 ~RenderLayer();
195
196 RenderBox* renderer() const { return m_renderer; }
197 RenderLayer* parent() const { return m_parent; }
198 RenderLayer* previousSibling() const { return m_previous; }
199 RenderLayer* nextSibling() const { return m_next; }
200 RenderLayer* firstChild() const { return m_first; }
201 RenderLayer* lastChild() const { return m_last; }
202
203 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0);
204 RenderLayer* removeChild(RenderLayer*);
205
206 void removeOnlyThisLayer();
207 void insertOnlyThisLayer();
208
209 void repaintIncludingDescendants();
210
211 #if USE(ACCELERATED_COMPOSITING)
212 // Indicate that the layer contents need to be repainted. Only has an effect
213 // if layer compositing is being used,
214 void setBackingNeedsRepaint();
215 void setBackingNeedsRepaintInRect(const IntRect& r); // r is in the coordinate space of the layer's render object
216 void repaintIncludingNonCompositingDescendants(RenderBox* repaintContainer);
217 #endif
218
219 void styleChanged(StyleDifference, const RenderStyle*);
220
221 RenderMarquee* marquee() const { return m_marquee; }
222
223 bool isNormalFlowOnly() const { return m_isNormalFlowOnly; }
224 bool isSelfPaintingLayer() const;
225
226 bool requiresSlowRepaints() const;
227
228 bool isTransparent() const;
229 RenderLayer* transparentPaintingAncestor();
230 void beginTransparencyLayers(GraphicsContext*, const RenderLayer* rootLayer);
231
232 bool hasReflection() const { return renderer()->hasReflection(); }
233 RenderReplica* reflection() const { return m_reflection; }
234 RenderLayer* reflectionLayer() const;
235
236 const RenderLayer* root() const
237 {
238 const RenderLayer* curr = this;
239 while (curr->parent())
240 curr = curr->parent();
241 return curr;
242 }
243
244 int xPos() const { return m_x; }
245 int yPos() const { return m_y; }
246 void setPos(int xPos, int yPos)
247 {
248 m_x = xPos;
249 m_y = yPos;
250 }
251
252 int width() const { return m_width; }
253 int height() const { return m_height; }
254 void setWidth(int w) { m_width = w; }
255 void setHeight(int h) { m_height = h; }
256
257 int scrollWidth();
258 int scrollHeight();
259
260 void panScrollFromPoint(const IntPoint&);
261
262 // Scrolling methods for layers that can scroll their overflow.
263 void scrollByRecursively(int xDelta, int yDelta);
264 void addScrolledContentOffset(int& x, int& y) const;
265 void subtractScrolledContentOffset(int& x, int& y) const;
266 IntSize scrolledContentOffset() const { return IntSize(scrollXOffset() + m_scrollLeftOverflow, scrollYOffset()); }
267
268 int scrollXOffset() const { return m_scrollX + m_scrollOriginX; }
269 int scrollYOffset() const { return m_scrollY; }
270
271 void scrollToOffset(int x, int y, bool updateScrollbars = true, bool repaint = true);
272 void scrollToXOffset(int x) { scrollToOffset(x, m_scrollY); }
273 void scrollToYOffset(int y) { scrollToOffset(m_scrollX + m_scrollOriginX, y); }
274 void scrollRectToVisible(const IntRect&, bool scrollToAnchor = false, const ScrollAlignment& alignX = gAlignCenterIfNeeded, const ScrollAlignment& alignY = gAlignCenterIfNeeded);
275
276 IntRect getRectToExpose(const IntRect& visibleRect, const IntRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);
277
278 void setHasHorizontalScrollbar(bool);
279 void setHasVerticalScrollbar(bool);
280
281 PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
282 void destroyScrollbar(ScrollbarOrientation);
283
284 Scrollbar* horizontalScrollbar() const { return m_hBar.get(); }
285 Scrollbar* verticalScrollbar() const { return m_vBar.get(); }
286
287 int verticalScrollbarWidth() const;
288 int horizontalScrollbarHeight() const;
289
290 void positionOverflowControls(int tx, int ty);
291 bool isPointInResizeControl(const IntPoint& absolutePoint) const;
292 bool hitTestOverflowControls(HitTestResult&);
293 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const;
294
295 void paintOverflowControls(GraphicsContext*, int tx, int ty, const IntRect& damageRect);
296 void paintScrollCorner(GraphicsContext*, int tx, int ty, const IntRect& damageRect);
297 void paintResizer(GraphicsContext*, int tx, int ty, const IntRect& damageRect);
298
299 void updateScrollInfoAfterLayout();
300
301 bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
302 void autoscroll();
303
304 void resize(const PlatformMouseEvent&, const IntSize&);
305 bool inResizeMode() const { return m_inResizeMode; }
306 void setInResizeMode(bool b) { m_inResizeMode = b; }
307
308 bool isRootLayer() const { return renderer()->isRenderView(); }
309
310 #if USE(ACCELERATED_COMPOSITING)
311 RenderLayerCompositor* compositor() const;
312
313 // Notification from the renderer that its content changed (e.g. current frame of image changed).
314 // Allows updates of layer content without repainting.
315 void rendererContentChanged();
316 #endif
317
318 void updateLayerPosition();
319 void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint = true);
320
321 void updateTransform();
322
323 void relativePositionOffset(int& relX, int& relY) const { relX += m_relX; relY += m_relY; }
324 IntSize relativePositionOffset() const { return IntSize(m_relX, m_relY); }
325
326 void clearClipRectsIncludingDescendants();
327 void clearClipRects();
328
329 // Get the enclosing stacking context for this layer. A stacking context is a layer
330 // that has a non-auto z-index.
331 RenderLayer* stackingContext() const;
332 bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isRenderView(); }
333
334 void dirtyZOrderLists();
335 void dirtyStackingContextZOrderLists();
336 void updateZOrderLists();
337 Vector<RenderLayer*>* posZOrderList() const { return m_posZOrderList; }
338 Vector<RenderLayer*>* negZOrderList() const { return m_negZOrderList; }
339
340 void dirtyNormalFlowList();
341 void updateNormalFlowList();
342 Vector<RenderLayer*>* normalFlowList() const { return m_normalFlowList; }
343
344 bool hasVisibleContent() const { return m_hasVisibleContent; }
345 void setHasVisibleContent(bool);
346 void dirtyVisibleContentStatus();
347
348 // Gets the nearest enclosing positioned ancestor layer (also includes
349 // the <html> layer and the root layer).
350 RenderLayer* enclosingPositionedAncestor() const;
351
352 #if USE(ACCELERATED_COMPOSITING)
353 // Enclosing compositing layer; if includeSelf is true, may return this.
354 RenderLayer* enclosingCompositingLayer(bool includeSelf = true) const;
355 // Ancestor compositing layer, excluding this.
356 RenderLayer* ancestorCompositingLayer() const { return enclosingCompositingLayer(false); }
357 #endif
358
359 void convertToLayerCoords(const RenderLayer* ancestorLayer, int& x, int& y) const;
360
361 bool hasAutoZIndex() const { return renderer()->style()->hasAutoZIndex(); }
362 int zIndex() const { return renderer()->style()->zIndex(); }
363
364 // The two main functions that use the layer system. The paint method
365 // paints the layers that intersect the damage rect from back to
366 // front. The hitTest method looks for mouse events by walking
367 // layers that intersect the point from front to back.
368 void paint(GraphicsContext*, const IntRect& damageRect, PaintRestriction = PaintRestrictionNone, RenderObject* paintingRoot = 0);
369 bool hitTest(const HitTestRequest&, HitTestResult&);
370
371 // This method figures out our layerBounds in coordinates relative to
372 // |rootLayer}. It also computes our background and foreground clip rects
373 // for painting/event handling.
374 void calculateRects(const RenderLayer* rootLayer, const IntRect& paintDirtyRect, IntRect& layerBounds,
375 IntRect& backgroundRect, IntRect& foregroundRect, IntRect& outlineRect, bool temporaryClipRects = false) const;
376
377 // Compute and cache clip rects computed with the given layer as the root
378 void updateClipRects(const RenderLayer* rootLayer);
379 // Compute and return the clip rects. If useCached is true, will used previously computed clip rects on ancestors
380 // (rather than computing them all from scratch up the parent chain).
381 void calculateClipRects(const RenderLayer* rootLayer, ClipRects&, bool useCached = false) const;
382 ClipRects* clipRects() const { return m_clipRects; }
383
384 IntRect childrenClipRect() const; // Returns the foreground clip rect of the layer in the document's coordinate space.
385 IntRect selfClipRect() const; // Returns the background clip rect of the layer in the document's coordinate space.
386
387 bool intersectsDamageRect(const IntRect& layerBounds, const IntRect& damageRect, const RenderLayer* rootLayer) const;
388
389 // Bounding box relative to some ancestor layer.
390 IntRect boundingBox(const RenderLayer* rootLayer) const;
391 // Bounding box in the coordinates of this layer.
392 IntRect localBoundingBox() const;
393 // Bounding box relative to the root.
394 IntRect absoluteBoundingBox() const;
395
396 void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
397
398 // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
399 IntRect repaintRect() const { return m_repaintRect; }
400 void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
401
402 int staticX() const { return m_staticX; }
403 int staticY() const { return m_staticY; }
404 void setStaticX(int staticX) { m_staticX = staticX; }
405 void setStaticY(int staticY) { m_staticY = staticY; }
406
407 bool adjustForPurpleCaretWhenScrolling() const { return m_adjustForPurpleCaretWhenScrolling; }
408 void setAdjustForPurpleCaretWhenScrolling(bool b) { m_adjustForPurpleCaretWhenScrolling = b; }
409
410 bool hasTransform() const { return renderer()->hasTransform(); }
411 // Note that this transform has the transform-origin baked in.
412 TransformationMatrix* transform() const { return m_transform.get(); }
413 // currentTransform computes a transform which takes accelerated animations into account. The
414 // resulting transform has transform-origin baked in. If the layer does not have a transform,
415 // returns the identity matrix.
416 TransformationMatrix currentTransform() const;
417
418 // Get the perspective transform, which is applied to transformed sublayers.
419 // Returns true if the layer has a -webkit-perspective.
420 // Note that this transform has the perspective-origin baked in.
421 TransformationMatrix perspectiveTransform() const;
422 FloatPoint perspectiveOrigin() const;
423 bool preserves3D() const { return renderer()->style()->transformStyle3D() == TransformStyle3DPreserve3D; }
424 bool has3DTransform() const { return m_transform && !m_transform->isAffine(); }
425
426 void destroy(RenderArena*);
427
428 // Overloaded new operator. Derived classes must override operator new
429 // in order to allocate out of the RenderArena.
430 void* operator new(size_t, RenderArena*) throw();
431
432 // Overridden to prevent the normal delete from being called.
433 void operator delete(void*, size_t);
434
435 #if USE(ACCELERATED_COMPOSITING)
436 bool isComposited() const { return m_backing != 0; }
437 RenderLayerBacking* backing() const { return m_backing.get(); }
438 RenderLayerBacking* ensureBacking();
439 void clearBacking();
440 #else
441 bool isComposited() const { return false; }
442 #endif
443
444 bool paintsWithTransparency() const
445 {
446 return isTransparent() && !isComposited();
447 }
448
449 bool paintsWithTransform() const
450 {
451 return transform() && !isComposited();
452 }
453
454 private:
455 // The normal operator new is disallowed on all render objects.
456 void* operator new(size_t) throw();
457
458 private:
459 void setNextSibling(RenderLayer* next) { m_next = next; }
460 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
461 void setParent(RenderLayer* parent);
462 void setFirstChild(RenderLayer* first) { m_first = first; }
463 void setLastChild(RenderLayer* last) { m_last = last; }
464
465 void collectLayers(Vector<RenderLayer*>*&, Vector<RenderLayer*>*&);
466
467 void updateLayerListsIfNeeded();
468
469 void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect,
470 bool haveTransparency, PaintRestriction, RenderObject* paintingRoot,
471 bool appliedTransform = false, bool temporaryClipRects = false);
472
473 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult& result,
474 const IntRect& hitTestRect, const IntPoint& hitTestPoint, bool appliedTransform,
475 const HitTestingTransformState* transformState = 0, double* zOffset = 0);
476
477 PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer,
478 const IntRect& hitTestRect, const IntPoint& hitTestPoint,
479 const HitTestingTransformState* containerTransformState) const;
480
481 bool hitTestContents(const HitTestRequest&, HitTestResult&, const IntRect& layerBounds, const IntPoint& hitTestPoint, HitTestFilter) const;
482
483 void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0);
484
485 bool shouldBeNormalFlowOnly() const;
486
487 virtual void valueChanged(Scrollbar*);
488 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
489 virtual bool isActive() const;
490 virtual bool scrollbarCornerPresent() const;
491
492 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
493
494 void childVisibilityChanged(bool newVisibility);
495 void dirtyVisibleDescendantStatus();
496 void updateVisibilityStatus();
497
498 // This flag is computed by RenderLayerCompositor, which knows more about 3d hierarchies than we do.
499 void setHas3DTransformedDescendant(bool b) { m_has3DTransformedDescendant = b; }
500 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendant; }
501
502 void dirty3DTransformedDescendantStatus();
503 // Both updates the status, and returns true if descendants of this have 3d.
504 bool update3DTransformedDescendantStatus();
505
506 Node* enclosingElement() const;
507
508 void createReflection();
509 void updateReflectionStyle();
510 bool paintingInsideReflection() const { return m_paintingInsideReflection; }
511
512 void parentClipRects(const RenderLayer* rootLayer, ClipRects&, bool temporaryClipRects = false) const;
513
514 RenderLayer* enclosingTransformedAncestor() const;
515
516 // Convert a point in absolute coords into layer coords, taking transforms into account
517 IntPoint absoluteToContents(const IntPoint&) const;
518
519 void updateScrollCornerStyle();
520 void updateResizerStyle();
521
522 #if USE(ACCELERATED_COMPOSITING)
523 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; }
524 void setHasCompositingDescendant(bool b) { m_hasCompositingDescendant = b; }
525
526 bool mustOverlayCompositedLayers() const { return m_mustOverlayCompositedLayers; }
527 void setMustOverlayCompositedLayers(bool b) { m_mustOverlayCompositedLayers = b; }
528 #endif
529
530 #if USE(ACCELERATED_COMPOSITING)
531 void setDocumentScale(float);
532 #endif
533
534 private:
535 friend class RenderLayerBacking;
536 friend class RenderLayerCompositor;
537
538 protected:
539 RenderBox* m_renderer;
540
541 RenderLayer* m_parent;
542 RenderLayer* m_previous;
543 RenderLayer* m_next;
544 RenderLayer* m_first;
545 RenderLayer* m_last;
546
547 IntRect m_repaintRect; // Cached repaint rects. Used by layout.
548 IntRect m_outlineBox;
549
550 // Our current relative position offset.
551 int m_relX;
552 int m_relY;
553
554 // Our (x,y) coordinates are in our parent layer's coordinate space.
555 int m_x;
556 int m_y;
557
558 // The layer's width/height
559 int m_width;
560 int m_height;
561
562 // Our scroll offsets if the view is scrolled.
563 int m_scrollX;
564 int m_scrollY;
565 int m_scrollOriginX; // only non-zero for rtl content
566 int m_scrollLeftOverflow; // only non-zero for rtl content
567
568 // The width/height of our scrolled area.
569 int m_scrollWidth;
570 int m_scrollHeight;
571
572 // For layers with overflow, we have a pair of scrollbars.
573 RefPtr<Scrollbar> m_hBar;
574 RefPtr<Scrollbar> m_vBar;
575
576 // Keeps track of whether the layer is currently resizing, so events can cause resizing to start and stop.
577 bool m_inResizeMode;
578
579 // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the
580 // descendant layers within the stacking context that have z-indices of 0 or greater
581 // (auto will count as 0). m_negZOrderList holds descendants within our stacking context with negative
582 // z-indices.
583 Vector<RenderLayer*>* m_posZOrderList;
584 Vector<RenderLayer*>* m_negZOrderList;
585
586 // This list contains child layers that cannot create stacking contexts. For now it is just
587 // overflow layers, but that may change in the future.
588 Vector<RenderLayer*>* m_normalFlowList;
589
590 ClipRects* m_clipRects; // Cached clip rects used when painting and hit testing.
591 #ifndef NDEBUG
592 const RenderLayer* m_clipRectsRoot; // Root layer used to compute clip rects.
593 #endif
594
595 bool m_scrollDimensionsDirty : 1;
596 bool m_zOrderListsDirty : 1;
597 bool m_normalFlowListDirty: 1;
598 bool m_isNormalFlowOnly : 1;
599
600 bool m_usedTransparency : 1; // Tracks whether we need to close a transparent layer, i.e., whether
601 // we ended up painting this layer or any descendants (and therefore need to
602 // blend).
603 bool m_paintingInsideReflection : 1; // A state bit tracking if we are painting inside a replica.
604 bool m_inOverflowRelayout : 1;
605 bool m_needsFullRepaint : 1;
606
607 bool m_overflowStatusDirty : 1;
608 bool m_horizontalOverflow : 1;
609 bool m_verticalOverflow : 1;
610 bool m_visibleContentStatusDirty : 1;
611 bool m_hasVisibleContent : 1;
612 bool m_visibleDescendantStatusDirty : 1;
613 bool m_hasVisibleDescendant : 1;
614
615 bool m_3DTransformedDescendantStatusDirty : 1;
616 bool m_has3DTransformedDescendant : 1; // Set on a stacking context layer that has 3D descendants anywhere
617 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
618 #if USE(ACCELERATED_COMPOSITING)
619 bool m_hasCompositingDescendant : 1;
620 bool m_mustOverlayCompositedLayers : 1;
621 #endif
622
623 bool m_adjustForPurpleCaretWhenScrolling : 1;
624
625 RenderMarquee* m_marquee; // Used by layers with overflow:marquee
626
627 // Cached normal flow values for absolute positioned elements with static left/top values.
628 int m_staticX;
629 int m_staticY;
630
631 OwnPtr<TransformationMatrix> m_transform;
632
633 // May ultimately be extended to many replicas (with their own paint order).
634 RenderReplica* m_reflection;
635
636 // Renderers to hold our custom scroll corner and resizer.
637 RenderScrollbarPart* m_scrollCorner;
638 RenderScrollbarPart* m_resizer;
639
640 #if USE(ACCELERATED_COMPOSITING)
641 OwnPtr<RenderLayerBacking> m_backing;
642 #endif
643 };
644
645 } // namespace WebCore
646
647 #endif // RenderLayer_h