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 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // 'visibilitychange' event should bubble |
1381 // See: http://www.w3.org/TR/page-visibility/#sec-processing-model | |
dtapuska
2015/11/13 00:26:58
I don't think we need the comments here; it is pre
| |
1382 dispatchEvent(Event::createBubble(EventTypeNames::visibilitychange)); | |
1381 // Also send out the deprecated version until it can be removed. | 1383 // Also send out the deprecated version until it can be removed. |
1382 dispatchEvent(Event::create(EventTypeNames::webkitvisibilitychange)); | 1384 dispatchEvent(Event::createBubble(EventTypeNames::webkitvisibilitychange)); |
1383 | 1385 |
1384 PageVisibilityState state = pageVisibilityState(); | 1386 PageVisibilityState state = pageVisibilityState(); |
1385 for (DocumentVisibilityObserver* observer : m_visibilityObservers) | 1387 for (DocumentVisibilityObserver* observer : m_visibilityObservers) |
1386 observer->didChangeVisibilityState(state); | 1388 observer->didChangeVisibilityState(state); |
1387 | 1389 |
1388 if (state == PageVisibilityStateVisible) | 1390 if (state == PageVisibilityStateVisible) |
1389 timeline().setAllCompositorPending(); | 1391 timeline().setAllCompositorPending(); |
1390 | 1392 |
1391 if (hidden() && m_canvasFontCache) | 1393 if (hidden() && m_canvasFontCache) |
1392 m_canvasFontCache->pruneAll(); | 1394 m_canvasFontCache->pruneAll(); |
(...skipping 4439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5832 #ifndef NDEBUG | 5834 #ifndef NDEBUG |
5833 using namespace blink; | 5835 using namespace blink; |
5834 void showLiveDocumentInstances() | 5836 void showLiveDocumentInstances() |
5835 { | 5837 { |
5836 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5838 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5837 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5839 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5838 for (Document* document : set) | 5840 for (Document* document : set) |
5839 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()); |
5840 } | 5842 } |
5841 #endif | 5843 #endif |
OLD | NEW |