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

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

Issue 239353007: Set proper referrer for css resource fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add test Created 6 years, 8 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 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return HTMLElement::isPresentationAttribute(name); 63 return HTMLElement::isPresentationAttribute(name);
64 } 64 }
65 65
66 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) 66 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
67 { 67 {
68 if (name == backgroundAttr) { 68 if (name == backgroundAttr) {
69 String url = stripLeadingAndTrailingHTMLSpaces(value); 69 String url = stripLeadingAndTrailingHTMLSpaces(value);
70 if (!url.isEmpty()) { 70 if (!url.isEmpty()) {
71 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create (url, document().completeURL(url)); 71 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create (url, document().completeURL(url));
72 imageValue->setInitiator(localName()); 72 imageValue->setInitiator(localName());
73 imageValue->setReferrer(document().url().strippedForUseAsReferrer()) ;
abarth-chromium 2014/04/18 16:36:49 This is not correct. You need to call document().
bashi 2014/04/22 01:22:55 Done.
73 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu e.release())); 74 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu e.release()));
74 } 75 }
75 } else if (name == marginwidthAttr || name == leftmarginAttr) { 76 } else if (name == marginwidthAttr || name == leftmarginAttr) {
76 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); 77 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value);
77 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); 78 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value);
78 } else if (name == marginheightAttr || name == topmarginAttr) { 79 } else if (name == marginheightAttr || name == topmarginAttr) {
79 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); 80 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value);
80 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); 81 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value);
81 } else if (name == bgcolorAttr) { 82 } else if (name == bgcolorAttr) {
82 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); 83 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 int HTMLBodyElement::scrollWidth() 325 int HTMLBodyElement::scrollWidth()
325 { 326 {
326 // Update the document's layout. 327 // Update the document's layout.
327 Document& document = this->document(); 328 Document& document = this->document();
328 document.updateLayoutIgnorePendingStylesheets(); 329 document.updateLayoutIgnorePendingStylesheets();
329 FrameView* view = document.view(); 330 FrameView* view = document.view();
330 return view ? adjustForZoom(view->contentsWidth(), &document) : 0; 331 return view ? adjustForZoom(view->contentsWidth(), &document) : 0;
331 } 332 }
332 333
333 } // namespace WebCore 334 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698