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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 // so tear down scope information upfront to avoid having stale references i
n the map. | 585 // so tear down scope information upfront to avoid having stale references i
n the map. |
586 destroyTreeScopeData(); | 586 destroyTreeScopeData(); |
587 | 587 |
588 removeDetachedChildren(); | 588 removeDetachedChildren(); |
589 | 589 |
590 // removeDetachedChildren() can access FormController. | 590 // removeDetachedChildren() can access FormController. |
591 m_formController.clear(); | 591 m_formController.clear(); |
592 | 592 |
593 m_markers->clear(); | 593 m_markers->clear(); |
594 | 594 |
595 m_cssCanvasElements.clear(); | |
596 | |
597 // FIXME: consider using ActiveDOMObject. | 595 // FIXME: consider using ActiveDOMObject. |
598 if (m_scriptedAnimationController) | 596 if (m_scriptedAnimationController) |
599 m_scriptedAnimationController->clearDocumentPointer(); | 597 m_scriptedAnimationController->clearDocumentPointer(); |
600 m_scriptedAnimationController.clear(); | 598 m_scriptedAnimationController.clear(); |
601 | 599 |
602 m_scriptedIdleTaskController.clear(); | 600 m_scriptedIdleTaskController.clear(); |
603 | 601 |
604 if (svgExtensions()) | 602 if (svgExtensions()) |
605 accessSVGExtensions().pauseAnimations(); | 603 accessSVGExtensions().pauseAnimations(); |
606 | 604 |
(...skipping 4298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4905 m_ranges.add(range); | 4903 m_ranges.add(range); |
4906 } | 4904 } |
4907 | 4905 |
4908 void Document::detachRange(Range* range) | 4906 void Document::detachRange(Range* range) |
4909 { | 4907 { |
4910 // We don't ASSERT m_ranges.contains(range) to allow us to call this | 4908 // We don't ASSERT m_ranges.contains(range) to allow us to call this |
4911 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 | 4909 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 |
4912 m_ranges.remove(range); | 4910 m_ranges.remove(range); |
4913 } | 4911 } |
4914 | 4912 |
4915 ScriptValue Document::getCSSCanvasContext(ScriptState* scriptState, const String
& type, const String& name, int width, int height) | |
4916 { | |
4917 HTMLCanvasElement& element = getCSSCanvasElement(name); | |
4918 element.setSize(IntSize(width, height)); | |
4919 CanvasRenderingContext* context = element.getCanvasRenderingContext(type, Ca
nvasContextCreationAttributes()); | |
4920 if (!context) { | |
4921 return ScriptValue::createNull(scriptState); | |
4922 } | |
4923 | |
4924 return ScriptValue(scriptState, toV8(context, scriptState->context()->Global
(), scriptState->isolate())); | |
4925 } | |
4926 | |
4927 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) | |
4928 { | |
4929 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam
e, nullptr).storedValue->value; | |
4930 if (!element) { | |
4931 element = HTMLCanvasElement::create(*this); | |
4932 element->setAccelerationDisabled(true); | |
4933 } | |
4934 return *element; | |
4935 } | |
4936 | |
4937 void Document::initDNSPrefetch() | 4913 void Document::initDNSPrefetch() |
4938 { | 4914 { |
4939 Settings* settings = this->settings(); | 4915 Settings* settings = this->settings(); |
4940 | 4916 |
4941 m_haveExplicitlyDisabledDNSPrefetch = false; | 4917 m_haveExplicitlyDisabledDNSPrefetch = false; |
4942 m_isDNSPrefetchEnabled = settings && settings->dnsPrefetchingEnabled() && se
curityOrigin()->protocol() == "http"; | 4918 m_isDNSPrefetchEnabled = settings && settings->dnsPrefetchingEnabled() && se
curityOrigin()->protocol() == "http"; |
4943 | 4919 |
4944 // Inherit DNS prefetch opt-out from parent frame | 4920 // Inherit DNS prefetch opt-out from parent frame |
4945 if (Document* parent = parentDocument()) { | 4921 if (Document* parent = parentDocument()) { |
4946 if (!parent->isDNSPrefetchEnabled()) | 4922 if (!parent->isDNSPrefetchEnabled()) |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5820 #ifndef NDEBUG | 5796 #ifndef NDEBUG |
5821 using namespace blink; | 5797 using namespace blink; |
5822 void showLiveDocumentInstances() | 5798 void showLiveDocumentInstances() |
5823 { | 5799 { |
5824 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5800 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5825 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5801 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5826 for (Document* document : set) | 5802 for (Document* document : set) |
5827 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5803 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5828 } | 5804 } |
5829 #endif | 5805 #endif |
OLD | NEW |