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

Side by Side Diff: Source/core/html/parser/HTMLResourcePreloader.cpp

Issue 16325005: Remove the Media Query "forward compatibly syntax" support in alignment with HTML5 spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLStyleElement.cpp ('k') | no next file » | 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) 2013 Google Inc. All Rights Reserved. 2 * Copyright (C) 2013 Google Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 { 64 {
65 PreloadRequestStream requests; 65 PreloadRequestStream requests;
66 requests.swap(r); 66 requests.swap(r);
67 67
68 for (PreloadRequestStream::iterator it = requests.begin(); it != requests.en d(); ++it) 68 for (PreloadRequestStream::iterator it = requests.begin(); it != requests.en d(); ++it)
69 preload(it->release()); 69 preload(it->release());
70 } 70 }
71 71
72 static bool mediaAttributeMatches(Frame* frame, RenderStyle* renderStyle, const String& attributeValue) 72 static bool mediaAttributeMatches(Frame* frame, RenderStyle* renderStyle, const String& attributeValue)
73 { 73 {
74 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::createAllowingDescriptio nSyntax(attributeValue); 74 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(attributeValue);
75 MediaQueryEvaluator mediaQueryEvaluator("screen", frame, renderStyle); 75 MediaQueryEvaluator mediaQueryEvaluator("screen", frame, renderStyle);
76 return mediaQueryEvaluator.eval(mediaQueries.get()); 76 return mediaQueryEvaluator.eval(mediaQueries.get());
77 } 77 }
78 78
79 void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload) 79 void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload)
80 { 80 {
81 ASSERT(m_document->frame()); 81 ASSERT(m_document->frame());
82 ASSERT(m_document->renderer()); 82 ASSERT(m_document->renderer());
83 ASSERT(m_document->renderer()->style()); 83 ASSERT(m_document->renderer()->style());
84 if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame( ), m_document->renderer()->style(), preload->media())) 84 if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame( ), m_document->renderer()->style(), preload->media()))
85 return; 85 return;
86 86
87 CachedResourceRequest request = preload->resourceRequest(m_document); 87 CachedResourceRequest request = preload->resourceRequest(m_document);
88 m_document->cachedResourceLoader()->preload(preload->resourceType(), request , preload->charset()); 88 m_document->cachedResourceLoader()->preload(preload->resourceType(), request , preload->charset());
89 } 89 }
90 90
91 91
92 } 92 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLStyleElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698