OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return true; | 122 return true; |
123 | 123 |
124 if (!node() || !node()->isFrameOwnerElement()) | 124 if (!node() || !node()->isFrameOwnerElement()) |
125 return false; | 125 return false; |
126 | 126 |
127 HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(node()); | 127 HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(node()); |
128 if (element->contentFrame() && element->contentFrame()->isRemoteFrame()) | 128 if (element->contentFrame() && element->contentFrame()->isRemoteFrame()) |
129 return true; | 129 return true; |
130 | 130 |
131 if (Document* contentDocument = element->contentDocument()) { | 131 if (Document* contentDocument = element->contentDocument()) { |
132 if (LayoutView* view = contentDocument->layoutView()) | 132 LayoutViewItem viewItem = contentDocument->layoutViewItem(); |
133 return view->usesCompositing(); | 133 if (!viewItem.isNull()) |
| 134 return viewItem.usesCompositing(); |
134 } | 135 } |
135 | 136 |
136 return false; | 137 return false; |
137 } | 138 } |
138 | 139 |
139 bool LayoutPart::needsPreferredWidthsRecalculation() const | 140 bool LayoutPart::needsPreferredWidthsRecalculation() const |
140 { | 141 { |
141 if (LayoutReplaced::needsPreferredWidthsRecalculation()) | 142 if (LayoutReplaced::needsPreferredWidthsRecalculation()) |
142 return true; | 143 return true; |
143 return embeddedReplacedContent(); | 144 return embeddedReplacedContent(); |
(...skipping 17 matching lines...) Expand all Loading... |
161 | 162 |
162 // A hit test can never hit an off-screen element; only off-screen iframes a
re throttled; | 163 // A hit test can never hit an off-screen element; only off-screen iframes a
re throttled; |
163 // therefore, hit tests can skip descending into throttled iframes. | 164 // therefore, hit tests can skip descending into throttled iframes. |
164 if (toFrameView(widget())->shouldThrottleRendering()) | 165 if (toFrameView(widget())->shouldThrottleRendering()) |
165 return nodeAtPointOverWidget(result, locationInContainer, accumulatedOff
set, action); | 166 return nodeAtPointOverWidget(result, locationInContainer, accumulatedOff
set, action); |
166 | 167 |
167 ASSERT(document().lifecycle().state() >= DocumentLifecycle::CompositingClean
); | 168 ASSERT(document().lifecycle().state() >= DocumentLifecycle::CompositingClean
); |
168 | 169 |
169 if (action == HitTestForeground) { | 170 if (action == HitTestForeground) { |
170 FrameView* childFrameView = toFrameView(widget()); | 171 FrameView* childFrameView = toFrameView(widget()); |
171 LayoutView* childRoot = childFrameView->layoutView(); | 172 LayoutViewItem childRootItem = childFrameView->layoutViewItem(); |
172 | 173 |
173 if (visibleToHitTestRequest(result.hitTestRequest()) && childRoot) { | 174 if (visibleToHitTestRequest(result.hitTestRequest()) && !childRootItem.i
sNull()) { |
174 LayoutPoint adjustedLocation = accumulatedOffset + location(); | 175 LayoutPoint adjustedLocation = accumulatedOffset + location(); |
175 LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft()
, borderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset()); | 176 LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft()
, borderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset()); |
176 HitTestLocation newHitTestLocation(locationInContainer, -adjustedLoc
ation - contentOffset); | 177 HitTestLocation newHitTestLocation(locationInContainer, -adjustedLoc
ation - contentOffset); |
177 HitTestRequest newHitTestRequest(result.hitTestRequest().type() | Hi
tTestRequest::ChildFrameHitTest); | 178 HitTestRequest newHitTestRequest(result.hitTestRequest().type() | Hi
tTestRequest::ChildFrameHitTest); |
178 HitTestResult childFrameResult(newHitTestRequest, newHitTestLocation
); | 179 HitTestResult childFrameResult(newHitTestRequest, newHitTestLocation
); |
179 | 180 |
180 // The frame's layout and style must be up-to-date if we reach here. | 181 // The frame's layout and style must be up-to-date if we reach here. |
181 bool isInsideChildFrame = childRoot->hitTestNoLifecycleUpdate(childF
rameResult); | 182 bool isInsideChildFrame = childRootItem.hitTestNoLifecycleUpdate(chi
ldFrameResult); |
182 | 183 |
183 if (result.hitTestRequest().listBased()) { | 184 if (result.hitTestRequest().listBased()) { |
184 result.append(childFrameResult); | 185 result.append(childFrameResult); |
185 } else if (isInsideChildFrame) { | 186 } else if (isInsideChildFrame) { |
186 // Force the result not to be cacheable because the parent | 187 // Force the result not to be cacheable because the parent |
187 // frame should not cache this result; as it won't be notified o
f | 188 // frame should not cache this result; as it won't be notified o
f |
188 // changes in the child. | 189 // changes in the child. |
189 childFrameResult.setCacheable(false); | 190 childFrameResult.setCacheable(false); |
190 result = childFrameResult; | 191 result = childFrameResult; |
191 } | 192 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 371 |
371 bool LayoutPart::isThrottledFrameView() const | 372 bool LayoutPart::isThrottledFrameView() const |
372 { | 373 { |
373 if (!widget() || !widget()->isFrameView()) | 374 if (!widget() || !widget()->isFrameView()) |
374 return false; | 375 return false; |
375 const FrameView* frameView = toFrameView(widget()); | 376 const FrameView* frameView = toFrameView(widget()); |
376 return frameView->shouldThrottleRendering(); | 377 return frameView->shouldThrottleRendering(); |
377 } | 378 } |
378 | 379 |
379 } // namespace blink | 380 } // namespace blink |
OLD | NEW |