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

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

Issue 335313003: MediaQueryEvaluator getting mediaType from MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a comment Created 6 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
« no previous file with comments | « Source/core/html/HTMLLinkElement.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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return linkTag.localName(); 90 return linkTag.localName();
91 if (match(tagImpl, scriptTag)) 91 if (match(tagImpl, scriptTag))
92 return scriptTag.localName(); 92 return scriptTag.localName();
93 ASSERT_NOT_REACHED(); 93 ASSERT_NOT_REACHED();
94 return emptyString(); 94 return emptyString();
95 } 95 }
96 96
97 static bool mediaAttributeMatches(const MediaValues& mediaValues, const String& attributeValue) 97 static bool mediaAttributeMatches(const MediaValues& mediaValues, const String& attributeValue)
98 { 98 {
99 RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::createOffMai nThread(attributeValue); 99 RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::createOffMai nThread(attributeValue);
100 MediaQueryEvaluator mediaQueryEvaluator("screen", mediaValues); 100 MediaQueryEvaluator mediaQueryEvaluator(mediaValues);
101 return mediaQueryEvaluator.eval(mediaQueries.get()); 101 return mediaQueryEvaluator.eval(mediaQueries.get());
102 } 102 }
103 103
104 class TokenPreloadScanner::StartTagScanner { 104 class TokenPreloadScanner::StartTagScanner {
105 public: 105 public:
106 StartTagScanner(const StringImpl* tagImpl, PassRefPtr<MediaValues> mediaValu es) 106 StartTagScanner(const StringImpl* tagImpl, PassRefPtr<MediaValues> mediaValu es)
107 : m_tagImpl(tagImpl) 107 : m_tagImpl(tagImpl)
108 , m_linkIsStyleSheet(false) 108 , m_linkIsStyleSheet(false)
109 , m_matchedMediaAttribute(true) 109 , m_matchedMediaAttribute(true)
110 , m_inputIsImage(false) 110 , m_inputIsImage(false)
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 if (m_token.type() == HTMLToken::StartTag) 500 if (m_token.type() == HTMLToken::StartTag)
501 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name (), Likely8Bit)); 501 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name (), Likely8Bit));
502 m_scanner.scan(m_token, m_source, requests); 502 m_scanner.scan(m_token, m_source, requests);
503 m_token.clear(); 503 m_token.clear();
504 } 504 }
505 505
506 preloader->takeAndPreload(requests); 506 preloader->takeAndPreload(requests);
507 } 507 }
508 508
509 } 509 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698