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

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

Issue 1302403005: Make img referrerpolicy attribute runtime-enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add some parens Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 if (userAgentShadowRoot()) { 263 if (userAgentShadowRoot()) {
264 Element* text = userAgentShadowRoot()->getElementById("alttext"); 264 Element* text = userAgentShadowRoot()->getElementById("alttext");
265 String value = altText(); 265 String value = altText();
266 if (text && text->textContent() != value) 266 if (text && text->textContent() != value)
267 text->setTextContent(altText()); 267 text->setTextContent(altText());
268 } 268 }
269 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) { 269 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) {
270 selectSourceURL(ImageLoader::UpdateIgnorePreviousError); 270 selectSourceURL(ImageLoader::UpdateIgnorePreviousError);
271 } else if (name == usemapAttr) { 271 } else if (name == usemapAttr) {
272 setIsLink(!value.isNull()); 272 setIsLink(!value.isNull());
273 } else if (name == referrerpolicyAttr) { 273 } else if (RuntimeEnabledFeatures::referrerPolicyAttributeEnabled() && name == referrerpolicyAttr) {
274 m_referrerPolicy = ReferrerPolicyDefault; 274 m_referrerPolicy = ReferrerPolicyDefault;
275 if (!value.isNull()) 275 if (!value.isNull())
276 SecurityPolicy::referrerPolicyFromString(value, &m_referrerPolicy); 276 SecurityPolicy::referrerPolicyFromString(value, &m_referrerPolicy);
277 } else { 277 } else {
278 HTMLElement::parseAttribute(name, value); 278 HTMLElement::parseAttribute(name, value);
279 } 279 }
280 } 280 }
281 281
282 String HTMLImageElement::altText() const 282 String HTMLImageElement::altText() const
283 { 283 {
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 ensureUserAgentShadowRoot(); 759 ensureUserAgentShadowRoot();
760 } 760 }
761 761
762 bool HTMLImageElement::isOpaque() const 762 bool HTMLImageElement::isOpaque() const
763 { 763 {
764 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); 764 Image* image = const_cast<HTMLImageElement*>(this)->imageContents();
765 return image && image->currentFrameKnownToBeOpaque(); 765 return image && image->currentFrameKnownToBeOpaque();
766 } 766 }
767 767
768 } 768 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698