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

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

Issue 23861003: Enable srcset support in HTMLImageElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Enable srcset support in HTMLImageElement Created 7 years, 3 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) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 551
552 if (isStopped()) 552 if (isStopped())
553 return; 553 return;
554 554
555 if (session.needsYield) 555 if (session.needsYield)
556 m_parserScheduler->scheduleForResume(); 556 m_parserScheduler->scheduleForResume();
557 557
558 if (isWaitingForScripts()) { 558 if (isWaitingForScripts()) {
559 ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState); 559 ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
560 if (!m_preloadScanner) { 560 if (!m_preloadScanner) {
561 m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, docume nt()->url())); 561 m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, docume nt()->url(), document()->devicePixelRatio()));
562 m_preloadScanner->appendToEnd(m_input.current()); 562 m_preloadScanner->appendToEnd(m_input.current());
563 } 563 }
564 m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL()); 564 m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
565 } 565 }
566 566
567 InspectorInstrumentation::didWriteHTML(cookie, m_input.current().currentLine ().zeroBasedInt()); 567 InspectorInstrumentation::didWriteHTML(cookie, m_input.current().currentLine ().zeroBasedInt());
568 } 568 }
569 569
570 void HTMLDocumentParser::constructTreeFromHTMLToken(HTMLToken& rawToken) 570 void HTMLDocumentParser::constructTreeFromHTMLToken(HTMLToken& rawToken)
571 { 571 {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 625 }
626 626
627 SegmentedString excludedLineNumberSource(source); 627 SegmentedString excludedLineNumberSource(source);
628 excludedLineNumberSource.setExcludeLineNumbers(); 628 excludedLineNumberSource.setExcludeLineNumbers();
629 m_input.insertAtCurrentInsertionPoint(excludedLineNumberSource); 629 m_input.insertAtCurrentInsertionPoint(excludedLineNumberSource);
630 pumpTokenizerIfPossible(ForceSynchronous); 630 pumpTokenizerIfPossible(ForceSynchronous);
631 631
632 if (isWaitingForScripts()) { 632 if (isWaitingForScripts()) {
633 // Check the document.write() output with a separate preload scanner as 633 // Check the document.write() output with a separate preload scanner as
634 // the main scanner can't deal with insertions. 634 // the main scanner can't deal with insertions.
635 if (!m_insertionPreloadScanner) 635 if (!m_insertionPreloadScanner) {
636 m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_option s, document()->url())); 636 m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_option s, document()->url(), document()->devicePixelRatio()));
637 }
637 m_insertionPreloadScanner->appendToEnd(source); 638 m_insertionPreloadScanner->appendToEnd(source);
638 m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseEleme ntURL()); 639 m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseEleme ntURL());
639 } 640 }
640 641
641 endIfDelayed(); 642 endIfDelayed();
642 } 643 }
643 644
644 void HTMLDocumentParser::startBackgroundParser() 645 void HTMLDocumentParser::startBackgroundParser()
645 { 646 {
646 ASSERT(shouldUseThreading()); 647 ASSERT(shouldUseThreading());
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 m_parserScheduler->suspend(); 952 m_parserScheduler->suspend();
952 } 953 }
953 954
954 void HTMLDocumentParser::resumeScheduledTasks() 955 void HTMLDocumentParser::resumeScheduledTasks()
955 { 956 {
956 if (m_parserScheduler) 957 if (m_parserScheduler)
957 m_parserScheduler->resume(); 958 m_parserScheduler->resume();
958 } 959 }
959 960
960 } 961 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698