Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2674973006: Move parsing of referrer policy header values to SecurityPolicy (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * Copyright (C) 2010 Google Inc. All rights reserved. 6 * Copyright (C) 2010 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 if (text && text->textContent() != params.newValue) 258 if (text && text->textContent() != params.newValue)
259 text->setTextContent(altText()); 259 text->setTextContent(altText());
260 } 260 }
261 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) { 261 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) {
262 selectSourceURL(ImageLoader::UpdateIgnorePreviousError); 262 selectSourceURL(ImageLoader::UpdateIgnorePreviousError);
263 } else if (name == usemapAttr) { 263 } else if (name == usemapAttr) {
264 setIsLink(!params.newValue.isNull()); 264 setIsLink(!params.newValue.isNull());
265 } else if (name == referrerpolicyAttr) { 265 } else if (name == referrerpolicyAttr) {
266 m_referrerPolicy = ReferrerPolicyDefault; 266 m_referrerPolicy = ReferrerPolicyDefault;
267 if (!params.newValue.isNull()) { 267 if (!params.newValue.isNull()) {
268 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords( 268 SecurityPolicy::referrerPolicyFromString(
269 params.newValue, &m_referrerPolicy); 269 params.newValue, SupportReferrerPolicyLegacyKeywords,
270 &m_referrerPolicy);
270 UseCounter::count(document(), 271 UseCounter::count(document(),
271 UseCounter::HTMLImageElementReferrerPolicyAttribute); 272 UseCounter::HTMLImageElementReferrerPolicyAttribute);
272 } 273 }
273 } else { 274 } else {
274 HTMLElement::parseAttribute(params); 275 HTMLElement::parseAttribute(params);
275 } 276 }
276 } 277 }
277 278
278 String HTMLImageElement::altText() const { 279 String HTMLImageElement::altText() const {
279 // lets figure out the alt text.. magic stuff 280 // lets figure out the alt text.. magic stuff
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 void HTMLImageElement::associateWith(HTMLFormElement* form) { 921 void HTMLImageElement::associateWith(HTMLFormElement* form) {
921 if (form && form->isConnected()) { 922 if (form && form->isConnected()) {
922 m_form = form; 923 m_form = form;
923 m_formWasSetByParser = true; 924 m_formWasSetByParser = true;
924 m_form->associate(*this); 925 m_form->associate(*this);
925 m_form->didAssociateByParser(); 926 m_form->didAssociateByParser();
926 } 927 }
927 }; 928 };
928 929
929 } // namespace blink 930 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698