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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1435893003: PageVisibility API: Ensure bubbling events are generated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary comments Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/page-visibility-bubble-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 return pageVisibilityStateString(pageVisibilityState()); 1370 return pageVisibilityStateString(pageVisibilityState());
1371 } 1371 }
1372 1372
1373 bool Document::hidden() const 1373 bool Document::hidden() const
1374 { 1374 {
1375 return pageVisibilityState() != PageVisibilityStateVisible; 1375 return pageVisibilityState() != PageVisibilityStateVisible;
1376 } 1376 }
1377 1377
1378 void Document::didChangeVisibilityState() 1378 void Document::didChangeVisibilityState()
1379 { 1379 {
1380 dispatchEvent(Event::create(EventTypeNames::visibilitychange)); 1380 dispatchEvent(Event::createBubble(EventTypeNames::visibilitychange));
1381 // Also send out the deprecated version until it can be removed. 1381 // Also send out the deprecated version until it can be removed.
1382 dispatchEvent(Event::create(EventTypeNames::webkitvisibilitychange)); 1382 dispatchEvent(Event::createBubble(EventTypeNames::webkitvisibilitychange));
1383 1383
1384 PageVisibilityState state = pageVisibilityState(); 1384 PageVisibilityState state = pageVisibilityState();
1385 for (DocumentVisibilityObserver* observer : m_visibilityObservers) 1385 for (DocumentVisibilityObserver* observer : m_visibilityObservers)
1386 observer->didChangeVisibilityState(state); 1386 observer->didChangeVisibilityState(state);
1387 1387
1388 if (state == PageVisibilityStateVisible) 1388 if (state == PageVisibilityStateVisible)
1389 timeline().setAllCompositorPending(); 1389 timeline().setAllCompositorPending();
1390 1390
1391 if (hidden() && m_canvasFontCache) 1391 if (hidden() && m_canvasFontCache)
1392 m_canvasFontCache->pruneAll(); 1392 m_canvasFontCache->pruneAll();
(...skipping 4441 matching lines...) Expand 10 before | Expand all | Expand 10 after
5834 #ifndef NDEBUG 5834 #ifndef NDEBUG
5835 using namespace blink; 5835 using namespace blink;
5836 void showLiveDocumentInstances() 5836 void showLiveDocumentInstances()
5837 { 5837 {
5838 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5838 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5839 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5839 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5840 for (Document* document : set) 5840 for (Document* document : set)
5841 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5841 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5842 } 5842 }
5843 #endif 5843 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/page-visibility-bubble-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698