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 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1722 assertLayoutTreeUpdated(*shadowRoot); | 1722 assertLayoutTreeUpdated(*shadowRoot); |
1723 } | 1723 } |
1724 } | 1724 } |
1725 #endif | 1725 #endif |
1726 | 1726 |
1727 void Document::updateLayoutTree(StyleRecalcChange change) | 1727 void Document::updateLayoutTree(StyleRecalcChange change) |
1728 { | 1728 { |
1729 ASSERT(isMainThread()); | 1729 ASSERT(isMainThread()); |
1730 | 1730 |
1731 ScriptForbiddenScope forbidScript; | 1731 ScriptForbiddenScope forbidScript; |
1732 // We should forbid script execution for plugins here because update while l ayout is changing, | |
1733 // HTMLPlugin element can be reattached and plugin can be destroyed. Plugin can execute scripts | |
1734 // on destroy. It produces crash without PluginScriptForbiddenScope: crbug.c om/550427. | |
1735 PluginScriptForbiddenScope pluginForbidScript; | |
dcheng
2016/02/12 20:09:12
Note that the reason this works is because some pa
pfeldman
2016/02/17 01:20:31
How would /core contributor know when to use Scrip
esprehn
2016/02/18 02:17:30
PluginScriptForbidden is poorly named, it's more l
| |
1732 | 1736 |
1733 if (!view() || !isActive()) | 1737 if (!view() || !isActive()) |
1734 return; | 1738 return; |
1735 | 1739 |
1736 if (view()->shouldThrottleRendering()) | 1740 if (view()->shouldThrottleRendering()) |
1737 return; | 1741 return; |
1738 | 1742 |
1739 if (change != Force && !needsLayoutTreeUpdate()) { | 1743 if (change != Force && !needsLayoutTreeUpdate()) { |
1740 if (lifecycle().state() < DocumentLifecycle::StyleClean) { | 1744 if (lifecycle().state() < DocumentLifecycle::StyleClean) { |
1741 // needsLayoutTreeUpdate may change to false without any actual layo ut tree update. | 1745 // needsLayoutTreeUpdate may change to false without any actual layo ut tree update. |
(...skipping 4209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5951 #ifndef NDEBUG | 5955 #ifndef NDEBUG |
5952 using namespace blink; | 5956 using namespace blink; |
5953 void showLiveDocumentInstances() | 5957 void showLiveDocumentInstances() |
5954 { | 5958 { |
5955 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5959 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5956 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5960 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5957 for (Document* document : set) | 5961 for (Document* document : set) |
5958 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); | 5962 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); |
5959 } | 5963 } |
5960 #endif | 5964 #endif |
OLD | NEW |