OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 26 matching lines...) Expand all Loading... |
37 , m_isHTMLDocument(false) | 37 , m_isHTMLDocument(false) |
38 , m_useLegacyBackgroundSizeShorthandBehavior(false) | 38 , m_useLegacyBackgroundSizeShorthandBehavior(false) |
39 , m_useCounter(useCounter) | 39 , m_useCounter(useCounter) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 CSSParserContext::CSSParserContext(const Document& document, UseCounter* useCoun
ter, const KURL& baseURL, const String& charset) | 43 CSSParserContext::CSSParserContext(const Document& document, UseCounter* useCoun
ter, const KURL& baseURL, const String& charset) |
44 : m_baseURL(baseURL.isNull() ? document.baseURL() : baseURL) | 44 : m_baseURL(baseURL.isNull() ? document.baseURL() : baseURL) |
45 , m_charset(charset) | 45 , m_charset(charset) |
46 , m_mode(document.inQuirksMode() ? HTMLQuirksMode : HTMLStandardMode) | 46 , m_mode(document.inQuirksMode() ? HTMLQuirksMode : HTMLStandardMode) |
| 47 , m_referrer(m_baseURL.strippedForUseAsReferrer(), document.referrerPolicy()
) |
47 , m_isHTMLDocument(document.isHTMLDocument()) | 48 , m_isHTMLDocument(document.isHTMLDocument()) |
48 , m_useLegacyBackgroundSizeShorthandBehavior(document.settings() ? document.
settings()->useLegacyBackgroundSizeShorthandBehavior() : false) | 49 , m_useLegacyBackgroundSizeShorthandBehavior(document.settings() ? document.
settings()->useLegacyBackgroundSizeShorthandBehavior() : false) |
49 , m_useCounter(useCounter) | 50 , m_useCounter(useCounter) |
50 { | 51 { |
51 } | 52 } |
52 | 53 |
53 CSSParserContext::CSSParserContext(const CSSParserContext& other, UseCounter* us
eCounter) | 54 CSSParserContext::CSSParserContext(const CSSParserContext& other, UseCounter* us
eCounter) |
54 : m_baseURL(other.m_baseURL) | 55 : m_baseURL(other.m_baseURL) |
55 , m_charset(other.m_charset) | 56 , m_charset(other.m_charset) |
56 , m_mode(other.m_mode) | 57 , m_mode(other.m_mode) |
| 58 , m_referrer(other.m_referrer) |
57 , m_isHTMLDocument(other.m_isHTMLDocument) | 59 , m_isHTMLDocument(other.m_isHTMLDocument) |
58 , m_useLegacyBackgroundSizeShorthandBehavior(other.m_useLegacyBackgroundSize
ShorthandBehavior) | 60 , m_useLegacyBackgroundSizeShorthandBehavior(other.m_useLegacyBackgroundSize
ShorthandBehavior) |
59 , m_useCounter(useCounter) | 61 , m_useCounter(useCounter) |
60 { | 62 { |
61 } | 63 } |
62 | 64 |
63 bool CSSParserContext::operator==(const CSSParserContext& other) const | 65 bool CSSParserContext::operator==(const CSSParserContext& other) const |
64 { | 66 { |
65 return m_baseURL == other.m_baseURL | 67 return m_baseURL == other.m_baseURL |
66 && m_charset == other.m_charset | 68 && m_charset == other.m_charset |
(...skipping 11 matching lines...) Expand all Loading... |
78 KURL CSSParserContext::completeURL(const String& url) const | 80 KURL CSSParserContext::completeURL(const String& url) const |
79 { | 81 { |
80 if (url.isNull()) | 82 if (url.isNull()) |
81 return KURL(); | 83 return KURL(); |
82 if (charset().isEmpty()) | 84 if (charset().isEmpty()) |
83 return KURL(baseURL(), url); | 85 return KURL(baseURL(), url); |
84 return KURL(baseURL(), url, charset()); | 86 return KURL(baseURL(), url, charset()); |
85 } | 87 } |
86 | 88 |
87 } // namespace WebCore | 89 } // namespace WebCore |
OLD | NEW |