Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: webkit/glue/stacking_order_iterator.h

Issue 1612: Implement "iframe shim" behavior for windowed plugins.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl.cc ('k') | webkit/glue/stacking_order_iterator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Provides some utilities for iterating over a RenderObject graph in
6 // stacking order.
7
8 #ifndef WEBKIT_GLUE_STACKING_ORDER_ITERATOR_H__
9 #define WEBKIT_GLUE_STACKING_ORDER_ITERATOR_H__
10
11 #include <vector>
12
13 namespace WebCore {
14 class RenderLayer;
15 class RenderObject;
16 }
17
18 // Iterates over a subtree of RenderLayers in stacking order, back to
19 // front. Modifying the RenderObject graph invalidates this iterator.
20 //
21 // TODO(tulrich): this could go in webkit.
22 // TODO(tulrich): needs unittests.
23 class RenderLayerIterator {
24 public:
25 RenderLayerIterator();
26
27 // Sets the RenderLayer subtree to iterate over.
28 void Reset(WebCore::RenderLayer* rl);
29
30 // Returns the next RenderLayer in stacking order, back to front.
31 WebCore::RenderLayer* Next();
32 private:
33 class Context {
34 public:
35 Context(WebCore::RenderLayer* layer);
36
37 bool HasMoreNeg();
38 Context NextNeg();
39 bool HasSelf();
40 WebCore::RenderLayer* NextSelf();
41 bool HasMoreOverflow();
42 Context NextOverflow();
43 bool HasMorePos();
44 Context NextPos();
45
46 private:
47 WebCore::RenderLayer* layer_;
48 size_t next_neg_;
49 size_t next_self_;
50 size_t next_overflow_;
51 size_t next_pos_;
52 };
53
54 std::vector<Context> context_stack_;
55 };
56
57 // Iterates over a subtree of RenderObjects below a given RenderLayer.
58 //
59 // TODO(tulrich): this could go in webkit.
60 // TODO(tulrich): needs unittests.
61 class StackingOrderIterator {
62 public:
63 StackingOrderIterator();
64 void Reset(WebCore::RenderLayer* rl);
65 WebCore::RenderObject* Next();
66
67 private:
68 RenderLayerIterator layer_iterator_;
69 WebCore::RenderObject* current_object_;
70 WebCore::RenderObject* current_layer_root_;
71 };
72
73 #endif // WEBKIT_GLUE_STACKING_ORDER_ITERATOR_H__
OLDNEW
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl.cc ('k') | webkit/glue/stacking_order_iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698