OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 { | 372 { |
373 Document* document = toDocument(context); | 373 Document* document = toDocument(context); |
374 if (RefPtrWillBeRawPtr<Element> element = document->autofocusElement())
{ | 374 if (RefPtrWillBeRawPtr<Element> element = document->autofocusElement())
{ |
375 document->setAutofocusElement(0); | 375 document->setAutofocusElement(0); |
376 element->focus(); | 376 element->focus(); |
377 } | 377 } |
378 } | 378 } |
379 }; | 379 }; |
380 | 380 |
381 DocumentVisibilityObserver::DocumentVisibilityObserver(Document& document) | 381 DocumentVisibilityObserver::DocumentVisibilityObserver(Document& document) |
382 : m_document(0) | 382 : m_document(nullptr) |
383 { | 383 { |
384 registerObserver(document); | 384 registerObserver(document); |
385 } | 385 } |
386 | 386 |
387 DocumentVisibilityObserver::~DocumentVisibilityObserver() | 387 DocumentVisibilityObserver::~DocumentVisibilityObserver() |
388 { | 388 { |
389 #if !ENABLE(OILPAN) | 389 #if !ENABLE(OILPAN) |
390 unregisterObserver(); | 390 unregisterObserver(); |
391 #endif | 391 #endif |
392 } | 392 } |
393 | 393 |
| 394 void DocumentVisibilityObserver::trace(Visitor* visitor) |
| 395 { |
| 396 visitor->trace(m_document); |
| 397 } |
| 398 |
394 void DocumentVisibilityObserver::unregisterObserver() | 399 void DocumentVisibilityObserver::unregisterObserver() |
395 { | 400 { |
396 if (m_document) { | 401 if (m_document) { |
397 m_document->unregisterVisibilityObserver(this); | 402 m_document->unregisterVisibilityObserver(this); |
398 m_document = 0; | 403 m_document = nullptr; |
399 } | 404 } |
400 } | 405 } |
401 | 406 |
402 void DocumentVisibilityObserver::registerObserver(Document& document) | 407 void DocumentVisibilityObserver::registerObserver(Document& document) |
403 { | 408 { |
404 ASSERT(!m_document); | 409 ASSERT(!m_document); |
405 m_document = &document; | 410 m_document = &document; |
406 if (m_document) | 411 if (m_document) |
407 m_document->registerVisibilityObserver(this); | 412 m_document->registerVisibilityObserver(this); |
408 } | 413 } |
(...skipping 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5848 visitor->trace(m_compositorPendingAnimations); | 5853 visitor->trace(m_compositorPendingAnimations); |
5849 visitor->trace(m_contextDocument); | 5854 visitor->trace(m_contextDocument); |
5850 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); | 5855 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); |
5851 DocumentSupplementable::trace(visitor); | 5856 DocumentSupplementable::trace(visitor); |
5852 TreeScope::trace(visitor); | 5857 TreeScope::trace(visitor); |
5853 ContainerNode::trace(visitor); | 5858 ContainerNode::trace(visitor); |
5854 ExecutionContext::trace(visitor); | 5859 ExecutionContext::trace(visitor); |
5855 } | 5860 } |
5856 | 5861 |
5857 } // namespace WebCore | 5862 } // namespace WebCore |
OLD | NEW |