The preloader needs to do source selection properly on picture elements.
Created attachment 268703 [details] Patch
Attachment 268703 [details] did not pass style-queue: ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:124: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:177: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 268704 [details] Patch
Attachment 268704 [details] did not pass style-queue: ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:124: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:177: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 268704 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=268704&action=review > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:124 > + if (m_tagId == TagId::Source && !pictureState.isEmpty() && pictureState.last() == false && m_mediaMatched && !m_srcSetAttribute.isEmpty()) { Why not !pictureState.last() ? > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:177 > + bool alreadyMatchedSource = inPicture && pictureState.last() == true; Same here.
Comment on attachment 268704 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=268704&action=review > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:128 > + pictureState.removeLast(); I believe we could replace these 2 lines with: pictureState.last() = true; and avoid any vector resizing. > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:174 > + void processAttribute(const AtomicString& attributeName, const String& attributeValue, Document& document, Vector<bool> pictureState) const Vector<bool>& ? > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:210 > + RefPtr<MediaQuerySet> mediaSet = MediaQuerySet::createAllowingDescriptionSyntax(attributeValue); Ref<> > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:213 > + m_mediaMatched = evaluator.evalCheckingViewportDependentResults(mediaSet.get(), viewportDependentMediaQueryResults); .ptr() instead of .get() if you switch to Ref<>. > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:326 > + bool m_mediaMatched { true }; Would be clearer with a 'is' / 'was' prefix, as per coding style. > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:364 > m_inStyle = false; We probably want to add an early return after this to avoid running your new check.
Fixed in r194865.