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

Side by Side Diff: Source/core/rendering/RenderWidget.cpp

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix mac compile issue. Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2013 Google Inc. All rights reserved. 5 * Copyright (C) 2013 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 * 21 *
22 */ 22 */
23 23
24 #include "config.h" 24 #include "config.h"
25 #include "core/rendering/RenderWidget.h" 25 #include "core/rendering/RenderWidget.h"
26 26
27 #include "core/accessibility/AXObjectCache.h" 27 #include "core/accessibility/AXObjectCache.h"
28 #include "core/frame/Frame.h" 28 #include "core/frame/Frame.h"
29 #include "core/html/HTMLFrameOwnerElement.h"
30 #include "core/html/HTMLPlugInElement.h"
29 #include "core/rendering/CompositedLayerMapping.h" 31 #include "core/rendering/CompositedLayerMapping.h"
30 #include "core/rendering/GraphicsContextAnnotator.h" 32 #include "core/rendering/GraphicsContextAnnotator.h"
31 #include "core/rendering/HitTestResult.h" 33 #include "core/rendering/HitTestResult.h"
32 #include "core/rendering/LayoutRectRecorder.h" 34 #include "core/rendering/LayoutRectRecorder.h"
33 #include "core/rendering/RenderLayer.h" 35 #include "core/rendering/RenderLayer.h"
34 #include "core/rendering/RenderView.h" 36 #include "core/rendering/RenderView.h"
35 #include "platform/graphics/GraphicsContext.h" 37 #include "platform/graphics/GraphicsContext.h"
36 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
37 39
38 namespace WebCore { 40 namespace WebCore {
39 41
40 typedef HashMap<RefPtr<Widget>, FrameView*> WidgetToParentMap;
41 static WidgetToParentMap& widgetNewParentMap()
42 {
43 DEFINE_STATIC_LOCAL(WidgetToParentMap, map, ());
44 return map;
45 }
46
47 static unsigned s_updateSuspendCount = 0;
48
49 RenderWidget::UpdateSuspendScope::UpdateSuspendScope()
50 {
51 ++s_updateSuspendCount;
52 }
53
54 RenderWidget::UpdateSuspendScope::~UpdateSuspendScope()
55 {
56 ASSERT(s_updateSuspendCount > 0);
57 if (s_updateSuspendCount == 1) {
58 WidgetToParentMap map;
59 widgetNewParentMap().swap(map);
60 WidgetToParentMap::iterator end = map.end();
61 for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) {
62 Widget* child = it->key.get();
63 ScrollView* currentParent = toScrollView(child->parent());
64 FrameView* newParent = it->value;
65 if (newParent != currentParent) {
66 if (currentParent)
67 currentParent->removeChild(child);
68 if (newParent)
69 newParent->addChild(child);
70 }
71 }
72 }
73 --s_updateSuspendCount;
74 }
75
76 static void moveWidgetToParentSoon(Widget* child, FrameView* parent)
77 {
78 if (!s_updateSuspendCount) {
79 if (parent)
80 parent->addChild(child);
81 else
82 toScrollView(child->parent())->removeChild(child);
83 return;
84 }
85 widgetNewParentMap().set(child, parent);
86 }
87
88 RenderWidget::RenderWidget(Element* element) 42 RenderWidget::RenderWidget(Element* element)
89 : RenderReplaced(element) 43 : RenderReplaced(element)
90 , m_widget(0)
91 , m_frameView(element->document().view()) 44 , m_frameView(element->document().view())
92 // Reference counting is used to prevent the widget from being 45 // Reference counting is used to prevent the widget from being
93 // destroyed while inside the Widget code, which might not be 46 // destroyed while inside the Widget code, which might not be
94 // able to handle that. 47 // able to handle that.
95 , m_refCount(1) 48 , m_refCount(1)
96 { 49 {
97 view()->addWidget(this); 50 view()->addWidget(this);
98 } 51 }
99 52
100 void RenderWidget::willBeDestroyed() 53 void RenderWidget::willBeDestroyed()
101 { 54 {
102 if (RenderView* v = view()) 55 if (RenderView* v = view())
103 v->removeWidget(this); 56 v->removeWidget(this);
104 57
105 if (AXObjectCache* cache = document().existingAXObjectCache()) { 58 if (AXObjectCache* cache = document().existingAXObjectCache()) {
106 cache->childrenChanged(this->parent()); 59 cache->childrenChanged(this->parent());
107 cache->remove(this); 60 cache->remove(this);
108 } 61 }
109 62
110 setWidget(0); 63 Element* element = toElement(node());
64 if (element && element->isFrameOwnerElement())
65 toHTMLFrameOwnerElement(element)->setWidget(0);
111 66
112 RenderReplaced::willBeDestroyed(); 67 RenderReplaced::willBeDestroyed();
113 } 68 }
114 69
115 void RenderWidget::destroy() 70 void RenderWidget::destroy()
116 { 71 {
117 willBeDestroyed(); 72 willBeDestroyed();
118 clearNode(); 73 clearNode();
119 deref(); 74 deref();
120 } 75 }
121 76
122 RenderWidget::~RenderWidget() 77 RenderWidget::~RenderWidget()
123 { 78 {
124 ASSERT(m_refCount <= 0); 79 ASSERT(m_refCount <= 0);
125 clearWidget(); 80 }
81
82 Widget* RenderWidget::widget() const
83 {
84 // Plugin widgets are stored in their DOM node. This includes HTMLAppletElem ent.
85 Element* element = toElement(node());
86
87 if (element && element->isFrameOwnerElement())
88 return toHTMLFrameOwnerElement(element)->widget();
89
90 return 0;
126 } 91 }
127 92
128 // Widgets are always placed on integer boundaries, so rounding the size is actu ally 93 // Widgets are always placed on integer boundaries, so rounding the size is actu ally
129 // the desired behavior. This function is here because it's otherwise seldom wha t we 94 // the desired behavior. This function is here because it's otherwise seldom wha t we
130 // want to do with a LayoutRect. 95 // want to do with a LayoutRect.
131 static inline IntRect roundedIntRect(const LayoutRect& rect) 96 static inline IntRect roundedIntRect(const LayoutRect& rect)
132 { 97 {
133 return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size()) ); 98 return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size()) );
134 } 99 }
135 100
136 bool RenderWidget::setWidgetGeometry(const LayoutRect& frame) 101 bool RenderWidget::setWidgetGeometry(const LayoutRect& frame)
137 { 102 {
138 if (!node()) 103 if (!node())
139 return false; 104 return false;
140 105
106 Widget* widget = this->widget();
107 ASSERT(widget);
108
141 IntRect clipRect = roundedIntRect(enclosingLayer()->childrenClipRect()); 109 IntRect clipRect = roundedIntRect(enclosingLayer()->childrenClipRect());
142 IntRect newFrame = roundedIntRect(frame); 110 IntRect newFrame = roundedIntRect(frame);
143 bool clipChanged = m_clipRect != clipRect; 111 bool clipChanged = m_clipRect != clipRect;
144 bool frameRectChanged = m_widget->frameRect() != newFrame; 112 bool frameRectChanged = widget->frameRect() != newFrame;
145 113
146 if (!frameRectChanged && !clipChanged) 114 if (!frameRectChanged && !clipChanged)
147 return false; 115 return false;
148 116
149 m_clipRect = clipRect; 117 m_clipRect = clipRect;
150 118
151 RefPtr<RenderWidget> protector(this); 119 RefPtr<RenderWidget> protector(this);
152 RefPtr<Node> protectedNode(node()); 120 RefPtr<Node> protectedNode(node());
153 m_widget->setFrameRect(newFrame); 121 widget->setFrameRect(newFrame);
154 122
155 if (clipChanged && !frameRectChanged) 123 if (clipChanged && !frameRectChanged)
156 m_widget->clipRectChanged(); 124 widget->clipRectChanged();
157 125
158 if (hasLayer() && layer()->compositingState() == PaintsIntoOwnBacking) 126 if (hasLayer() && layer()->compositingState() == PaintsIntoOwnBacking)
159 layer()->compositedLayerMapping()->updateAfterWidgetResize(); 127 layer()->compositedLayerMapping()->updateAfterWidgetResize();
160 128
161 bool boundsChanged = m_widget->frameRect().size() != newFrame.size(); 129 bool boundsChanged = widget->frameRect().size() != newFrame.size();
162 return boundsChanged; 130 return boundsChanged;
163 } 131 }
164 132
165 bool RenderWidget::updateWidgetGeometry() 133 bool RenderWidget::updateWidgetGeometry()
166 { 134 {
135 Widget* widget = this->widget();
136
167 LayoutRect contentBox = contentBoxRect(); 137 LayoutRect contentBox = contentBoxRect();
168 LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).bou ndingBox()); 138 LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).bou ndingBox());
169 if (m_widget->isFrameView()) { 139 if (widget->isFrameView()) {
170 contentBox.setLocation(absoluteContentBox.location()); 140 contentBox.setLocation(absoluteContentBox.location());
171 return setWidgetGeometry(contentBox); 141 return setWidgetGeometry(contentBox);
172 } 142 }
173 143
174 return setWidgetGeometry(absoluteContentBox); 144 return setWidgetGeometry(absoluteContentBox);
175 } 145 }
176 146
177 void RenderWidget::setWidget(PassRefPtr<Widget> widget)
178 {
179 if (widget == m_widget)
180 return;
181
182 if (m_widget) {
183 moveWidgetToParentSoon(m_widget.get(), 0);
184 clearWidget();
185 }
186 m_widget = widget;
187 if (m_widget) {
188 // If we've already received a layout, apply the calculated space to the
189 // widget immediately, but we have to have really been fully constructed (with a non-null
190 // style pointer).
191 if (style()) {
192 if (!needsLayout())
193 updateWidgetGeometry();
194
195 if (style()->visibility() != VISIBLE)
196 m_widget->hide();
197 else {
198 m_widget->show();
199 repaint();
200 }
201 }
202 moveWidgetToParentSoon(m_widget.get(), m_frameView);
203 }
204
205 if (AXObjectCache* cache = document().existingAXObjectCache())
206 cache->childrenChanged(this);
207 }
208
209 void RenderWidget::layout() 147 void RenderWidget::layout()
210 { 148 {
211 ASSERT(needsLayout()); 149 ASSERT(needsLayout());
212 150
213 LayoutRectRecorder recorder(*this); 151 LayoutRectRecorder recorder(*this);
214 clearNeedsLayout(); 152 clearNeedsLayout();
215 } 153 }
216 154
217 void RenderWidget::styleDidChange(StyleDifference diff, const RenderStyle* oldSt yle) 155 void RenderWidget::styleDidChange(StyleDifference diff, const RenderStyle* oldSt yle)
218 { 156 {
219 RenderReplaced::styleDidChange(diff, oldStyle); 157 RenderReplaced::styleDidChange(diff, oldStyle);
220 if (m_widget) { 158 Widget* widget = this->widget();
159
160 if (widget) {
221 if (style()->visibility() != VISIBLE) 161 if (style()->visibility() != VISIBLE)
222 m_widget->hide(); 162 widget->hide();
223 else 163 else
224 m_widget->show(); 164 widget->show();
225 } 165 }
226 } 166 }
227 167
228 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 168 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
229 { 169 {
230 LayoutPoint adjustedPaintOffset = paintOffset + location(); 170 LayoutPoint adjustedPaintOffset = paintOffset + location();
231 171
172 Widget* widget = this->widget();
173 ASSERT(widget);
174
232 // Tell the widget to paint now. This is the only time the widget is allowed 175 // Tell the widget to paint now. This is the only time the widget is allowed
233 // to paint itself. That way it will composite properly with z-indexed layer s. 176 // to paint itself. That way it will composite properly with z-indexed layer s.
234 IntPoint widgetLocation = m_widget->frameRect().location(); 177 IntPoint widgetLocation = widget->frameRect().location();
235 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p addingLeft()), 178 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p addingLeft()),
236 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop())); 179 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop()));
237 IntRect paintRect = paintInfo.rect; 180 IntRect paintRect = paintInfo.rect;
238 181
239 IntSize widgetPaintOffset = paintLocation - widgetLocation; 182 IntSize widgetPaintOffset = paintLocation - widgetLocation;
240 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer, 183 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
241 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing. 184 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing.
242 if (!widgetPaintOffset.isZero()) { 185 if (!widgetPaintOffset.isZero()) {
243 paintInfo.context->translate(widgetPaintOffset); 186 paintInfo.context->translate(widgetPaintOffset);
244 paintRect.move(-widgetPaintOffset); 187 paintRect.move(-widgetPaintOffset);
245 } 188 }
246 m_widget->paint(paintInfo.context, paintRect); 189 widget->paint(paintInfo.context, paintRect);
247 190
248 if (!widgetPaintOffset.isZero()) 191 if (!widgetPaintOffset.isZero())
249 paintInfo.context->translate(-widgetPaintOffset); 192 paintInfo.context->translate(-widgetPaintOffset);
250 193
251 if (m_widget->isFrameView()) { 194 if (widget->isFrameView()) {
252 FrameView* frameView = toFrameView(m_widget.get()); 195 FrameView* frameView = toFrameView(widget);
253 bool runOverlapTests = !frameView->useSlowRepaintsIfNotOverlapped() || f rameView->hasCompositedContent(); 196 bool runOverlapTests = !frameView->useSlowRepaintsIfNotOverlapped() || f rameView->hasCompositedContent();
254 if (paintInfo.overlapTestRequests && runOverlapTests) { 197 if (paintInfo.overlapTestRequests && runOverlapTests) {
255 ASSERT(!paintInfo.overlapTestRequests->contains(this)); 198 ASSERT(!paintInfo.overlapTestRequests->contains(this));
256 paintInfo.overlapTestRequests->set(this, m_widget->frameRect()); 199 paintInfo.overlapTestRequests->set(this, widget->frameRect());
257 } 200 }
258 } 201 }
259 } 202 }
260 203
261 void RenderWidget::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 204 void RenderWidget::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
262 { 205 {
263 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); 206 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
264 207
265 if (!shouldPaint(paintInfo, paintOffset)) 208 if (!shouldPaint(paintInfo, paintOffset))
266 return; 209 return;
(...skipping 20 matching lines...) Expand all
287 if (borderRect.isEmpty()) 230 if (borderRect.isEmpty())
288 return; 231 return;
289 232
290 // Push a clip if we have a border radius, since we want to round the fo reground content that gets painted. 233 // Push a clip if we have a border radius, since we want to round the fo reground content that gets painted.
291 paintInfo.context->save(); 234 paintInfo.context->save();
292 RoundedRect roundedInnerRect = style()->getRoundedInnerBorderFor(borderR ect, 235 RoundedRect roundedInnerRect = style()->getRoundedInnerBorderFor(borderR ect,
293 paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddin gLeft() + borderLeft(), paddingRight() + borderRight(), true, true); 236 paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddin gLeft() + borderLeft(), paddingRight() + borderRight(), true, true);
294 clipRoundedInnerRect(paintInfo.context, borderRect, roundedInnerRect); 237 clipRoundedInnerRect(paintInfo.context, borderRect, roundedInnerRect);
295 } 238 }
296 239
297 if (m_widget) 240 Widget* widget = this->widget();
241 if (widget)
298 paintContents(paintInfo, paintOffset); 242 paintContents(paintInfo, paintOffset);
299 243
300 if (style()->hasBorderRadius()) 244 if (style()->hasBorderRadius())
301 paintInfo.context->restore(); 245 paintInfo.context->restore();
302 246
303 // Paint a partially transparent wash over selected widgets. 247 // Paint a partially transparent wash over selected widgets.
304 if (isSelected() && !document().printing()) { 248 if (isSelected() && !document().printing()) {
305 // FIXME: selectionRect() is in absolute, not painting coordinates. 249 // FIXME: selectionRect() is in absolute, not painting coordinates.
306 paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), select ionBackgroundColor()); 250 paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), select ionBackgroundColor());
307 } 251 }
308 252
309 if (canResize()) 253 if (canResize())
310 layer()->scrollableArea()->paintResizer(paintInfo.context, roundedIntPoi nt(adjustedPaintOffset), paintInfo.rect); 254 layer()->scrollableArea()->paintResizer(paintInfo.context, roundedIntPoi nt(adjustedPaintOffset), paintInfo.rect);
311 } 255 }
312 256
313 void RenderWidget::setIsOverlapped(bool isOverlapped) 257 void RenderWidget::setIsOverlapped(bool isOverlapped)
314 { 258 {
315 ASSERT(m_widget); 259 Widget* widget = this->widget();
316 ASSERT(m_widget->isFrameView()); 260 ASSERT(widget);
317 toFrameView(m_widget.get())->setIsOverlapped(isOverlapped); 261 ASSERT(widget->isFrameView());
262 toFrameView(widget)->setIsOverlapped(isOverlapped);
318 } 263 }
319 264
320 void RenderWidget::deref() 265 void RenderWidget::deref()
321 { 266 {
322 if (--m_refCount <= 0) 267 if (--m_refCount <= 0)
323 postDestroy(); 268 postDestroy();
324 } 269 }
325 270
271 void RenderWidget::updateOnWidgetChange()
272 {
273 Widget* widget = this->widget();
274 if (!widget)
275 return;
276
277 if (style()) {
eseidel 2013/12/18 18:38:18 nit: early return if (!style) return;
wjmaclean 2013/12/23 23:49:53 Done.
278 if (!needsLayout())
279 updateWidgetGeometry();
280
281 if (style()->visibility() != VISIBLE) {
282 widget->hide();
eseidel 2013/12/18 18:38:18 Do we need to cause a repaint to when hiding (to r
wjmaclean 2013/12/23 23:49:53 I'm afraid I don't really know the answer to that
283 } else {
284 widget->show();
285 repaint();
286 }
287 }
288 }
289
326 void RenderWidget::updateWidgetPosition() 290 void RenderWidget::updateWidgetPosition()
327 { 291 {
328 if (!m_widget || !node()) // Check the node in case destroy() has been calle d. 292 Widget* widget = this->widget();
293 if (!widget || !node()) // Check the node in case destroy() has been called.
329 return; 294 return;
330 295
331 bool boundsChanged = updateWidgetGeometry(); 296 bool boundsChanged = updateWidgetGeometry();
332 297
333 // if the frame bounds got changed, or if view needs layout (possibly indica ting 298 // if the frame bounds got changed, or if view needs layout (possibly indica ting
334 // content size is wrong) we have to do a layout to set the right widget siz e 299 // content size is wrong) we have to do a layout to set the right widget siz e
335 if (m_widget && m_widget->isFrameView()) { 300 if (widget && widget->isFrameView()) {
336 FrameView* frameView = toFrameView(m_widget.get()); 301 FrameView* frameView = toFrameView(widget);
337 // Check the frame's page to make sure that the frame isn't in the proce ss of being destroyed. 302 // Check the frame's page to make sure that the frame isn't in the proce ss of being destroyed.
338 if ((boundsChanged || frameView->needsLayout()) && frameView->frame().pa ge()) 303 if ((boundsChanged || frameView->needsLayout()) && frameView->frame().pa ge())
339 frameView->layout(); 304 frameView->layout();
340 } 305 }
341 } 306 }
342 307
343 void RenderWidget::widgetPositionsUpdated() 308 void RenderWidget::widgetPositionsUpdated()
344 { 309 {
345 if (!m_widget) 310 Widget* widget = this->widget();
311 if (!widget)
346 return; 312 return;
347 m_widget->widgetPositionsUpdated(); 313 widget->widgetPositionsUpdated();
348 }
349
350 void RenderWidget::clearWidget()
351 {
352 m_widget = 0;
353 } 314 }
354 315
355 bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& res ult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedO ffset, HitTestAction action) 316 bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& res ult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedO ffset, HitTestAction action)
356 { 317 {
357 bool hadResult = result.innerNode(); 318 bool hadResult = result.innerNode();
358 bool inside = RenderReplaced::nodeAtPoint(request, result, locationInContain er, accumulatedOffset, action); 319 bool inside = RenderReplaced::nodeAtPoint(request, result, locationInContain er, accumulatedOffset, action);
359 320
360 // Check to see if we are really over the widget itself (and not just in the border/padding area). 321 // Check to see if we are really over the widget itself (and not just in the border/padding area).
361 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node()) 322 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node())
362 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); 323 result.setIsOverWidget(contentBoxRect().contains(result.localPoint()));
363 return inside; 324 return inside;
364 } 325 }
365 326
366 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor ) const 327 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor ) const
367 { 328 {
368 if (widget() && widget()->isPluginView()) { 329 if (widget() && widget()->isPluginView()) {
369 // A plug-in is responsible for setting the cursor when the pointer is o ver it. 330 // A plug-in is responsible for setting the cursor when the pointer is o ver it.
370 return DoNotSetCursor; 331 return DoNotSetCursor;
371 } 332 }
372 return RenderReplaced::getCursor(point, cursor); 333 return RenderReplaced::getCursor(point, cursor);
373 } 334 }
374 335
375 } // namespace WebCore 336 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698