/
ironframe-2016-06-09T02:32+0000.diff
468 lines (438 loc) · 21.1 KB
/
ironframe-2016-06-09T02:32+0000.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index f9c5602..305ba8f 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -26,6 +26,7 @@
*/
#include "core/dom/Document.h"
+#include "core/events/ErrorEvent.h"
#include "bindings/core/v8/DOMDataStore.h"
#include "bindings/core/v8/ExceptionMessages.h"
@@ -119,6 +120,7 @@
#include "core/editing/serializers/Serialization.h"
#include "core/editing/spellcheck/SpellChecker.h"
#include "core/events/BeforeUnloadEvent.h"
+#include "core/events/ErrorEvent.h"
#include "core/events/Event.h"
#include "core/events/EventFactory.h"
#include "core/events/EventListener.h"
@@ -179,6 +181,7 @@
#include "core/layout/LayoutView.h"
#include "core/layout/TextAutosizer.h"
#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/compositing/CompositedLayerMapping.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
#include "core/loader/CookieJar.h"
#include "core/loader/DocumentLoader.h"
@@ -202,6 +205,9 @@
#include "core/svg/SVGScriptElement.h"
#include "core/svg/SVGTitleElement.h"
#include "core/svg/SVGUseElement.h"
+#include "core/testing/Internals.h"
+#include "core/testing/InternalRuntimeFlags.h"
+#include "core/testing/InternalSettings.h"
#include "core/timing/DOMWindowPerformance.h"
#include "core/timing/Performance.h"
#include "core/workers/SharedWorkerRepositoryClient.h"
@@ -397,6 +403,8 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_domWindow(m_frame ? m_frame->localDOMWindow() : 0)
, m_importsController(initializer.importsController())
, m_contextFeatures(ContextFeatures::defaultSwitch())
+ , m_requestedVisibility(new VisibilityDocumentSet())
+ , m_requestVisibilityRect(nullptr)
, m_wellFormed(false)
, m_printing(false)
, m_wasPrinting(false)
@@ -5753,6 +5761,128 @@ bool Document::hasFocus() const
return page() && page()->focusController().isDocumentFocused(*this);
}
+VisibilityDocumentSet *Document::requestedVisibility() {
+ return m_requestedVisibility;
+}
+
+void Document::requestVisibility(){
+ // Set up the present frame for raising.
+ // TODO:
+ // Old code -
+ // this->documentElement()->setAttribute("requestVisibility", "1", ASSERT_NO_EXCEPTION);
+ // this->documentElement()->style()->setProperty("transform", "translateZ(0px)", "", ASSERT_NO_EXCEPTION);
+ // ETC
+}
+
+void Document::requestVisibilityImpl(){
+ // Step 1: Block obvious failure modes. Probably insert SVG test here?
+ if(this->domWindow() == this->domWindow()->top()) {return;}
+
+ // Step 2: Collect useful handles
+ DOMWindow *testWindow = this->domWindow();
+ PaintLayer* iframePaintLayer = this->documentElement()->layoutObject()->enclosingLayer();//->enclosingLayerForPaintInvalidationCrossingFrameBoundaries();
+
+ if(!iframePaintLayer) { return; }
+ GraphicsLayer* iframeGraphicsLayer = iframePaintLayer->graphicsLayerBacking();
+ const PaintLayer* rootPaintLayer = this->domWindow()->top()->document()->body()->layoutObject()->enclosingLayer()->root(); // XXX DMK top scrolling layer
+ GraphicsLayer* rootGraphicsLayer = rootPaintLayer->graphicsLayerBacking();
+ if(!iframeGraphicsLayer || !rootGraphicsLayer) {
+ printf("ERROR: Couldn't find required GraphicsLayer. One may not have been created for this document.");
+ addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMessageLevel, "Couldn't find required GraphicsLayer. One may not have been created for this document."));
+ return;
+ }
+ // Step 3: Discover our effective Bounds. We are effectively trying to compute the "keyhole" that reaches us,
+ // through multiple iframes and scroll/translateX values. The "sacred" transform is position and size.
+ // This is presently being done via boundsInViewportSpace, which works through almost everything.
+ // Almost. (Scale3d needs to be corrected for, or rejected.)
+
+ IntRect bounds = this->documentElement()->boundsInViewport();
+ IntRect origBounds = bounds;
+
+ testWindow = this->domWindow();
+ float sx, sy;
+ sx=sy=0;
+ bool moreElements=true;
+ Element *testElement = this->documentElement();
+ Document *testDocument = this;
+
+ bool do_move = true;
+ bool hostile=false;
+ while(moreElements){
+ if(testDocument->documentElement()==testElement){
+ testElement=testDocument->domWindow()->frameElement();
+ testDocument=&testElement->document();
+ sx+=testWindow->scrollX();
+ sy+=testWindow->scrollY();
+ testWindow=testWindow->parent();
+ } else {
+ testElement=testElement->parentElement();
+ }
+ // HACK!! Remove use of childrenClipRect
+ IntRect child = IntRect(testElement->layoutObject()->enclosingLayer()->clipper().childrenClipRect());
+ if(testElement->tagName()=="foreignObject"){
+ hostile=true;
+ }
+ if(testElement->tagName()=="IFRAME") {
+ IntRect ifrBounds = testElement->boundsInViewport();
+ child.setWidth(fmin(ifrBounds.size().width(), child.size().width()));
+ child.setHeight(fmin(ifrBounds.size().height(), child.size().height()));
+ }
+ bounds.intersect(child);
+ if(testElement == this->domWindow()->top()->document()->documentElement()) {
+ moreElements=false;
+ }
+ }
+ // intersect with visible viewport. XXX stop using IntRect, start using FloatRect
+ FrameView *mainFrameView = this->page()->deprecatedLocalMainFrame()->view();
+ LayoutRect mainViewRect = mainFrameView->layoutView()->viewRect();
+ IntRect mainViewIntRect = IntRect(mainViewRect);
+ bounds.intersect(mainViewIntRect);
+
+ FloatRect mainViewFloatRect = FloatRect(mainViewRect);
+ if(!bounds.size().width() || !bounds.size().height()) do_move=false;
+ // XXX for each registered visibility req, look for collisions with us, if so block the raise
+ VisibilityDocumentSet *ds = this->domWindow()->top()->document()->requestedVisibility();
+
+ for(Document *reqdoc : *ds){
+ if(reqdoc == this) break; // maybe this is right?
+ if(reqdoc->m_requestVisibilityRect && reqdoc->m_requestVisibilityRect->intersects(bounds)) {
+ // XXX DMK better would be to run bounds.subtract but then there'd have to *be* a bounds.subtract method.
+ // Also, subtraction is a not quite so defined as intersection. Largest contiguous from 0,0?
+ // Largest contiguous from any corner? God forbid, pile-o-rects? Let's just run for the hills for now
+ hostile=true;
+ //return; // there is a rather fun attack if you try this
+ }
+ }
+
+ if(hostile){
+ do_move=false;
+ bounds.setWidth(0);
+ bounds.setHeight(0);
+ }
+ if(this->documentElement()->hasAttribute("visibilityOnly")) { do_move=false; } // XXX DMK expand on this, there are uses
+ if (do_move) {
+ FloatRect fbounds = bounds;
+ this->set_requestVisibilityRect(&fbounds);
+ rootGraphicsLayer->addChild(iframeGraphicsLayer);
+ iframeGraphicsLayer->setPosition(FloatPoint(bounds.x(), bounds.y()));
+ iframeGraphicsLayer->setSize(FloatSize(bounds.size().width(), bounds.size().height()));
+ iframeGraphicsLayer->setBackgroundColor(Color::black);
+ iframeGraphicsLayer->setMasksToBounds(true);
+ iframeGraphicsLayer->setOpacity(1.0);
+ IntSize offset = IntSize(bounds.x()-origBounds.x()-topDocument().domWindow()->scrollX(), bounds.y()-origBounds.y()-topDocument().domWindow()->scrollY());
+ iframeGraphicsLayer->setOffsetFromLayoutObject(offset, GraphicsLayer::ShouldSetNeedsDisplay::SetNeedsDisplay);// const IntSize & offset,ShouldSetNeedsDisplay shouldSetNeedsDisplay)
+ }
+ // report. sx and sy are
+ bounds.setWidth(fmax(bounds.size().width() - sx, 0));
+ bounds.setHeight(fmax(bounds.size().height()- sy, 0));
+ //XXX DMK correctly integrate ancestorOrigins and return a clientRect for the visible region of the frame
+ String s = String("{\"viewport\": {\"x\": " + String::number((int)mainViewFloatRect.x()) + ", \"y\": " + String::number((int)mainViewFloatRect.y()) + ", \"width\": " + String::number((int)mainViewFloatRect.size().width()) + ", \"height\": " + String::number((int)mainViewFloatRect.size().height()) + "}, \"visible\": {\"x\": " + String::number((int)bounds.x()) + ", \"y\": " + String::number((int)bounds.y()) + ", \"width\": " + String::number((int)bounds.size().width()) + ", \"height\": " + String::number((int)bounds.size().height()) + "}}");
+ // TODO: Write actual event type
+ ErrorEvent* event = ErrorEvent::create(s, SourceLocation::create(String(), 0, 0, nullptr), nullptr);
+ this->documentElement()->dispatchEvent(event);
+};
+
template<unsigned type>
bool shouldInvalidateNodeListCachesForAttr(const HeapHashSet<WeakMember<const LiveNodeListBase>> nodeLists[], const QualifiedName& attrName)
{
@@ -5952,6 +6082,7 @@ DEFINE_TRACE(Document)
visitor->trace(m_intersectionObserverController);
visitor->trace(m_intersectionObserverData);
visitor->trace(m_snapCoordinator);
+ visitor->trace(m_requestedVisibility);
Supplementable<Document>::trace(visitor);
TreeScope::trace(visitor);
ContainerNode::trace(visitor);
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
index 9f9492b..0226d78 100644
--- a/third_party/WebKit/Source/core/dom/Document.h
+++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -174,6 +174,7 @@ struct AnnotatedRegionValue;
struct FocusParams;
struct IconURL;
+using VisibilityDocumentSet = HeapHashSet<WeakMember<Document>>;
using MouseEventWithHitTestResults = EventWithHitTestResults<PlatformMouseEvent>;
using ExceptionCode = int;
@@ -236,6 +237,9 @@ class CORE_EXPORT Document : public ContainerNode, public TreeScope, public Secu
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(Document);
public:
+
+ VisibilityDocumentSet *requestedVisibility();
+
static Document* create(const DocumentInit& initializer = DocumentInit())
{
return new Document(initializer);
@@ -1086,6 +1090,10 @@ public:
bool isInMainFrame() const;
+ void set_requestVisibilityRect(FloatRect *r) { m_requestVisibilityRect = r; }
+ void requestVisibility();
+ void requestVisibilityImpl();
+
protected:
Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass);
@@ -1200,6 +1208,9 @@ private:
Member<DocumentParser> m_parser;
Member<ContextFeatures> m_contextFeatures;
+ Member<VisibilityDocumentSet> m_requestedVisibility;
+ FloatRect *m_requestVisibilityRect;
+
bool m_wellFormed;
// Document URLs.
diff --git a/third_party/WebKit/Source/core/dom/Document.idl b/third_party/WebKit/Source/core/dom/Document.idl
index c6f7d4e..ea1c5d8 100644
--- a/third_party/WebKit/Source/core/dom/Document.idl
+++ b/third_party/WebKit/Source/core/dom/Document.idl
@@ -54,6 +54,9 @@ interface Document : Node {
HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
+ void requestVisibility();
+ void requestVisibilityImpl();
+
[NewObject, CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName);
[NewObject, CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
[NewObject] DocumentFragment createDocumentFragment();
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 0aa2c70..017d3c5 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -40,6 +40,7 @@
#include "core/editing/markers/DocumentMarkerController.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/frame/EventHandlerRegistry.h"
+#include "core/frame/FrameConsole.h"
#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Location.h"
@@ -2472,6 +2473,15 @@ void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases)
// This was required for slimming paint v1 but is only temporarily
// needed for slimming paint v2.
view.compositor()->updateIfNeededRecursive();
+
+ Document *d = frame().document();
+ VisibilityDocumentSet *ds = d->requestedVisibility();
+ if (ds != nullptr) {
+ for(Document *reqdoc : *ds){
+ reqdoc->requestVisibilityImpl();
+ }
+ }
+
scrollContentsIfNeededRecursive();
ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 328f526..75c2863 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -24,7 +24,9 @@
#include "core/dom/Element.h"
#include "core/editing/FrameSelection.h"
#include "core/frame/FrameView.h"
+#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Location.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLIFrameElement.h"
#include "core/layout/HitTestResult.h"
@@ -293,6 +295,11 @@ void LayoutView::layout()
}
}
+ // XXXDMK There's probably more URLs like about:blank that inherit but aren't actually the target to lift
+ if(document().location()->href() != "about:blank" && document().documentElement() && document().documentElement()->hasAttributes() && document().documentElement()->hasAttribute("requestVisibility")){
+ document().domWindow()->top()->document()->requestedVisibility()->add(&document());
+ }
+
#if ENABLE(ASSERT)
checkLayoutState();
#endif
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index e8298b6..cb7728b 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1005,7 +1005,8 @@ void PaintLayer::didUpdateCompositingInputs()
bool PaintLayer::hasNonIsolatedDescendantWithBlendMode() const
{
- ASSERT(!m_needsDescendantDependentCompositingInputsUpdate);
+ // XXX bjwbell
+ // ASSERT(!m_needsDescendantDependentCompositingInputsUpdate);
if (m_hasNonIsolatedDescendantWithBlendMode)
return true;
if (layoutObject()->isSVGRoot())
@@ -1750,7 +1751,8 @@ PaintLayer* PaintLayer::hitTestLayer(PaintLayer* rootLayer, PaintLayer* containe
const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, bool appliedTransform,
const HitTestingTransformState* transformState, double* zOffset)
{
- ASSERT(layoutObject()->document().lifecycle().state() >= DocumentLifecycle::CompositingClean);
+ // XXX bjwbell
+ // ASSERT(layoutObject()->document().lifecycle().state() >= DocumentLifecycle::CompositingClean);
if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant())
return nullptr;
@@ -2294,6 +2296,8 @@ CompositingState PaintLayer::compositingState() const
bool PaintLayer::isAllowedToQueryCompositingState() const
{
+ // XXX DMK
+ return true;
if (gCompositingQueryMode == CompositingQueriesAreAllowed || RuntimeEnabledFeatures::slimmingPaintV2Enabled())
return true;
return layoutObject()->document().lifecycle().state() >= DocumentLifecycle::InCompositingUpdate;
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index 44553cf..3fb2f5b 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -332,4 +332,41 @@ ClipRects& PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho
return getClipRects(context);
}
+LayoutRect PaintLayerClipper::childrenClipRect() const
+{
+ // FIXME: border-radius not accounted for.
+ // FIXME: Flow thread based columns not accounted for.
+ PaintLayer* clippingRootLayer = clippingRootForPainting();
+ LayoutRect layerBounds;
+ ClipRect backgroundRect, foregroundRect;
+ // Need to use uncached clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>).
+ ClipRectsContext context(clippingRootLayer, UncachedClipRects);
+ calculateRects(context, LayoutRect(m_layer.layoutObject()->view()->documentRect()), layerBounds, backgroundRect, foregroundRect);
+ return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(FloatQuad(FloatRect(foregroundRect.rect()))).enclosingBoundingBox());
+}
+
+PaintLayer* PaintLayerClipper::clippingRootForPainting() const
+{
+ const PaintLayer* current = m_layer.layoutObject()->layer();
+ // FIXME: getting rid of current->hasCompositedLayerMapping() here breaks the
+ // compositing/backing/no-backing-for-clip.html layout test, because there is a
+ // "composited but paints into ancestor" layer involved. However, it doesn't make sense that
+ // that check would be appropriate here but not inside the while loop below.
+ if (current->isPaintInvalidationContainer() || current->hasCompositedLayerMapping())
+ return const_cast<PaintLayer*>(current);
+
+ while (current) {
+ if (current->isRootLayer())
+ return const_cast<PaintLayer*>(current);
+
+ current = current->compositingContainer();
+ ASSERT(current);
+ if (current->transform() || current->isPaintInvalidationContainer())
+ return const_cast<PaintLayer*>(current);
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
} // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.h b/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
index c3ad800..6b83173 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.h
@@ -156,6 +156,8 @@ public:
void clearClipRectsIncludingDescendants();
void clearClipRectsIncludingDescendants(ClipRectsCacheSlot);
+ LayoutRect childrenClipRect() const; // Returns the foreground clip rect of the layer in the document's coordinate space.
+
// Returns the background clip rect of the layer in the local coordinate space. Only looks for clips up to the given ancestor.
LayoutRect localClipRect(const PaintLayer* ancestorLayer) const;
@@ -181,6 +183,8 @@ private:
bool shouldRespectOverflowClip(const ClipRectsContext&) const;
+ PaintLayer* clippingRootForPainting() const;
+
const PaintLayer& m_layer;
};
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 7ea4e78..b6e22a6 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -112,6 +112,7 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
, m_imagePainted(false)
, m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip)
, m_parent(0)
+ , m_crossroot_parent(0)
, m_maskLayer(0)
, m_contentsClippingMaskLayer(0)
, m_replicaLayer(0)
@@ -180,6 +181,12 @@ void GraphicsLayer::setParent(GraphicsLayer* layer)
m_parent = layer;
}
+void GraphicsLayer::setCrossrootParent(GraphicsLayer* layer)
+{
+ ASSERT(!layer || !layer->hasAncestor(this));
+ m_crossroot_parent = layer;
+}
+
#if ENABLE(ASSERT)
bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const
@@ -273,6 +280,16 @@ void GraphicsLayer::removeFromParent()
platformLayer()->removeFromParent();
}
+void GraphicsLayer::removeFromCrossrootParent()
+{
+ if (m_crossroot_parent) {
+ // We use reverseFind so that removeAllChildren() isn't n^2.
+ m_crossroot_parent->m_children.remove(m_crossroot_parent->m_children.reverseFind(this));
+ setParent(0);
+ }
+ platformLayer()->removeFromParent();
+}
+
void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
{
// FIXME: this could probably be a full early exit.
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
index 90884d6..6e11477 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
@@ -89,6 +89,9 @@ public:
GraphicsLayer* parent() const { return m_parent; }
void setParent(GraphicsLayer*); // Internal use only.
+ GraphicsLayer* crossrootParent() const { return m_crossroot_parent; }
+ void setCrossrootParent(GraphicsLayer*); // Internal use only.
+
const Vector<GraphicsLayer*>& children() const { return m_children; }
// Returns true if the child list changed.
bool setChildren(const GraphicsLayerVector&);
@@ -99,6 +102,7 @@ public:
void removeAllChildren();
void removeFromParent();
+ void removeFromCrossrootParent();
GraphicsLayer* maskLayer() const { return m_maskLayer; }
void setMaskLayer(GraphicsLayer*);
@@ -330,6 +334,7 @@ private:
Vector<GraphicsLayer*> m_children;
GraphicsLayer* m_parent;
+ GraphicsLayer* m_crossroot_parent;
GraphicsLayer* m_maskLayer; // Reference to mask layer. We don't own this.
GraphicsLayer* m_contentsClippingMaskLayer; // Reference to clipping mask layer. We don't own this.