OLD | NEW |
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. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 parent->addChild(child); | 79 parent->addChild(child); |
80 else | 80 else |
81 toScrollView(child->parent())->removeChild(child); | 81 toScrollView(child->parent())->removeChild(child); |
82 return; | 82 return; |
83 } | 83 } |
84 widgetNewParentMap().set(child, parent); | 84 widgetNewParentMap().set(child, parent); |
85 } | 85 } |
86 | 86 |
87 RenderWidget::RenderWidget(Element* element) | 87 RenderWidget::RenderWidget(Element* element) |
88 : RenderReplaced(element) | 88 : RenderReplaced(element) |
89 , m_widget(0) | 89 , m_widget(nullptr) |
90 // Reference counting is used to prevent the widget from being | 90 // Reference counting is used to prevent the widget from being |
91 // destroyed while inside the Widget code, which might not be | 91 // destroyed while inside the Widget code, which might not be |
92 // able to handle that. | 92 // able to handle that. |
93 , m_refCount(1) | 93 , m_refCount(1) |
94 { | 94 { |
95 ASSERT(element); | 95 ASSERT(element); |
96 frameView()->addWidget(this); | 96 frameView()->addWidget(this); |
97 } | 97 } |
98 | 98 |
99 void RenderWidget::willBeDestroyed() | 99 void RenderWidget::willBeDestroyed() |
100 { | 100 { |
101 frameView()->removeWidget(this); | 101 frameView()->removeWidget(this); |
102 | 102 |
103 if (AXObjectCache* cache = document().existingAXObjectCache()) { | 103 if (AXObjectCache* cache = document().existingAXObjectCache()) { |
104 cache->childrenChanged(this->parent()); | 104 cache->childrenChanged(this->parent()); |
105 cache->remove(this); | 105 cache->remove(this); |
106 } | 106 } |
107 | 107 |
108 setWidget(0); | 108 setWidget(nullptr); |
109 | 109 |
110 RenderReplaced::willBeDestroyed(); | 110 RenderReplaced::willBeDestroyed(); |
111 } | 111 } |
112 | 112 |
113 void RenderWidget::destroy() | 113 void RenderWidget::destroy() |
114 { | 114 { |
115 willBeDestroyed(); | 115 willBeDestroyed(); |
116 clearNode(); | 116 clearNode(); |
117 deref(); | 117 deref(); |
118 } | 118 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 void RenderWidget::widgetPositionsUpdated() | 337 void RenderWidget::widgetPositionsUpdated() |
338 { | 338 { |
339 if (!m_widget) | 339 if (!m_widget) |
340 return; | 340 return; |
341 m_widget->widgetPositionsUpdated(); | 341 m_widget->widgetPositionsUpdated(); |
342 } | 342 } |
343 | 343 |
344 void RenderWidget::clearWidget() | 344 void RenderWidget::clearWidget() |
345 { | 345 { |
346 m_widget = 0; | 346 m_widget = nullptr; |
347 } | 347 } |
348 | 348 |
349 bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& res
ult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedO
ffset, HitTestAction action) | 349 bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& res
ult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedO
ffset, HitTestAction action) |
350 { | 350 { |
351 bool hadResult = result.innerNode(); | 351 bool hadResult = result.innerNode(); |
352 bool inside = RenderReplaced::nodeAtPoint(request, result, locationInContain
er, accumulatedOffset, action); | 352 bool inside = RenderReplaced::nodeAtPoint(request, result, locationInContain
er, accumulatedOffset, action); |
353 | 353 |
354 // Check to see if we are really over the widget itself (and not just in the
border/padding area). | 354 // Check to see if we are really over the widget itself (and not just in the
border/padding area). |
355 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode()
== node()) | 355 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode()
== node()) |
356 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); | 356 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); |
357 return inside; | 357 return inside; |
358 } | 358 } |
359 | 359 |
360 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor
) const | 360 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor
) const |
361 { | 361 { |
362 if (widget() && widget()->isPluginView()) { | 362 if (widget() && widget()->isPluginView()) { |
363 // A plug-in is responsible for setting the cursor when the pointer is o
ver it. | 363 // A plug-in is responsible for setting the cursor when the pointer is o
ver it. |
364 return DoNotSetCursor; | 364 return DoNotSetCursor; |
365 } | 365 } |
366 return RenderReplaced::getCursor(point, cursor); | 366 return RenderReplaced::getCursor(point, cursor); |
367 } | 367 } |
368 | 368 |
369 } // namespace WebCore | 369 } // namespace WebCore |
OLD | NEW |