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 4893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4904 m_ranges.add(range); | 4904 m_ranges.add(range); |
4905 } | 4905 } |
4906 | 4906 |
4907 void Document::detachRange(Range* range) | 4907 void Document::detachRange(Range* range) |
4908 { | 4908 { |
4909 // We don't ASSERT m_ranges.contains(range) to allow us to call this | 4909 // We don't ASSERT m_ranges.contains(range) to allow us to call this |
4910 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 | 4910 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 |
4911 m_ranges.remove(range); | 4911 m_ranges.remove(range); |
4912 } | 4912 } |
4913 | 4913 |
4914 ScriptValue Document::getCSSCanvasContext(ScriptState* scriptState, const String
& type, const String& name, int width, int height) | |
4915 { | |
4916 HTMLCanvasElement& element = getCSSCanvasElement(name); | |
4917 element.setSize(IntSize(width, height)); | |
4918 CanvasRenderingContext* context = element.getCanvasRenderingContext(type, Ca
nvasContextCreationAttributes()); | |
4919 if (!context) { | |
4920 return ScriptValue::createNull(scriptState); | |
4921 } | |
4922 | |
4923 return ScriptValue(scriptState, toV8(context, scriptState->context()->Global
(), scriptState->isolate())); | |
4924 } | |
4925 | |
4926 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) | |
4927 { | |
4928 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam
e, nullptr).storedValue->value; | |
4929 if (!element) { | |
4930 element = HTMLCanvasElement::create(*this); | |
4931 element->setAccelerationDisabled(true); | |
4932 } | |
4933 return *element; | |
4934 } | |
4935 | |
4936 void Document::initDNSPrefetch() | 4914 void Document::initDNSPrefetch() |
4937 { | 4915 { |
4938 Settings* settings = this->settings(); | 4916 Settings* settings = this->settings(); |
4939 | 4917 |
4940 m_haveExplicitlyDisabledDNSPrefetch = false; | 4918 m_haveExplicitlyDisabledDNSPrefetch = false; |
4941 m_isDNSPrefetchEnabled = settings && settings->dnsPrefetchingEnabled() && se
curityOrigin()->protocol() == "http"; | 4919 m_isDNSPrefetchEnabled = settings && settings->dnsPrefetchingEnabled() && se
curityOrigin()->protocol() == "http"; |
4942 | 4920 |
4943 // Inherit DNS prefetch opt-out from parent frame | 4921 // Inherit DNS prefetch opt-out from parent frame |
4944 if (Document* parent = parentDocument()) { | 4922 if (Document* parent = parentDocument()) { |
4945 if (!parent->isDNSPrefetchEnabled()) | 4923 if (!parent->isDNSPrefetchEnabled()) |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5819 #ifndef NDEBUG | 5797 #ifndef NDEBUG |
5820 using namespace blink; | 5798 using namespace blink; |
5821 void showLiveDocumentInstances() | 5799 void showLiveDocumentInstances() |
5822 { | 5800 { |
5823 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5801 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5824 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5802 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5825 for (Document* document : set) | 5803 for (Document* document : set) |
5826 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5804 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5827 } | 5805 } |
5828 #endif | 5806 #endif |
OLD | NEW |