OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (pictureData.picked) { | 191 if (pictureData.picked) { |
192 sourceSizeSet = pictureData.sourceSizeSet; | 192 sourceSizeSet = pictureData.sourceSizeSet; |
193 sourceSize = pictureData.sourceSize; | 193 sourceSize = pictureData.sourceSize; |
194 } | 194 } |
195 if (sourceSizeSet) { | 195 if (sourceSizeSet) { |
196 resourceWidth.width = sourceSize; | 196 resourceWidth.width = sourceSize; |
197 resourceWidth.isSet = true; | 197 resourceWidth.isSet = true; |
198 } | 198 } |
199 | 199 |
200 // The element's 'referrerpolicy' attribute (if present) takes precedenc
e over the document's referrer policy. | 200 // The element's 'referrerpolicy' attribute (if present) takes precedenc
e over the document's referrer policy. |
201 ReferrerPolicy referrerPolicy = m_referrerPolicy != ReferrerPolicyDefaul
t ? m_referrerPolicy : documentReferrerPolicy; | 201 ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefau
lt && RuntimeEnabledFeatures::referrerPolicyAttributeEnabled()) ? m_referrerPoli
cy : documentReferrerPolicy; |
202 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, resourceType(), referrerPolicy
, resourceWidth, clientHintsPreferences, requestType); | 202 OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_t
agImpl), position, m_urlToLoad, predictedBaseURL, resourceType(), referrerPolicy
, resourceWidth, clientHintsPreferences, requestType); |
203 if (isCORSEnabled()) | 203 if (isCORSEnabled()) |
204 request->setCrossOriginEnabled(allowStoredCredentials()); | 204 request->setCrossOriginEnabled(allowStoredCredentials()); |
205 request->setCharset(charset()); | 205 request->setCharset(charset()); |
206 request->setDefer(m_defer); | 206 request->setDefer(m_defer); |
207 return request.release(); | 207 return request.release(); |
208 } | 208 } |
209 | 209 |
210 private: | 210 private: |
211 template<typename NameType> | 211 template<typename NameType> |
(...skipping 22 matching lines...) Expand all Loading... |
234 m_srcsetAttributeValue = attributeValue; | 234 m_srcsetAttributeValue = attributeValue; |
235 m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_mediaValu
es->devicePixelRatio(), m_sourceSize, attributeValue); | 235 m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_mediaValu
es->devicePixelRatio(), m_sourceSize, attributeValue); |
236 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devicePi
xelRatio(), m_sourceSize, m_imgSrcUrl, m_srcsetImageCandidate), AllowURLReplacem
ent); | 236 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devicePi
xelRatio(), m_sourceSize, m_imgSrcUrl, m_srcsetImageCandidate), AllowURLReplacem
ent); |
237 } else if (match(attributeName, sizesAttr) && !m_sourceSizeSet) { | 237 } else if (match(attributeName, sizesAttr) && !m_sourceSizeSet) { |
238 m_sourceSize = SizesAttributeParser(m_mediaValues, attributeValue).l
ength(); | 238 m_sourceSize = SizesAttributeParser(m_mediaValues, attributeValue).l
ength(); |
239 m_sourceSizeSet = true; | 239 m_sourceSizeSet = true; |
240 if (!m_srcsetImageCandidate.isEmpty()) { | 240 if (!m_srcsetImageCandidate.isEmpty()) { |
241 m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_media
Values->devicePixelRatio(), m_sourceSize, m_srcsetAttributeValue); | 241 m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_media
Values->devicePixelRatio(), m_sourceSize, m_srcsetAttributeValue); |
242 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devi
cePixelRatio(), m_sourceSize, m_imgSrcUrl, m_srcsetImageCandidate), AllowURLRepl
acement); | 242 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devi
cePixelRatio(), m_sourceSize, m_imgSrcUrl, m_srcsetImageCandidate), AllowURLRepl
acement); |
243 } | 243 } |
244 } else if (!m_referrerPolicySet && match(attributeName, referrerpolicyAt
tr) && !attributeValue.isNull()) { | 244 } else if (!m_referrerPolicySet && RuntimeEnabledFeatures::referrerPolic
yAttributeEnabled() && match(attributeName, referrerpolicyAttr) && !attributeVal
ue.isNull()) { |
245 m_referrerPolicySet = true; | 245 m_referrerPolicySet = true; |
246 SecurityPolicy::referrerPolicyFromString(attributeValue, &m_referrer
Policy); | 246 SecurityPolicy::referrerPolicyFromString(attributeValue, &m_referrer
Policy); |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 template<typename NameType> | 250 template<typename NameType> |
251 void processLinkAttribute(const NameType& attributeName, const String& attri
buteValue) | 251 void processLinkAttribute(const NameType& attributeName, const String& attri
buteValue) |
252 { | 252 { |
253 // FIXME - Don't set rel/media/crossorigin multiple times. | 253 // FIXME - Don't set rel/media/crossorigin multiple times. |
254 if (match(attributeName, hrefAttr)) { | 254 if (match(attributeName, hrefAttr)) { |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 else | 670 else |
671 mediaValues = MediaValuesCached::create(*document); | 671 mediaValues = MediaValuesCached::create(*document); |
672 ASSERT(mediaValues->isSafeToSendToAnotherThread()); | 672 ASSERT(mediaValues->isSafeToSendToAnotherThread()); |
673 defaultViewportMinWidth = document->viewportDefaultMinWidth(); | 673 defaultViewportMinWidth = document->viewportDefaultMinWidth(); |
674 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); | 674 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); |
675 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); | 675 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); |
676 referrerPolicy = ReferrerPolicyDefault; | 676 referrerPolicy = ReferrerPolicyDefault; |
677 } | 677 } |
678 | 678 |
679 } | 679 } |
OLD | NEW |