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

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

Issue 1245223008: Add unit and layout test to <link rel=preconnect> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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
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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "core/frame/FrameView.h" 43 #include "core/frame/FrameView.h"
44 #include "core/frame/LocalFrame.h" 44 #include "core/frame/LocalFrame.h"
45 #include "core/frame/SubresourceIntegrity.h" 45 #include "core/frame/SubresourceIntegrity.h"
46 #include "core/frame/UseCounter.h" 46 #include "core/frame/UseCounter.h"
47 #include "core/frame/csp/ContentSecurityPolicy.h" 47 #include "core/frame/csp/ContentSecurityPolicy.h"
48 #include "core/html/LinkManifest.h" 48 #include "core/html/LinkManifest.h"
49 #include "core/html/imports/LinkImport.h" 49 #include "core/html/imports/LinkImport.h"
50 #include "core/inspector/ConsoleMessage.h" 50 #include "core/inspector/ConsoleMessage.h"
51 #include "core/loader/FrameLoader.h" 51 #include "core/loader/FrameLoader.h"
52 #include "core/loader/FrameLoaderClient.h" 52 #include "core/loader/FrameLoaderClient.h"
53 #include "core/loader/NetworkHintsInterface.h"
53 #include "core/style/StyleInheritedData.h" 54 #include "core/style/StyleInheritedData.h"
54 #include "platform/RuntimeEnabledFeatures.h" 55 #include "platform/RuntimeEnabledFeatures.h"
55 #include "wtf/StdLibExtras.h" 56 #include "wtf/StdLibExtras.h"
56 57
57 namespace blink { 58 namespace blink {
58 59
59 using namespace HTMLNames; 60 using namespace HTMLNames;
60 61
61 template <typename CharacterType> 62 template <typename CharacterType>
62 static void parseSizes(const CharacterType* value, unsigned length, Vector<IntSi ze>& iconSizes) 63 static void parseSizes(const CharacterType* value, unsigned length, Vector<IntSi ze>& iconSizes)
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 197 }
197 } 198 }
198 199
199 bool HTMLLinkElement::shouldLoadLink() 200 bool HTMLLinkElement::shouldLoadLink()
200 { 201 {
201 return inDocument(); 202 return inDocument();
202 } 203 }
203 204
204 bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url) 205 bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url)
205 { 206 {
206 return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::cro ssoriginAttr), type, as, url, document()); 207 return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::cro ssoriginAttr), type, as, url, document(), NetworkHintsInterfaceImpl());
207 } 208 }
208 209
209 LinkResource* HTMLLinkElement::linkResourceToProcess() 210 LinkResource* HTMLLinkElement::linkResourceToProcess()
210 { 211 {
211 bool visible = inDocument() && !m_isInShadowTree; 212 bool visible = inDocument() && !m_isInShadowTree;
212 if (!visible) { 213 if (!visible) {
213 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); 214 ASSERT(!linkStyle() || !linkStyle()->hasSheet());
214 return nullptr; 215 return nullptr;
215 } 216 }
216 217
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 removePendingSheet(); 768 removePendingSheet();
768 } 769 }
769 770
770 DEFINE_TRACE(LinkStyle) 771 DEFINE_TRACE(LinkStyle)
771 { 772 {
772 visitor->trace(m_sheet); 773 visitor->trace(m_sheet);
773 LinkResource::trace(visitor); 774 LinkResource::trace(visitor);
774 } 775 }
775 776
776 } // namespace blink 777 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/misc/link-preconnect-schemeless.https-expected.txt ('k') | Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698