| 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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1727 parser->executeScriptsWaitingForResources(); | 1727 parser->executeScriptsWaitingForResources(); |
| 1728 } | 1728 } |
| 1729 | 1729 |
| 1730 CSSStyleSheet& Document::elementSheet() | 1730 CSSStyleSheet& Document::elementSheet() |
| 1731 { | 1731 { |
| 1732 if (!m_elemSheet) | 1732 if (!m_elemSheet) |
| 1733 m_elemSheet = CSSStyleSheet::createInline(this, m_baseURL); | 1733 m_elemSheet = CSSStyleSheet::createInline(this, m_baseURL); |
| 1734 return *m_elemSheet; | 1734 return *m_elemSheet; |
| 1735 } | 1735 } |
| 1736 | 1736 |
| 1737 void Document::processHttpEquiv(const AtomicString& equiv, const AtomicString& c
ontent, bool inDocumentHeadElement) | |
| 1738 { | |
| 1739 ASSERT(!equiv.isNull() && !content.isNull()); | |
| 1740 | |
| 1741 if (equalIgnoringCase(equiv, "refresh")) { | |
| 1742 processHttpEquivRefresh(content); | |
| 1743 } else if (equalIgnoringCase(equiv, "content-language")) { | |
| 1744 setContentLanguage(content); | |
| 1745 } | |
| 1746 } | |
| 1747 | |
| 1748 void Document::processHttpEquivRefresh(const AtomicString& content) | |
| 1749 { | |
| 1750 maybeHandleHttpRefresh(content, HttpRefreshFromMetaTag); | |
| 1751 } | |
| 1752 | |
| 1753 void Document::maybeHandleHttpRefresh(const String& content, HttpRefreshType htt
pRefreshType) | |
| 1754 { | |
| 1755 // FIXME(sky): remove | |
| 1756 } | |
| 1757 | |
| 1758 void Document::processReferrerPolicy(const String& policy) | |
| 1759 { | |
| 1760 ASSERT(!policy.isNull()); | |
| 1761 | |
| 1762 if (equalIgnoringCase(policy, "never")) { | |
| 1763 setReferrerPolicy(ReferrerPolicyNever); | |
| 1764 } else if (equalIgnoringCase(policy, "always")) { | |
| 1765 setReferrerPolicy(ReferrerPolicyAlways); | |
| 1766 } else if (equalIgnoringCase(policy, "origin")) { | |
| 1767 setReferrerPolicy(ReferrerPolicyOrigin); | |
| 1768 } else if (equalIgnoringCase(policy, "default")) { | |
| 1769 setReferrerPolicy(ReferrerPolicyDefault); | |
| 1770 } else { | |
| 1771 addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMe
ssageLevel, "Failed to set referrer policy: The value '" + policy + "' is not on
e of 'always', 'default', 'never', or 'origin'. Defaulting to 'never'.")); | |
| 1772 setReferrerPolicy(ReferrerPolicyNever); | |
| 1773 } | |
| 1774 } | |
| 1775 | |
| 1776 void Document::setReferrerPolicy(ReferrerPolicy referrerPolicy) | |
| 1777 { | |
| 1778 // FIXME: Can we adopt the CSP referrer policy merge algorithm? Or does the
web rely on being able to modify the referrer policy in-flight? | |
| 1779 if (m_didSetReferrerPolicy) | |
| 1780 UseCounter::count(this, UseCounter::ResetReferrerPolicy); | |
| 1781 m_didSetReferrerPolicy = true; | |
| 1782 | |
| 1783 m_referrerPolicy = referrerPolicy; | |
| 1784 } | |
| 1785 | |
| 1786 String Document::outgoingReferrer() | 1737 String Document::outgoingReferrer() |
| 1787 { | 1738 { |
| 1788 // See http://www.whatwg.org/specs/web-apps/current-work/#fetching-resources | 1739 // See http://www.whatwg.org/specs/web-apps/current-work/#fetching-resources |
| 1789 // for why we walk the parent chain for srcdoc documents. | 1740 // for why we walk the parent chain for srcdoc documents. |
| 1790 Document* referrerDocument = this; | 1741 Document* referrerDocument = this; |
| 1791 return referrerDocument->m_url.strippedForUseAsReferrer(); | 1742 return referrerDocument->m_url.strippedForUseAsReferrer(); |
| 1792 } | 1743 } |
| 1793 | 1744 |
| 1794 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r
equest, const LayoutPoint& documentPoint, const PlatformMouseEvent& event) | 1745 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r
equest, const LayoutPoint& documentPoint, const PlatformMouseEvent& event) |
| 1795 { | 1746 { |
| (...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3051 using namespace blink; | 3002 using namespace blink; |
| 3052 void showLiveDocumentInstances() | 3003 void showLiveDocumentInstances() |
| 3053 { | 3004 { |
| 3054 WeakDocumentSet& set = liveDocumentSet(); | 3005 WeakDocumentSet& set = liveDocumentSet(); |
| 3055 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 3006 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 3056 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { | 3007 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { |
| 3057 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); | 3008 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); |
| 3058 } | 3009 } |
| 3059 } | 3010 } |
| 3060 #endif | 3011 #endif |
| OLD | NEW |